Towers of Hanoi and Reincarnation
Towers of Hanoi and Reincarnation
Those who have studied algorithms surely encountered the Towers of Hanoi example when learning recursion. There are many mysterious aspects to it. Why do the steps before and after moving the bottom disk appear to be perfect mirrors of each other? Why is there a legend that when monks finish moving all disks to another rod, the world will end?
To answer the first question.
The constraint of this problem is that smaller disks cannot be placed on larger ones, so moving the largest disk is the hardest step. At the same time, the largest disk can only be moved last, so it can be ignored until then. The entire problem becomes: how to move the upper N-1 disks. This deductive logic can be applied at each level as we climb up, continuing until the topmost disk, thus forming a recursion. In other words, we are constantly decomposing a nested large problem into smaller problems; before solving the large problem, we must solve the smaller ones within. The Towers of Hanoi's constraints necessitate this layer-by-layer decomposition approach, so destruction is inevitable.
When we move the largest disk in each N-1 subproblem, the destination rod must be empty, because the largest disk must be placed at the bottom. Meanwhile, after moving the largest disk, its original rod should also be empty (larger disks unrelated to N-1 are ignored). Therefore, the remaining disks must be on the third rod, and due to the constraint that large disks cannot be placed on small ones, this rod must hold a complete tower. Thus we discover that each N-1 small tower's reconstruction is necessary (optimal) for moving the Nth largest disk.
What we ultimately see is that before each N-1 large disk is moved, the smaller tower above it needs to be destroyed and rebuilt once. During each destruction and reconstruction of the upper small tower, the even smaller tower above it needs to be destroyed and rebuilt within both the destruction and reconstruction processes. The entire structure resembles a tree branching along the timeline, starting from moving the largest disk as the root, one branch splitting into the destruction of the upper small tower, another branch splitting into reconstruction. This continues until the movement of the smallest disk.
The second question is actually about the worldview represented by the Towers of Hanoi.
The Towers of Hanoi is such a world. Before the largest world's destruction and rebirth, each smaller world needs to undergo destruction and rebirth once. To resolve the largest karma, smaller karmas must exponentially experience the cycle of untying and retying. Dependent origination and emptiness cycle endlessly, until the largest dependent origination and emptiness, when the entire karmic structure terminates.