Moves
0
Min Moves
15
Time
00:00
Move the sacred disks from the source to the destination.
But beware: a larger disk may never rest upon a smaller one.
Moves
0
Min Moves
15
Time
00:00
The puzzle was invented by the French mathematician Édouard Lucas in 1883. He marketed it under the pseudonym "N. Claus de Siam" (an anagram of Lucas d'Amiens). link
The Prophecy: According to the legend accompanying the game, there is a temple in Benares where priests are tasked with moving a tower of 64 golden disks on three diamond needles. link
The legend states that when the last move of the 64th disk is completed, the tower, the temple, and the Brahmins will crumble into dust, and the world will vanish with a thunderclap. Fortunately, solving a 64-disk tower at a rate of one move per second would take roughly 585 billion years!
M(n) = 2ⁿ - 1
The minimum number of moves required to solve a Tower of Hanoi puzzle with n disks is 2n - 1.
FUNCTION MoveTower(n, source, dest, aux):
IF n == 1:
Move disk from source to dest
ELSE:
MoveTower(n-1, source, aux, dest)
Move disk from source to dest
MoveTower(n-1, aux, dest, source)
This recursive logic is a foundational concept in computer science. link