You are on page 1of 6

The Fibonacci Numbers

Recurrence Relations

1 The Fibonacci Numbers


The Fibonacci sequence is named after Leonardo of Pisa who is better known by the
name Fibonacci.

Figure 1: Statue of Fibonacci in Pisa, Italy

He coined the sequence as follows

“A certain man put a pair of rabbits in a place surrounded by a wall. How many pairs
of rabbits can be produced from that pair in a year if it is supposed that every month each
pair begets a new pair from which the second month on becomes productive? ”

The sequence considers the growth of a (slightly unrealistic) population of rabbits. The
rules governing the growth of the population of rabbits are as follows

• A newborn pair of rabbits, one male, one female, are put in a field.

• Rabbits are able to mate at the age of one month so that at the end of its second
month a female can produce another pair of rabbits.

• Rabbits never die and a mating pair always produces one new pair (one male, one
female) every month from the second month on.

Fibonacci asked, “how many pairs of rabbits will there be at the end of one year?”

1
2 Analysis
We analyse the problem as follows

• At the end of month one the rabbits mate. There is still only 1 pair.

• At the end of month two the female gives birth to a new pair. There are 2 pairs of
rabbits.

• At the end of month three, the original female gives birth to a second pair. There
are 3 pairs of rabbits.

• At the end of the fourth month, the original female gives birth to another new pair.
The female born two months ago gives birth to a pair. There are 5 pairs of rabbits.

We can visualize the population growth using the graphic below

At the end of the nth month, the number of pairs of rabbits is equal to the number of
new pairs (which is the number of pairs in month n − 2) plus the number of pairs alive
last month (n − 1). This is the nth Fibonacci number. The Fibonacci Sequences begins

0, 1

and continues according to the rule that each number in the sequence is the sum of the
previous two numbers in the sequence. The first eight terms in the Fibonacci sequence
are shown below
0, 1, 1, 2, 3, 5, 8, 13, . . .

2
3 Recurrence Relations
Let’s use the notation Fn to represent the nth entry in the Fibonacci sequence so for
example
F0 = 0
F1 = 1
F2 = 0+1=1
F3 = 1+1=2
F4 = 1+2=3
F5 = 2+3=5
F6 = 3+5=8
.. .. ..
. . .
This notation enables us to write down a simple formula for the nth Fibonacci number
Fn = Fn−1 + Fn−2
for n ≥ 2. This type of formula is often referred to as a recursive formula or as a
recurrence relation. recurrence relations are very useful in computer science and they
can be used to illustrate lots of nice concepts including loops and iteration.
Exercise
Find the first twenty Fibonacci numbers.

Th Fibonacci recurrence is a nice formula but it has one unpleasant aspect. In order
to calculate the nth Fibonacci number we need to know the previous two and when n is
large this can be extremely tedious and time consuming. What we would really like is
a formula for the nth Fibonacci number which doesn’t require such calculations. Such
a formula could be considered a solution to the recurrence relation. In fact there
is a formula which generates the nth Fibonacci number known as Binet’s Formula. The
derivation of this formula is beyond the scope of this course but the formula itself is given
below.

Binet’s Fibonacci Formula


The nth Fibonacci number is given by
√ √
(1 + 5)n − (1 − 5)n
Fn = √ .
2n 5
Those with a keen eye might recognize that this formula can be written as

φn − (−φ)−n
Fn = √ ,
5

1+ 5
where φ = 2
the golden ratio!

3
Example

Use Binet’s Fibonacci formula to compute the 30th Fibonacci number.

Solution:

√ 30 √
(1 + 5) − (1 − 5)30
F30 = √
230 5
= 832040

4 Fibonacci and the Golden Ratio


The golden ratio is briefly mentioned in the definition of Binet’s formula above. The
golden ration, sometimes called the divine proportion, is a mysterious number which can
be found throughout history in mathematics, art and architecture to name but a few. It
is an irrational number and is a solution to the quadratic equation

x2 − x − 1 = 0.

Using the quadratic formula to solve this equation we can obtain it’s value and we give
it the symbol φ.

1+ 5
φ = = 1.6180339887 . . .
2
We say that two quantities a and b are in the golden ratio to each other if
a+b a
= = φ.
a b
In the image below this ratio is illustrated using line segments.

It turns out that if we divide successive Fibonacci numbers by each other that this
quantity gets closer and closer to the golden ratio! We’ll illustrate this for the first ten
Fibonacci numbers.

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, . . .

4
1
= 1
1
2
= 2
1
3
= 1.5
2
5
= 1.666666667
3
8
= 1.6
5
13
= 1.625
8
21
= 1.615384615
13
34
= 1.619047619
21
55
= 1.617647059
34
89
= 1.618181818
55
144
= 1.617977526
89
233
= 1.618055556
144
377
= 1.618025751
233

We can see that the ratio of successive Fibonacci numbers does appear to be getting ever
closer to the golden ratio.

5 Generalizations
We can generalize the properties of the Fibonacci sequence to obtain other sequences.

5.1 Negafibonacci Numbers


We know that each entry in the Fibonacci sequence is the sum of the two previous entries.
What if we allow negative numbers? the sequence begins

0, 1, 1, 2, 3, 5, 8, 13, . . .

What number must come before zero? We know that Fn = Fn−1 + Fn−2 . Using some
simple algebra we have

Fn = Fn−1 + Fn−2
Fn−2 = Fn − Fn−1

5
And hence the number that comes before zero in the Fibonacci sequence is
Fn−2 Fn−1 Fn
? 0 1
given by Fn−2 = 1 − 0 = 1 which gives

1, 0, 1, 1, 2, 3, 5, 8, 13, . . .

The number that comes before 1 in the sequence is


Fn−2 Fn−1 Fn
? 1 0
given by Fn−2 = 0 − 1 = −1 which gives

−1, 1, 0, 1, 1, 2, 3, 5, 8, 13, . . .

Continuing in this way we obtain the Negafibonacci sequence.

. . . , −8, 5, −3, 2, −1, 1, 0, 1, 1, 2, 3, 5, 8, 13, . . .

You might have notice that F−n = (−1)n+1 Fn . More terms give

. . . , −144, 89, −55, 34, −21, 13, −8, 5, −3, 2, −1, 1, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, . . .

5.2 Tribonacci Numbers


The Tribonacci numbers are just like the Fibonacci numbers except each term is the sum
of the three preceding terms. The sequence begins

0, 0, 1, 1, 2, 4, 7, 13, 24, 44, 81, 149, 274, 504, 927, 1705, . . .

Charles Darwin actually observed this sequence inadvertently while studying elephant
populations in the 1800s.

You might also like