How does substituting $\log{n}$ in help me solve this recurrence?

107 Views Asked by At

I solved the recurrence $T(n) = T(\sqrt[4]{n}) + 1$, $T(2) = 1$ through thinking it through. $T(n) = O(\log{\log{n}})$ since the number of times we add 1 is the number of times we can take the 4th root of $n$. Assume $\log$ means base 2.

Apparently, I can systematically solve this recurrence by setting $n = \log{m}$ and substituting. Why? Can someone clarify that for me?

This isn't homework. I'm trying to develop a systematic way of solving similar recurrences.

1

There are 1 best solutions below

2
On

If I substitute $n =$log $m$ then that implies that $ m= a^n $ where $a$ is the base of your logarithm. Thus the recurrence will transform to

$$T(a^n) = T(a^{\frac{n}{4}}) +1 $$

and if we then use the transformation that $S(n) = T(a^n)$ we will have a much simpler recurrence solvable by Master theorem, or unrolling etc.