Башня of Ханой

Play the classic Башня of Ханой puzzle online. Move disks between pegs following the rules. Choose your difficulty and solve it in minimum moves. Бесплатный, no signup.

Minimum Moves 7
Your Moves 0
Время 00:00
Source
Auxiliary
Destination

How to Play

  1. Move all disks from the left peg to the right peg
  2. Only one disk can be moved at a time
  3. A larger disk cannot be placed on top of a smaller disk

О Башня of Ханой

The Башня of Ханой is a mathematical puzzle invented by the French mathematician Édouard Lucas in 1883. It consists of three pegs and a number of disks of different sizes which can slide onto any peg. The puzzle starts with the disks stacked in ascending order of size on one peg, and the objective is to move the entire stack to another peg, obeying specific rules. The minimum number of moves required to solve the puzzle is 2^n − 1, where n is the number of disks.

Функции

Frequently Asked Questions

What is the minimum number of moves?

The minimum number of moves to solve the Башня of Ханой with n disks is 2^n − 1. For example: 3 disks = 7 moves, 4 disks = 15 moves, 5 disks = 31 moves, 6 disks = 63 moves, 7 disks = 127 moves, and 8 disks = 255 moves.

Is there a mathematical proof for the minimum moves?

Yes. The proof uses mathematical induction. To move n disks from peg A to peg C, you must first move n−1 disks to peg B (taking T(n−1) moves), then move the largest disk to peg C (1 move), then move the n−1 disks from peg B to peg C (another T(n−1) moves). This gives the recurrence T(n) = 2T(n−1) + 1, which solves to T(n) = 2^n − 1.

Can I solve it in fewer moves than the minimum?

No. The minimum number of moves (2^n − 1) is proven to be both necessary and sufficient. Any solution requires at least this many moves, and there exists a strategy that achieves exactly this number.

What is the world record for solving the Башня of Ханой?

For the physical puzzle with 8 disks, skilled solvers can complete it in under 2 minutes. In competitive programming, computers can solve it instantly for any practical number of disks using the recursive algorithm.