๐Ÿ›๏ธ MATHEMATICAL BRAIN PUZZLE

Tower of Hanoi Online

Transfer all disks from Peg A to Peg C in ascending order. Never place a larger disk on a smaller disk!

Moves Made
0
Minimum Target
7
Time Elapsed
00:00
Peg A (Start)
Peg B (Aux)
Peg C (Destination)

๐Ÿ‘‰ Click any peg to select its top disk, then click destination peg to drop.

The Mathematics of Tower of Hanoi: History, Recurrence & Strategy

Invented in 1883 by French mathematician ร‰douard Lucas, the Tower of Hanoi is one of the most famous recursive puzzles in computer science and mathematics. Lucas framed the puzzle around an ancient legend: in an Indian temple at Benares, priests transfer 64 golden disks across three diamond needles. According to the prophecy, when the last disk is transferred, the world will end.

The Golden Formula: 2n − 1

The minimum number of moves to transfer (n) disks is governed by the recursive equation:
T(n) = 2 × T(n - 1) + 1 = 2n − 1

Recursive Algorithm

To move (n) disks from Source peg (A) to Destination peg (C) using Auxiliary peg (B):

  1. Move (n - 1) disks from (A) to (B) using (C).
  2. Move the largest disk ((n)) directly from (A) to (C).
  3. Move the (n - 1) disks from (B) to (C) using (A).