0

I need to prove that $n^2$ is not $o(n^2+10^{10}n)$. I thought of the limit test: $$ \lim_{n \to \infty} \frac{n^2}{n^2+10^{10}n} = 1 \Rightarrow n^2 = \Theta(n^2+10^{10}n) $$

However I'm not sure if the result of the test rules out the possibility of $o(n^2+10^{10}n)$.

Raphael
  • 72,336
  • 29
  • 179
  • 389
Yos
  • 527
  • 1
  • 5
  • 18
  • 4
    The limit is 1 and by definition of little-o it must be 0 – Eugene Apr 11 '17 at 18:03
  • @Eugene right, so does this conclusion rule out that it can be $o$? – Yos Apr 11 '17 at 18:03
  • So you want to check if it is little 0. You were able to calculate the limit needed and it equals 0 if and only if the relation is little-o. It equals 1. Thus the relation is not little-o. Did I miss anything ? – Eugene Apr 11 '17 at 18:34
  • 4
    The definition of $f(n)=o(g(n))$ is that $\lim_{n\to\infty} f(n)/g(n)=0$. For $f(n)=n^2$, $g(n)=n^2+10^{10}n$, you have found that $\lim_{n\to\infty} f(n)/g(n)=1$. So what is your question? – David Richerby Apr 11 '17 at 18:44
  • @DavidRicherby my question was if the limit test is enough to conclude that or whether I need to go back to the definition of $o(n)$ which is that a constant and $n_0$ exists such that for all $n>n_0$ $f(n) < cg(n)$. I think you answered my question. Should I wait until someone posts a full answer? – Yos Apr 11 '17 at 18:53
  • 1
    OK, you're using the other definition of little-o. I'll write up an answer. (By the way, the definition you quote in your comment is big-O, not little-o.) – David Richerby Apr 11 '17 at 18:56
  • @DavidRicherby shouldn't it be $f(n) \le cg(n)$ for the big-O? – Yos Apr 11 '17 at 18:58
  • 1
    @Yos That doesn't make any difference: the distinction is whether $c$ is existentially quantified (big-O) or universally quantified (little-o). – David Richerby Apr 11 '17 at 18:59
  • @DavidRicherby in our class equality is the difference between big-O and little-o – Yos Apr 11 '17 at 19:00
  • 1
    @Yos Then your teacher is defining a very different $o$. My guess: either you misunderstood something, or they don't know what they are talking about. – Raphael Apr 11 '17 at 19:08
  • 1
    Are you absolutely sure of that? Because it makes big-O and little-o exactly the same thing. If $f(n)<cg(n)$ then, of course, $f(n)\leq cg(n)$. Conversely, if $f(n)\leq cg(n)$ then, as long as $g(n)\neq 0$, $f(n)< (c+1)g(n)$. – David Richerby Apr 11 '17 at 19:08
  • @Raphael maybe I'm not understanding this correctly but we use this book: Introduction to Algorithms by Thomas Cormen, chapter 3, page 50 gives the definition for little-o exactly as I stated. I guess it's available online as well http://ce.bonabu.ac.ir/uploads/30/CMS/user/file/115/EBook/Introduction.to.Algorithms.3rd.Edition.Sep.2010.pdf – Yos Apr 11 '17 at 19:15
  • 2
    @Yos The definition of little-o you quote says that for all $c>0$, which is not what you stated. (Compare the definition of big-O on page 47 that says for some $c>0$.) – David Richerby Apr 11 '17 at 19:20

2 Answers2

6

One definition $f(n)=o(g(n))$ is that $\lim_{n\to\infty} f(n)/g(n)=0$. If this is the definition you're using, then showing that the limit is $1$ already shows that $f(n)\neq o(g(n))$.

The other definition is that, for every $c>0$, there is an $n_0$ such that $f(n)\leq cg(n)$ for all $n\geq n_0$. The fact that $\lim_{n\to\infty} f(n)/g(n)=1$ means that, for all $\varepsilon>0$, there is some $n_0$ such that $f(n)/g(n)>1-\varepsilon$ for all $n\geq n_0$ (this is part of the definition of "limit"). So, for all $\varepsilon>0$, we have $f(n)>(1-\varepsilon)g(n)$ for all large enough $n$. This means that, in particular, we do not have $f(n)\leq cg(n)$ for $c=1-\epsilon$, so $f(n)\neq o(g(n))$ by the alternative definition.

David Richerby
  • 81,689
  • 26
  • 141
  • 235
1

Without any limits: $(n^2 + 10^{10}n) / 2 ≤ n^2 ≤ n^2 + 10^{10}n$ whenever $n ≥ 10^{10}$. So for c < 1/2, we don't have $n^2 < c(n^2 + 10^{10}n)$ for all large n. Actually, not for any large n.

And $f(n) = \Theta (g(n))$ does indeed rule out that $f(n) = o (g(n))$, but is not a necessary condition.

gnasher729
  • 29,996
  • 34
  • 54