Towers of Hanoi (4 Ring Version)

Towers of Hanoi (4 Ring Version)

Description

A simple Towers of Hanoi example with four rings. Wikipedia has a lot of great information on the problem: https://en.wikipedia.org/wiki/Tower_of_Hanoi This is a great example of difference equations/recursion equations in the real world! The recursion relation is given by y(n+1) = 2y(n) + 1. We use an initial condition of y(1)=1; i.e. if you have only one ring, it takes one step to move the stack to another peg. Then, our solution is given by y(n) = 2^n-1. This means, if we use all 4 rings in this file, it takes 2^4-1 = 15 steps at a minimum to move the stack from one tower to the other!

Statistics

Likes

5

Downloads

0

Category

Math Art

Tags