A neat little puzzle called the Tower of Hanoi , invented by the French mathematician Edouard Lucas in 1883.
We are given a tower of 8 disks, initially stacked in decreasing size on 1 of 3 pegs.
The objective is to transfer the entire tower to one of the other pegs, moving only 1 disk at a time and never moving a larger one onto a smaller.
What is the minimum number of moves are required to achieve this goal?
Note : Moving one disk from one peg to another is considered as 1 move.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
It is quite easy to prove that:
We have f ( 1 ) = 2 1 − 1 .
Suppose f ( n ) = 2 n − 1 , we got f ( n + 1 ) = 2 f ( n ) + 1 = 2 ( 2 n − 1 ) + 1 = 2 n + 1 − 1
Did you observe that f ( n ) = 2 n − 1 ?
Log in to reply
Yes I did, but I didn't prove it so I left it out of my solution :P
I had taken two cases first i did it with 3 discs and then with 4 discs...(though it ate my lot of time :p ) however i deduced the soln. To be of the form 2^n -1. Since result i got were 7 and 15 resp. So ans. Is 2 8 -1
By the way is this generalisation true for all integers????
If n is the number of disks, then no of moves = 2 n − 1
Problem Loading...
Note Loading...
Set Loading...
Let f ( n ) denote the number of moves needed to move a tower of size n . In order to move a tower of size n , we first need to move a tower of size n − 1 , move the base of the tower, and then move the tower of size n − 1 back onto the base. This gives us the recursive formula
f ( n ) = 2 f ( n − 1 ) + 1
It is evident that f ( 1 ) = 1 , and so we can arrive at the conclusion that f ( 8 ) = 2 5 5