The Tower of Hanoi: 7 disks need 127 moves
Need a hint?
To move n disks you must first move n โ 1 disks out of the way, move the biggest, and move n โ 1 disks back on top.
The Tower of Hanoi with n disks needs 2โฟ โ 1 moves: 127 for 7 disks.
How to work it out
Moving disks: move the top to the spare peg ( moves), move the biggest disk (1 move), move the disks on top of it ( moves):
(1)The values are 1, 3, 7, 15, 31, 63, 127, โฆ Each is one less than a power of 2, which follows by induction: :
(2)The legend of 64 disks needs moves: at one move per second that is about 585 billion years.
LaTeX source of the formulas on this page
\[ 2^n-1\ \ (n=7:\ 127) \] \[ T(n)=2\,T(n-1)+1,\qquad T(1)=1 \] \[ T(7)=2^7-1=127 \]
Questions
What is the answer to: The Tower of Hanoi: 7 disks need 127 moves?
The Tower of Hanoi with n disks needs 2โฟ โ 1 moves: 127 for 7 disks.
What is the key idea?
The problem for n disks contains two copies of the problem for n โ 1 disks.
Is there a hint?
To move n disks you must first move n โ 1 disks out of the way, move the biggest, and move n โ 1 disks back on top.