First, let's talk about the Three Towers.
The recursive formula is f (n) = 2f (n-1) + 1.
First, let's talk about how this formula was introduced.
We need to move all the plates on the first tower to the last one.
Suppose there are n plates.
Then, we need to first move n-1 dishes to the second tower,
Then, move the largest plate to the 3rd towers.
Finally, move n-1 plates to the third tower.
Therefore, F (n) = f (n-1) + 1 + f (n-1) is obtained)
That is, the formula F (n) = 2f (n-1) + 1.
Four-tower problem: (this method has a problem. It will be wrong at 10. Please give me some advice !)
According to some derivation, the following conclusions are drawn:
/F (n) = 1 n = 1
| F (n) = 3 N = 2
| F (n) = 2f (n-2) + 3 n = 3
/F (n) = 2f (n-3) + 7 N> = 4
Why is n> = 4?
To get the minimum number of moves, we just need to move the previous n-3 plate to the auxiliary Tower first.
Then move the last three plates to the last tower based on the three towers. (Because one of the towers has been occupied by n-3 plates)
Finally move the n-3 plate to the last tower.
So F (n) = f (n-3) + 7 + f (n-3)
7 is the number of times the three towers need to be moved.
Five, six, and seven ...... And so on...
The N-tower problem has also been solved perfectly.