Solve the recursion

40 Views Asked by At

I am trying to solve the recursion $T (k) = T (k/5) + k^2$ and I can't figure out after the following step. $$\begin{align}T(k) &= T (k/5) + k^2\\ &= (T(k/25) + k^2/25) + k^2\\ &= (T(k/625) + k^2/625) + k^2/25 + k^2\\ &= T(1) + … + k^2/625 + k^2/25 + k^2\\ &= k^2+ k^2/25+ k^2/625 +…+ T(1) \end{align}$$

1

There are 1 best solutions below

1
On

You might just guess that $T(n)$ is of the form $an^2$, then $$T(k)=ak^2=T(\frac k5)+k^2=a(\frac k5)^2+k^2\\ ak^2=\frac a{25}k^2+k^2\\ a=\frac a{25}+1\\ a=\frac {25}{24}\\ T(k)=\frac {25}{24}k^2$$