Proof by induction on Towers of Hanoi equation

287 Views Asked by At

Prove by induction on $n$ that $ 2^n−1 $ solves the recurrence

$H_n =\begin{cases}0, &\text{if $n=0$}\\[6px] 2H_{n-1}+1,&\text{otherwise}\end{cases}$

I know the base case would be when $n = 0$, $H_n = 0$, but how would you do the inductive case and the rest of the proof?

2

There are 2 best solutions below

0
On BEST ANSWER

For $n=0$, $2^n-1=2^0-1=0$.

Suppose $n>0$ and $H_{n-1}=2^{n-1}-1$. Then $$ H_n=2H_{n-1}+1=\cdots $$

0
On

Did you try anything?

$H_{n+1} = 2H_n +1 = 2(2^n - 1) +1 = ?????$

Kind of hard not to get this right off the bat.