Why is $O(n^3)$ = $\Theta(n^2)$?

48 Views Asked by At

I have a problem

$T(n) = 9T(n/3) + O(n^3)$

Answer is by Master's Theorem, second case (based on CLRS), so $T(n) = \Theta(n^3\log n)$

But this implies $O(n^3) = \Theta(n^2)$, how can this be true if the function bounded by $O(n^3)$ is $n^3$?

1

There are 1 best solutions below

0
On

(Oops - I wrote $O(n^3)$ when the OP wrote $O(n^2)$. It's even truer.)

If $T(n) = \Theta(n^3\log n)$, then it is not true that $T(n) = O(n^3)$.

$T(n) = \Theta(n^3\log n)$ means that there are positive constants $a$ and $b$ such that, for all large enough $n$, $a n^3 \log n < T(n) <b n^3 \log n $.

The first inequality shows that $T(n)$ is too large for it to satisfy $T(n) = O(n^3)$.