0

Considering the runtime analysis (with the master theorem) of the function below

$T(n) = 12T(\frac{n}{4}) + 2\sqrt{n} + \log^4(n)$.


As I could not figure out a way to get the equation in the form $T(n)=aT(\frac{n}{b}) + \theta(n^d)$, I aimed to get the equation in the form of $T(n)=aT(\frac{n}{b})+\theta(n^k\log^pn)$ as listed here.

My idea is to drop the $2\sqrt{n}$ term (as $\forall n>\approx 2.5: \log^4(n)>2\sqrt{n}$), and then give the final runtime analysis in big O notation as opposed to $\theta$ notation. Is this a valid solution?


Note: this is similar to a problem in a homework assignment I am doing, but I have changed things in the equation as I am solely posting to help my understanding and not to cheat.

Glorfindel
  • 752
  • 1
  • 9
  • 20
Mini
  • 101
  • 2
  • Notice that $\sqrt{n} > \log_{10}(n)^4$ for $n > 400000$ (roughly!) for $log_2$ this happens even earlier. In fact $\log(n)^d \in O(n^\varepsilon)$ for any $\varepsilon > 0,d > 0$, so you should use $\sqrt{n} + \log(n)^4 \in \Theta(\sqrt{n})$ – plshelp Sep 16 '22 at 19:00
  • I have two questions: how is $log(n)^d \in O(n^\epsilon)$ for ANY epsilon and d both greater than zero? What if epsilon is some very small positive number, like 0.0000001, and d is say, 1? – Mini Sep 16 '22 at 19:19
  • Also, how can I prove that $\sqrt{n} + log(n)^4 \in \theta(\sqrt{n})$? – Mini Sep 16 '22 at 19:20

1 Answers1

1

I suspect you have missed that $\sqrt{n} = n^{1/2}$.

D.W.
  • 159,275
  • 20
  • 227
  • 470
  • Wow, I actually did! However, how can I then combine the terms $n^{1/2}$ and $log^4(n)$? – Mini Sep 16 '22 at 19:11
  • @Mini, https://cs.stackexchange.com/q/824/755 – D.W. Sep 16 '22 at 19:22
  • D.W. This seems very helpful. Thank you!

    I knew the ones about small-omega and small-o, but somehow never saw the rule about theta!

    – Mini Sep 16 '22 at 19:31