How to calculate the Fibonacci sequence

Author: Eric Farmer
Date Of Creation: 10 March 2021
Update Date: 1 July 2024
Anonim
Mathematics - Fibonacci Sequence and the Golden Ratio
Video: Mathematics - Fibonacci Sequence and the Golden Ratio

Content

The Fibonacci sequence is a series of numbers in which each subsequent number is equal to the sum of the previous two numbers. Number sequences are often found in nature and art in the form of spirals and the "golden ratio". The easiest way to calculate the Fibonacci sequence is to create a table, but this method is not applicable to large sequences. For example, if you need to determine the 100th term in a sequence, it is better to use the Binet formula.

Steps

Method 1 of 2: Table

  1. 1 Draw a table with two columns. The number of rows in the table depends on the number of Fibonacci sequence numbers to be found.
    • For example, if you want to find the fifth number in a sequence, draw a table with five rows.
    • Using the table, you cannot find some random number without calculating all the previous numbers. For example, if you need to find the 100th number in a sequence, you need to calculate all numbers: from the first to the 99th. Therefore, the table is applicable only for finding the first numbers of the sequence.
  2. 2 In the left column, write the ordinal numbers of the members of the sequence. That is, write the numbers in order, starting with one.
    • Such numbers determine the ordinal numbers of the members (numbers) of the Fibonacci sequence.
    • For example, if you need to find the fifth number of a sequence, write the following numbers in the left column: 1, 2, 3, 4, 5. That is, you need to find the first through the fifth number of the sequence.
  3. 3 On the first line of the right column, write 1. This is the first number (member) of the Fibonacci sequence.
    • Keep in mind that the Fibonacci sequence always starts with 1. If the sequence starts with a different number, you have miscalculated all the numbers up to the first.
  4. 4 Add 0 to the first term (1). This is the second number in the sequence.
    • Remember: to find any number in the Fibonacci sequence, simply add the previous two numbers.
    • To create a sequence, don't forget about the 0 that comes before 1 (the first term), so 1 + 0 = 1.
  5. 5 Add the first (1) and second (1) terms. This is the third number in the sequence.
    • 1 + 1 = 2. The third term is 2.
  6. 6 Add the second (1) and third (2) terms to get the fourth number in the sequence.
    • 1 + 2 = 3. The fourth term is 3.
  7. 7 Add the third (2) and fourth (3) terms. This is the fifth number in the sequence.
    • 2 + 3 = 5. The fifth term is 5.
  8. 8 Add the previous two numbers to find any number in the Fibonacci sequence. This method is based on the formula: Fn=Fn1+Fn2{ displaystyle F_ {n} = F_ {n-1} + F_ {n-2}}... This formula is not closed, so this formula cannot find any member of the sequence without calculating all the previous numbers.

Method 2 of 2: Binet Formula and Golden Ratio

  1. 1 Write down the formula:xn{ displaystyle x_ {n}}=ϕn(1ϕ)n5{ displaystyle { frac { phi ^ {n} - (1- phi) ^ {n}} { sqrt {5}}}}... In this formula xn{ displaystyle x_ {n}} - the required member of the sequence, n{ displaystyle n} - the serial number of the member, ϕ{ displaystyle phi} - the golden ratio.
    • This is a closed formula, so it can be used to find any member of the sequence without calculating all the previous numbers.
    • This is a simplified formula derived from Binet's formula for Fibonacci numbers.
    • The formula contains the golden ratio (ϕ{ displaystyle phi}), because the ratio of any two consecutive numbers in the Fibonacci sequence is very similar to the golden ratio.
  2. 2 Substitute the ordinal number of the number in the formula (instead of n{ displaystyle n}).n{ displaystyle n} Is the ordinal number of any desired member of the sequence.
    • For example, if you need to find the fifth number in a sequence, substitute 5 in the formula.The formula will be written like this: x5{ displaystyle x_ {5}}=ϕ5(1ϕ)55{ displaystyle { frac { phi ^ {5} - (1- phi) ^ {5}} { sqrt {5}}}}.
  3. 3 Substitute the golden ratio into the formula. The golden ratio is approximately equal to 1.618034; plug this number into the formula.
    • For example, if you need to find the fifth number of a sequence, the formula will be written like this:x5{ displaystyle x_ {5}}=(1,618034)5(11,618034)55{ displaystyle { frac {(1.618034) ^ {5} - (1-1.618034) ^ {5}} { sqrt {5}}}}.
  4. 4 Evaluate the expression in parentheses. Do not forget about the correct order of mathematical operations, in which the expression in parentheses is evaluated first:11,618034=0,618034{ displaystyle 1-1.618034 = -0.618034}.
    • In our example, the formula will be written like this: x5{ displaystyle x_ {5}}=(1,618034)5(0,618034)55{ displaystyle { frac {(1.618034) ^ {5} - (- 0.618034) ^ {5}} { sqrt {5}}}}.
  5. 5 Raise the numbers to powers. Raise the two numbers in the numerator to the appropriate powers.
    • In our example: 1,6180345=11,090170{ displaystyle 1.618034 ^ {5} = 11.090170}; 0,6180345=0,090169{ displaystyle -0.618034 ^ {5} = - 0.090169}... The formula will be written like this: x5=11,090170(0,090169)5{ displaystyle x_ {5} = { frac {11.090170 - (- 0.090169)} { sqrt {5}}}}.
  6. 6 Subtract two numbers. Subtract the numbers in the numerator before dividing.
    • In our example: 11,090170(0,090169)=11,180339{ displaystyle 11.090170 - (- 0.090169) = 11.180339}... The formula will be written like this: x5{ displaystyle x_ {5}}=11,1803395{ displaystyle { frac {11,180339} { sqrt {5}}}}.
  7. 7 Divide the result by the square root of 5. The square root of 5 is approximately 2.236067.
    • In our example: 11,1803392,236067=5,000002{ displaystyle { frac {11.180339} {2.236067}} = 5.000002}.
  8. 8 Round the result to the nearest whole number. The last result will be a decimal fraction that is close to an integer. Such an integer is the number of the Fibonacci sequence.
    • If you use non-rounded numbers in your calculations, you get an integer. It is much easier to work with rounded numbers, but in this case you will get a decimal fraction.
    • In our example, you got the decimal 5.000002. Round it to the nearest whole number to get the fifth Fibonacci number, which is 5.