![]() We can now use the minimum number of moves for the 1 and 2 disk problems to build up a list of minimum numbers of moves. ![]() In total you have used 2M+1 moves to solve the problem for N disks. Then move N-1 disks from post B to post C using the minimum M moves. Then move the biggest disk from post A to post C using 1 move. Number of disksįor N disks, first of all move N-1 disks to peg B using the minimum M moves. It is then possible to show the minimum number of moves for N disks. Imagine you know the minimum number of moves for N-1 disks, let us call it M. After this, it is possible to show the minimum number of moves using a recursive pattern. It is also easy to show that if you have 2 disks the minimum number of moves is 3. This can be surprisingly easy to show and will save you time wondering whether you have actually found the most efficient way to solve the Tower of Hanoi problem.įirst of all it is easy to show that if you only have one disk it will take only one move. Many people want to know what the minimum number of moves needed is when you have 5,6,7 or any number of disks. The minimum number of moves for any number of disks Can you complete the problem in the smallest number of moves possible? If you have four disks, the minimum number of moves is 15. For example if you have three disks, the minimum number of moves is 7. The aim is to try and complete the transfer using the smallest number of moves possible. You can only move the disks one at a time and you can never place a bigger disk on a smaller disk. What you need to do is move all the disks from the left hand post to the right hand post. The Tower of Hanoi is a famous problem which was posed by a French mathematician in 1883.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |