Two Important Recurrence
Two Important Recurrence
Figure 1
The objective is to transfer the entire tower to one of the other pegs, moving only one
disk at a time and never moving a larger one onto a smaller.
Let’s say that Hn is the minimum number of moves that will transfer n disks from one peg to
another under Lucas’s rules. Then H1 is obviously 1, and H2 = 3.
We can also get another piece of data for free, by considering the smallest case of all: Clearly
H0 = 0, because no moves at all are needed to transfer a tower of n = 0 disks! Smart mathemati-
cians are not ashamed to think small, because general patterns are easier to perceive when the
extreme cases are well understood (even when they are trivial).
But now let’s change our perspective and try to think big; how can we transfer a large tower?
Experiments with three disks show that the winning idea is to transfer the top two disks to
the middle peg, then move the third, then bring the other two onto it. This gives us a clue for
transferring n disks in general: We first transfer the n − 1 smallest to a different peg (requiring
Hn−1 moves), then move the largest (requiring one move), and finally transfer the n − 1 smallest
back onto the largest (requiring another Hn−1 moves). Thus we can transfer n disks (for n > 0)
in at most 2Hn−1 + 1 moves:
Hn ≤ 2Hn−1 + 1 , for n > 0. (1)
This formula uses ‘ ≤ ’ instead of ‘ = ’ because our construction proves only that 2Hn−1 + 1 moves
suffice; we haven’t shown that 2Hn−1 + 1 moves are necessary.
But is there a better way? Actually no. At some point we must move the largest disk. When we
do, the n − 1 smallest must be on a single peg, and it has taken at least Hn−1 moves to put them
there. We might move the largest disk more than once, if we’re not too alert. But after moving
These two inequalities, (1) and (2), together with the trivial solution for n = 0, yield
H0 = 0 ;
(3)
Hn = 2Hn−1 + 1 , for n > 0.
This definition is called a recurrence. Instead of defining the value of each number in the
sequence explicitly, we do so by using the values of other numbers in the sequence.
“[A]ssuming that: a newly born 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.”
“The puzzle that Fibonacci posed was: how many pairs will there be in one year?”
Month Rabbits
1 ♠ 1
2 ♥ 1
3 ♥♠ 2
4 ♥♥♠ 3
5 ♥♥♥♠♠ 5
6 ♥♥♥♥♥♠♠♠ 8
7 ♥♥♥♥♥♥♥♥♠♠♠♠♠ 13
Table 1
How many rabbit pairs do we have at the beginning of the 8th month?
• Surely all 13 rabbit pairs we have in the 7th month remain there and are all mature. So,
the question is how many newly born rabbit pairs that we have.
• The number of newly born rabbit pairs equals the number of mature rabbit pairs we have.
This is also equal to the number of rabbit pairs that we have in the 6th month: 8.
Thus, we will have 13+8 rabbit pairs at the beginning of the 8th month.
If we write down the sequence, we get the Fibonacci sequence:
1, 1, 2, 3, 5, 8, 13, 21, . . .
Again, what’s the next number in this sequence? How can we compute it? 21+13 = 34 is the
answer. We take the last two numbers and add them up to get the next number. Why? To be
Fn+1 = Fn + Fn−1 ,
for n = 2, 3, . . .. Is this enough to completely specify the sequence? No, because we do not know
how to start. To get the Fibonacci sequence, we need to specify two starting values: F1 = 1 and
F2 = 1 as well.
Now, you can see that the equation and these special values uniquely determine the sequence.
It is also convenient to define F0 = 0 so that the equation works for n = 1.
The equation
Fn+1 = Fn + Fn−1
and the initial values F0 = 0 and F1 = 1 specify all values of the Fibonacci sequence. With these
two initial values, you can use the equation to find the value of any number in the sequence.