1
$\begingroup$

My professor noted that we could treat any logarithmic function with an exponent as equivalent to log(n) for the purposes of big-O analysis.

ie. $(n log(n) + 1)^2 + (log(n) + 1)(n^2 + 1)$

From the left I would get $(n^2)(log(n))^2$ and from the right I would get $(n^2)log(n)$. According to my professor I can just say this function is $O(n^2log(n))$. However, I don't see how these functions grow in the same order. Looking at their graphs it would seem they are quite different.

$\endgroup$
1
$\begingroup$

$f(n)$ is not $O(n^2\log n)$

If we denote $f(n) = (n\log n+1)^2+(log n+1)(n^2+1)$ then: $$f(n) = n^2 \log^2n + 2n\log n + 1 + n^2\log n + n^2 + \log n + 1 \geq n^2log^2n$$

since all the other terms are obviously greater than 0. Therefore by definition $f(n) = \Omega (n^2log^2n)$. Which strictly means it cannot be bounded from above by anything asymptotically greater.

Note that it also holds that $f(n) \leq 10n^2log^2n$, so $f(n) = O(n^2log^2n)$ and also $\Theta$ of the same.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.