Motivating Examples
Motivating Examples
Fibonacci Numbers
Motivating Examples
On Recurrence Relation
Miliyon T.
Outline
1 Tower of Hanoi
2 Fibonacci Numbers
Tower of Hanoi
We are given a tower of eight disks, initially stacked in decreasing
size on one of three pegs:
Tower of Hanoi
We are given a tower of eight disks, initially stacked in decreasing
size on one of three pegs:
Tower of Hanoi
We are given a tower of eight disks, initially stacked in decreasing
size on one of three pegs:
Tower of Hanoi
We are given a tower of eight disks, initially stacked in decreasing
size on one of three pegs:
Tower of Hanoi
We are given a tower of eight disks, initially stacked in decreasing
size on one of three pegs:
OK
1
1
2
2 1
1 2
1
2
OK
1
2
1
2
3
2
3 1
3 2 1
1
3 2
1
2 3
1 2 3
2
1 3
1
2
3
OK 1
2
3
1
2
3
4
2
3
4 1
3
4 1 2
3 1
4 2
1
4 3 2
1
4 3 2
1 2
4 3
1
2
4 3
1
2
3 4
2 1
3 4
1
2 3 4
1
2 3 4
1 3
2 4
3
2 1 4
2
3
1 4
1
2
3
4
OK 1
2
3
4
1
2
3
?
4
5
Hn = 2Hn−1 + 1
Fibonacci Sequence
Fibonacci Sequence
“[A]ssuming that:
a newly born pair of rabbits, one male, one female, are put in
a field;
Fibonacci Sequence
Fibonacci 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;
Fibonacci Sequence
Fibonacci 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.”
Fibonacci Sequence
Fibonacci 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?”
1, 1, 2, 3, 5, 8, 13, 21, . . .
1, 1, 2, 3, 5, 8, 13, 21, . . .
1, 1, 2, 3, 5, 8, 13, 21, . . .
1, 1, 2, 3, 5, 8, 13, 21, . . .
1, 1, 2, 3, 5, 8, 13, 21, . . .