How can I use the master's method in order to solve the recurrence formula $T(n)=3T(\frac{n}{3})+\sqrt{n}$ ?
Asked
Active
Viewed 3,300 times
0
-
1https://en.wikipedia.org/wiki/Master_theorem_(analysis_of_algorithms) – Yuval Filmus Oct 15 '20 at 21:38
-
2Does this answer your question? Solving or approximating recurrence relations for sequences of numbers – xskxzr Oct 16 '20 at 04:14
1 Answers
1
Taking $n=3^k$ we have $$T(n) =3 T(n/3) + \sqrt{n} =3^2T\left(\frac{n}{3^2}\right) +3\sqrt{\frac{n}{3}}+ \sqrt{n} =\\ =3^3T\left(\frac{n}{3^3}\right) +3^2\sqrt{\frac{n}{3^2}}+3\sqrt{\frac{n}{3}}+ \sqrt{n} = \cdots=\\ =3^kT\left(\frac{n}{3^k}\right)+3^{k-1}\sqrt{\frac{n}{3^{k-1}}}+\cdots +3\sqrt{\frac{n}{3}}+ \sqrt{n} =\\ =3^kT(1)+\sqrt{n}\left( (\sqrt{3})^{k-1}+\cdots + \sqrt{3} +1\right) =\\ = 3^kT(1)+\sqrt{n}\frac{1-(\sqrt{3})^{k}}{1-\sqrt{3}}=\\ =\sqrt{n}T(1)+\sqrt{n}\frac{1-\sqrt{n}}{1-\sqrt{3}} \in O(n) $$

zkutch
- 2,364
- 1
- 7
- 14
-
Thank you @zkutch for this answer, but how can we express it in terms of Θ or O notations? – Rako Maristella Oct 15 '20 at 23:15
-
Of course, but before you should finish sum in right side - it is geometrical progression - can you do it? – zkutch Oct 16 '20 at 00:38
-
Here, a = 3, b=3, d = ½, and f(n) = √n , by comparing n^(log_b a)=n^(log_3 3)= n^1 ≠f(n) – Rako Maristella Oct 16 '20 at 00:47
-
-
-
@Bobby Durrett. Of course I missed it and solve for $T(n/3) + \sqrt{n}$. I'll fix it. Thank you. – zkutch Oct 16 '20 at 01:39
-
-
Welcome @Rako. You can estimate it if/when you find it helpful. Feel free to ask any time if you need anything more. – zkutch Oct 19 '20 at 04:59
-
-
In last fraction, when we pull out $\sqrt{n}$, we have $\sqrt{n} \cdot \sqrt{n}=n$. – zkutch May 22 '21 at 23:55