The Magnetic Tower of Hanoi
In this work I study a modified Tower of Hanoi puzzle, which I term Magnetic Tower of Hanoi (MToH). The original Tower of Hanoi puzzle, invented by the French mathematician Edouard Lucas in 1883, spans “base 2”. That is - the number of moves of disk number k is 2^(k-1), and the total number of moves required to solve the puzzle with N disks is 2^N - 1. In the MToH puzzle, each disk has two distinct-color sides, and disks must be flipped and placed so that no sides of the same color meet. I show here that the MToH puzzle spans “base 3” - the number of moves required to solve an N+1 disk puzzle is essentially three times larger than he number of moves required to solve an N disk puzzle. The MToH comes in 3 flavors which differ in the rules for placing a disk on a free post and therefore differ in the possible evolutions of the Tower states towards a puzzle solution. I analyze here algorithms for minimizing the number of steps required to solve the MToH puzzle in its different versions. Thus, while the colorful Magnetic Tower of Hanoi puzzle is rather challenging, its inherent freedom nurtures mathematics with remarkable elegance.
💡 Research Summary
The paper introduces a novel variant of the classic Tower of Hanoi (ToH) puzzle, called the Magnetic Tower of Hanoi (MToH). In the traditional ToH, three pegs and N disks of distinct sizes are used, and the only restriction is the size rule (a larger disk may never be placed on a smaller one). The minimal number of moves required to transfer the entire stack from a source peg to a destination peg is 2ⁿ − 1, and each disk k (counted from the smallest) moves exactly 2^{k‑1} times. This binary growth is described as “base 2”.
MToH adds a second, magnetic constraint. Each disk has two faces of different colors (Red on the top, Blue on the bottom). A move consists of lifting a disk, flipping it, and placing it on another peg. The magnetic rule forbids a disk from being placed so that its bottom face contacts a top face of the same color on the resident disk. Consequently, each peg acquires a color (Red, Blue, or Neutral) that changes dynamically as disks are placed or removed.
The author first solves the puzzle for N = 1, 2, 3 by explicit enumeration. The results are 1, 4, and 11 moves respectively. While N = 1 and N = 2 follow a simple “base 3” pattern (moves = (3ⁿ − 1)/2), the N = 3 case deviates (11 ≠ 13). The deviation is traced to the freedom of moving a smallest disk onto a completely free peg, which is neutral and accepts any color.
To isolate the effect of this freedom, the paper defines a “Colored” version (CMToH) where the three pegs are pre‑colored permanently (either Red‑Blue‑Blue or Red‑Red‑Blue). In this restricted setting the magnetic rule never creates a neutral peg; the color of each peg is fixed for the whole game. Under these conditions the puzzle regains a strict base‑3 behavior: disk k moves exactly 3^{k‑1} times, and the total number of moves is S_{100}(N) = (3ⁿ − 1)/2. The subscript “100” denotes a 100 % duration solution (i.e., no savings from neutral pegs). Recursive proof mirrors that of the classic ToH, yielding S(N) = 3·S(N‑1) + 1.
The main contribution lies in exploiting the dynamic coloring of pegs in the unrestricted MToH. The author identifies three tower states:
- Free – two pegs are neutral (the start and the goal).
- Semi‑Free – one peg is neutral, the other two have opposite colors.
- Colored – two pegs share the same color.
By strategically guiding the game through Semi‑Free states, the author derives two improved algorithms.
1. The “67 %” solution
The algorithm proceeds as follows for N > 3:
- Move the top N‑1 disks from Source (S) to Intermediate (I) using the optimal “Free” strategy (S_{67}(N‑1) moves).
- Move the largest disk from S to Destination (D) (1 move).
- Using the CMToH “100 %” algorithm, move the N‑2 smallest disks from I to D, then back to I, then to D again, and finally from I to D, interleaved with two single‑disk moves of the (N‑1)‑th disk. This contributes 4·S_{100}(N‑2) + 2 moves.
- The total recurrence is S_{67}(N) = S_{67}(N‑1) + 4·S_{100}(N‑2) + 3.
Solving the recurrence yields a closed form \
Comments & Academic Discussion
Loading comments...
Leave a Comment