legend which states that given sixty-four disks
around three poles, moving the disks around
and completing the puzzle, when the last disk
is set into place, the world ends.
The game is usually played with a smaller no.
of disks, as 64 is far too large a number of disks.
The game consists of 3 poles, stuck into a board.
The disks have a hole in the centre, and thus can
be put around a pole. But, the disks, in their original
order, are all different sizes, with the smallest at the
top, and the largest at the bottom. A larger disk can
never be above a smaller disk. Only one disk can be
moved at a time, and the aim of the game is to transfer
all the disks, which are around the left-most pole at the
start of the game, to the right-most pole, while following
all the rules.
So, the animated gif above shows how the game works.
Now, in Wikipedia, the number of moves required for n
number of disks, is 2n-1, which I already knew, from
previously playing the game a lot. But they haven't
really explained it that clearly.
The way it works is, assume
you start of with 1 disk. It simply takes one move to win.
With two disks, you simply play the "one" move twice, plus
another move.
2(1) + 1 = 3 moves.
With three disks, you play the same moves as with two disks,
move the bigger disk, and then play those moves again.
2(3) + 1 = 7 moves.
With four disks, it's the same concept.
2(7) + 1 = 15 moves.
So, the number of moves can be rewritten as:
2n-1

No comments:
Post a Comment