0

I graphed the functions and when $n_0$ is greater than $3$, $cg(n)$ is always greater than $n^2 \log n$ so it would seem to me by definition that $m^2 \log n$ is in $O (n^2) $. I tried to prove it by dividing both sides of inequality by $n^2$ . The $c \ge \log n $. As n tends to infinity there will be values of c that are > than logn . I have to say if $n^2 \log n $ is in $O(n^2)$ . My classmate says it isn't to me it looks like it is. It is 6.00 am here and my brain is mush so apologies if this is a really trivial questions and you are all laughing at my stupidity. It is a little confusing I admit. It seem to me that $n^2 \log n$ above $n_0= 3$ is always greater than $n^2$

BDN
  • 103
  • 2
david
  • 19
  • 3

2 Answers2

1

$n^2\log(n)$ isn't $O(n^2)$. You need to have a constant $c$, so since $\log(n)$ tends to infinity, for any fixed $c$ you will choose, at some point $\log(n)$ will pass $c$, that is: $\forall n>n_0: c < \log(n)$ for some $n_0$. This directly means that $\forall n>n_0: cn^2 < n^2 \log(n)$ which means that $n^2 \log(n)$ is asymptotically bigger than $cn^2$.

nir shahar
  • 11,538
  • 3
  • 14
  • 35
0

Main error is in sentence:

"As n tends to infinity there will be values of c that are > than logn".

Under $c$ we have constant in definition of big-$O$, while for $a \gt 1$ function $\log_a n \to +\infty$ and we cannot bound it by constant.

So, for any constant $c\gt 0$ and $a \gt 1$ we can solve $\log_a n \gt c$ and have $n \gt a^c$.

For correct answer is enough to note, that $n^2 \log n \gt n^2$, when $\log n \gt 1$ and we have $n^2 \log n \in \Omega(n^2)$.

zkutch
  • 2,364
  • 1
  • 7
  • 14