## Tower of Hanoi

This is a well known little problem of procedural thinking. I’m on it nearly from the whole afternoon (just to underline how much i’m slow), and i only found out that the solution i can find online is different from the one my teacher gave to the problem.

I’m starting to wonder how much is he against the free software, so this is the main reason which holds me from speaking about every little difference between the two approaches, given that some of my reader would like this boring list. So i’ll go over..

The problem is quite bigger, because it is about “how many” different possibilities could solve the problem of the Tower of Hanoi in 15 moves for 4 disks. Which is the same as saying: in a number of moves equal to two elevated to the power of the number of disk less one.

So someone helped me, he said me that if i move the disks only between the nearest pin, that is to say, not between the first and the third one but between the first and the second the second and the third, and back, in the attempt to move the entire tower from the first pin to the last one i’ll find every possible position of the disks in the pins.

For 4 disks i found the moves to play this game that way are 80, which is said to be the right answer in the solution, however, those are the moves…

``` From 1 to 2, 2 to 3, 1 to 2, 3 to 2, 2 to 1, 2 to 3, 1 to 2, 2 to 3, 1 to 2, 3 to 2, 2 to 1, 3 to 2, 1 to 2, 2 to 3, 2 to 1, 3 to 2, 2 to 1,2 to 3, 1 to 2, 2 to 3, 1 to 2, 3 to 2, 2 to 1, 2 to 3, 1 to 2,2 to 3,1 to 2,3 to 2,2 to 1,3 to 2,1 to 2,2 to 3,2 to 1,3 to 2,2 to 1,3 to 2,1 to 2,2 to 3,1 to 2,3 to 2,2 to 1,2 to 3,1 to 2,2 to 3,2 to 1,3 to 2,2 to 1,3 to 2,1 to 2,2 to 3,2 to 1,3 to 2,2 to 1,2 to 3,1 to 2,2 to 3,1 to 2,3 to 2,2 to 1,2 to 3,1 to 2,2 to 3, 1 to 2,3 to 2,2 to 1,3 to 2,1 to 2,2 to 3,2 to 1,3 to 2,2 to 1,2 to 3,1 to 2,2 to 3,1 to 2,3 to 2,2 to 1,2 to 3,1 to 2,2 to 3. ```