Solve the recurrence relation with
$E(0) = 0$, $E(1) = \frac{2}{3} * 2$ and $E(h) = \frac{1}{3} E(h-1) + \frac{2}{3} 2h$
In other words, I want an explicit formula for $E(h)$.
I tried different approaches and the most promising was to rewrite it as follows:
$E(h) = \sum\limits_{i=1}^h \frac{4}{3^i} (h-(i-1))$
I got rid of the recurrence, but the formula is still not how I want it. When using Wolfram Alpha, I get a formula without a sum ($E(h) = 2h + 3^{-h} -1$). I have already tried many things with the above sum, but it could not be completely dissolved. How do I get to a formula without a sum?
Any tips would be really appreciated.
The general solution of the linear homogeneous recurrence relation $E(h)=\frac{1}{3}E(h-1)$ is $E(h)= a \left(\frac{1}{3}\right)^h$. The original non-homogeneous recurrence relation has particular solution of the form $b h + c$. So $$E(h)= a \left(\frac{1}{3}\right)^h + b h + c.$$ Use the initial conditions to find the constants $a$, $b$, and $c$.
Alternatively, rewrite your summation as $$E(h) = 4h \sum_{i=1}^h \left(\frac{1}{3}\right)^i - 4 \sum_{i=1}^h (i-1) \left(\frac{1}{3}\right)^i$$ and apply known formulas for $\sum_{k=1}^n r^k$ and $\sum_{k=1}^n (k-1) r^k$.