100% found this document useful (1 vote)
56 views

Two Important Recurrence

The document discusses two important mathematical recurrences: 1) The Tower of Hanoi puzzle, where the minimum number of moves (Hn) to transfer n disks follows the recurrence Hn ≤ 2Hn-1 + 1. 2) The Fibonacci sequence, where each term is the sum of the previous two terms, defined by the recurrence Fn+1 = Fn + Fn-1, with initial values F0 = 0 and F1 = 1. This recurrence uniquely determines all values in the Fibonacci sequence.

Uploaded by

Miliyon Tilahun
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
56 views

Two Important Recurrence

The document discusses two important mathematical recurrences: 1) The Tower of Hanoi puzzle, where the minimum number of moves (Hn) to transfer n disks follows the recurrence Hn ≤ 2Hn-1 + 1. 2) The Fibonacci sequence, where each term is the sum of the previous two terms, defined by the recurrence Fn+1 = Fn + Fn-1, with initial values F0 = 0 and F1 = 1. This recurrence uniquely determines all values in the Fibonacci sequence.

Uploaded by

Miliyon Tilahun
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Two Important Recurrences

Miliyon T., Mizan-Tepi University

November 29, 2020

1 The Tower of Hanoi


Let’s look first at a neat little puzzle called the “Tower of Hanoi”, invented by the French
mathematician Edouard Lucas in 1883.
We are given a tower of eight disks, initially stacked in decreasing size on one of three
pegs:

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

www.albohessab.weebly.com • Miliyon T. page 1 of 3


the largest disk for the last time, we must transfer the n − 1 smallest disks (which must again be
on a single peg) back onto the largest; this too requires Hn−1 moves. Hence

Hn ≥ 2Hn−1 + 1 , for n > 0. (2)

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.

2 The Fibonacci Sequence


In 1202, Italian mathematician Leonardo Fibonacci posed the following question:

“[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?”

Let’s try to solve Fibonacci’s question.


Let ♠ denote a newly born rabbit pair, and ♥ denote a mature rabbit pair.

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

www.albohessab.weebly.com • Miliyon T. page 2 of 3


precise, let Fn be the n-th number in the Fibonacci sequence. (That is, F1 = 1, F2 = 1, F3 = 2, F4 = 3
and so on.) We can define the (n + 1)-th number as

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.

www.albohessab.weebly.com • Miliyon T. page 3 of 3

You might also like