Maths WorkshopMaths problems with full solutions
Exercise 1036Logic, sets and proofs › Proof techniques › InductionL1Added 3 Nov 2026

Towers of Hanoi

#induction#Hanoi#recurrence

Statement

Show that the minimum number of moves to solve the Towers of Hanoi with nn disks is 2n−12^n-1.

Hint

Recurrence Tn=2Tn−1+1T_n=2T_{n-1}+1.

Show solutionHide solution

Solution

Recurrence. To move nn disks: move n−1n-1 to auxiliary peg (Tn−1T_{n-1} moves), move the largest to the target (1 move), move n−1n-1 onto it (Tn−1T_{n-1} moves). So Tn=2Tn−1+1T_n=2T_{n-1}+1.

Base case. T0=0T_0=0.

Solve. Tn=2n−1T_n=2^n-1 by induction.

Conclusion. The minimum number of moves is 2n−12^n-1.