Learning Objective: Today you are going to detect and correct errors in an algorithm.
Tower of Hanoi
Mrs. Klein loves solving mathematical problems. One of her favourite games is the Tower of Hanoi. The object of the game is to move all the disks from Tower 1 over to Tower 3 (with your mouse). The only problem is that you cannot place a larger disk onto a smaller disk.
Have a go at playing the game first using three disks. How many moves does it take for you to solve the problem? Can you figure out a way of solving the problem with the least amount of moves?
Mrs. Klein wrote down an algorithm to successfully complete the game in eleven moves. However she made a mistake as she was writing down her algorithm and it doesn't work. Can you "debug" her algorithm and figure out where she went wrong.
Mrs. Klein's Algorithm
1. Move Small Disk to Tower 2
2. Move Medium Disk to Tower 3
3. Move Small Disk to Tower 3
4. Move Big Disk to Tower 2
5. Move Small Disk to Tower 2
6. Move Medium Disk to Tower 2
7. Move Small Disk to Tower 1
8. Move Big Disk to Tower 3
9. Move Small Disk to Tower 2
10. Move Medium Disk to Tower 3
11. Move Small Disk to Tower 3
Extension Task
Add five disks to the game. What is the least number of moves you can use?