This question has already been asked before in this site, but the details of none of them is my question and none of them answer my question. The following is an example recurrence given in introduction to algorithms book by CLRS .
$$T(n) = 2T(\sqrt n) + \log n$$
It is solved by changing the variables. It renames the $m = \log n$ and it yields
$$T(2^m) = 2T(2^{m/2}) + m$$
and it renames $S(m) = T(2^m)$, so it produces new recurrence
$$ S(m) = 2S(m/2) + m $$
which is easy to solve.
I have two problems with this solution:
1- renaming $S(m) = T(2^m)$ must yield $S(m) = S(m/2) + \log m$, since we can't change the argument of the $T$ and leave the $m$ as it was. We can use $S(m) = S(m/2) + m$ only if the original recurrence was $T(2^m) = 2T(2^{m/2}) + 2^m$
2- The second problem is, even if the above renaming is true, $2T(\dfrac{2^m}{2})$ would be $S(m/2)$ not the $2T(2^{m/2})$
thanks in advance.
S(m)=2S(m/2)+m
with the lastm
not renaming problem either. Please remove your flag if possible. $\endgroup$