Recurrence Relation for Towers of Hanoi

906 Views Asked by At

If you were to solve the Towers of Hanoi puzzle recursively by moving n - 1 smallest disks to the second rod, moving the largest disk, then recursively moving the stack from the second rod on top of the largest, you get the recurrence relation: $T(n) = 2T(n - 1) + 1$. So, let's say $S(n) = T(log_2n)$. How could I use this to write a recurrence relation for $S(n)$? As of right now I have: $$S(n) = 2T(log_2n - 1) + 1 = 2T(log_2n-log_22) + 1 = 2T(log_2(\frac{n}{2})) + 1$$ Not really sure if I'm going the right way with this, but I'm not sure where to go after this. After solving for a recurrence relation for $S(n)$, how could we use this to find an asymptotic expression for $T(n)$ using Big-O notation?