I am having problem solving this recurrence. Can anyone help me with this please:
$$ T(n) = 2(T(\sqrt n))^2 , T(1) = 4. $$
I am having problem solving this recurrence. Can anyone help me with this please:
$$ T(n) = 2(T(\sqrt n))^2 , T(1) = 4. $$
Let $S(m) = \log_2 (2T(2^m))$. Then $S(m)$ satisfies the recurrence $$ S(m) = 2S(m-1), \quad S(0) = 3. $$ You can work it out from here.
Solving by Substitution
Given,
$T(n)=2(T(\sqrt n))^2$
$T(n)=2(T(n^{1/2}))^2$
$T(n)=2(2(T(n^{1/4}))^2)^2$
$T(n)=2(2(2(T(n^{1/8}))^2)^2)^2$
$T(n)=2.2^2.2^4(T(n^{1/8}))^8$
$T(n)=2^{1+2+2^{2}}(T(n^{1/2^3}))^{2^3}$
Using Summation Formula for Geometric Progression
$T(n)=2^{(2^3-1)}(T(n^{1/2^3}))^{2^3}$
Therefore, for k iterations
Now, Assuming that instead of $T(1)=4$, it is given that $T(2)=4$
(Since, $n^{1/2^k}=1$ will be possible when $n=1$ or $\frac{1}{2^k}=0$, which seems invalid as per algorithm)
Therefore, put $n^{1/2^k}=2$
$\frac{1}{2^k}{log_2n}=1$
${2^k}={log_2n}$
Thus,
$T(n)=2^{({log_2n}-1)}(4)^{log_2n}$
$T(n)=2^{({log_2n}-1)}(2)^{2log_2n}$
$T(n)=2^{({log_2n}-1)}2^{log_2{n^2}}$
$T(n)=\frac{n^3}{2}$