Tower of Hanoi Demonstration by figen
Loading the math board and drawing, please wait…
This example demonstrates the solution process and number of moves for the Tower of Hanoi problem. It involves core mathematical concepts such as logical reasoning, recursive algorithms, and sequence calculations. Construction highlights include the use of GeoGebra commands like Sequence, button, and disc objects. Suitable for middle school students and above to learn algorithmic thinking and logical reasoning, as well as for math competition training.
GeoGebra Commands & Parameters
Sequence(Polygon[(2 - (2 * Element[seqA, i] / num), (4 * (Length[seqA] - i) / num)), (2 + (2 * Element[seqA, i] / num), (4 * (Length[seqA] - i) / num)), (2 + (2 * Element[seqA, i] / num), (4 * (Length[seqA] - i + 1) / num)), (2 - (2 * Element[seqA, i] / num), (4 * (Length[seqA] - i + 1) / num))], i, 1, Length[seqA]) → discASequence(Polygon[(12 - (2 * Element[seqC, i] / num), (4 * (Length[seqC] - i) / num)), (12 + (2 * Element[seqC, i] / num), (4 * (Length[seqC] - i) / num)), (12 + (2 * Element[seqC, i] / num), (4 * (Length[seqC] - i + 1) / num)), (12 - (2 * Element[seqC, i] / num), (4 * (Length[seqC] - i + 1) / num))], i, 1, Length[seqC]) → discCSequence(Polygon[(7 - (2 * Element[seqB, i] / num), (4 * (Length[seqB] - i) / num)), (7 + (2 * Element[seqB, i] / num), (4 * (Length[seqB] - i) / num)), (7 + (2 * Element[seqB, i] / num), (4 * (Length[seqB] - i + 1) / num)), (7 - (2 * Element[seqB, i] / num), (4 * (Length[seqB] - i + 1) / num))], i, 1, Length[seqB]) → discBSequence(Polygon[(2 - (2 * Element[tmpA, i] / num), 5), (2 + (2 * Element[tmpA, i] / num), 5), (2 + (2 * Element[tmpA, i] / num), 5 + 4 / num), (2 - (2 * Element[tmpA, i] / num), 5 + 4 / num)], i, 1, Length[tmpA]) → discTASequence(Polygon[(7 - (2 * Element[tmpB, i] / num), 5), (7 + (2 * Element[tmpB, i] / num), 5), (7 + (2 * Element[tmpB, i] / num), 5 + 4 / num), (7 - (2 * Element[tmpB, i] / num), 5 + 4 / num)], i, 1, Length[tmpB]) → discTBSequence(Polygon[(12 - (2 * Element[tmpC, i] / num), 5), (12 + (2 * Element[tmpC, i] / num), 5), (12 + (2 * Element[tmpC, i] / num), 5 + 4 / num), (12 - (2 * Element[tmpC, i] / num), 5 + 4 / num)], i, 1, Length[tmpC]) → discTC