Math 2.0

example

Tower of Hanoi

Example

The Tower of Hanoi is a puzzle with three rods and nn discs of different sizes. At the start, all discs are on one rod, in order of size, with the largest at the bottom. A move takes the top disc of one rod and puts it on top of another rod. No move may put a disc on a smaller disc. The aim is to move all discs to another rod.

Let TnT_n be the minimum number of moves for nn discs. Then T0=0T_0 = 0 and Tn=2Tn−1+1T_n = 2 T_{n-1} + 1 for n≥1n \ge 1. This recurrence relation has the solution Tn=2n−1T_n = 2^n - 1.

Remarks

The recurrence comes from the largest disc. Before it moves, the other n−1n - 1 discs must be on the third rod. After it moves, they must come back on top of it. Values: T1=1T_1 = 1, T2=3T_2 = 3, T3=7T_3 = 7 and T4=15T_4 = 15. The French mathematician Édouard Lucas invented the puzzle and presented it in 1883.

Explanations

L1 human

To move a tower of nn discs, first move the top n−1n - 1 discs out of the way. Then move the largest disc, and then move the n−1n - 1 discs back on top. Each new disc doubles the work and adds one move.

What this node needs for W3
  • a person confirmed each agent-written section: rule P04 (0 of 1)

The writing levels say how complete the text of a node is. They do not measure its truth.

Sources

  1. Web https://en.wikipedia.org/wiki/Tower_of_Hanoi, Recursive solution