0

Finding an approximation for $T(n) = 3T\left(\frac n3\right) + \sqrt n$

I tried to solve this: Proving that $T(n) = 3T\left(\frac n3\right) + \sqrt n = \Theta(n)$ in a different approach but I'm getting something different than the answers there:

For the $ith$ level of the recursion we have $3^i$ verticies, and the "amount of work" in the $ith$ level is $\sqrt{\frac n {3^i}}$. The last level is when $i=\log_3 n$ so we have $$T(n)=\sum _{i=1}^{logn}\sqrt{\frac n {3^i}}=\sqrt n \sum _{i=1}^{logn}\sqrt{\frac 1 {3^i}}$$

And since that sum is converging to a finite value we get: $T(n)=\sqrt n$.

Now obviously $\sqrt n \neq \Theta(n)$

What is wrong here?

shinzou
  • 3,981
  • Is $n\in\mathbb{N}$? – sinbadh Jan 16 '16 at 10:40
  • Yeah @sinbadh ${}$ – shinzou Jan 16 '16 at 10:41
  • Note that definition of $T(n)$ is equivalent to $a_{3n}=3a_n+\sqrt{3n}$. Moreover, we don't have information about $a_2,a_4,a_5,a_7,a_8,...$, but a simple induction arguments show that $a_n=a_1n+\frac{1}{2}(1+\sqrt{3})(n-\sqrt{n})$ at least when $n$ is multiple of 3. I hope it helps. – sinbadh Jan 16 '16 at 10:59
  • As usually with these type of questions: $T(1)=\Theta (1)$ – shinzou Jan 16 '16 at 11:03
  • Passing over the inconsistencies of this kind of question, note that $S(k)=3^{-k}T(3^k)$ solves $S(k)=S(k-1)+3^{-k/2}$ hence $S(k)\to S_\infty=S(0)+\sum\limits_{k=1}^\infty 3^{-k/2}=T(1)+1/(\sqrt3-1)$ and that $S_\infty$ is (presumably) positive and (certainly) finite, hence, indeed, $T(3^k)=\Theta(3^k)$. – Did Jan 18 '16 at 17:43
  • Of course, if $T(1)=-1/(\sqrt3-1)$, then $T(3^k)=T(1)$ for every $k$ hence $T(3^k)=\Theta(1)$, not $\Theta(3^k)$. – Did Jan 18 '16 at 17:46

0 Answers0