-1

What is difference $\lim_{n\to\infty}f(n)=g(n)$ and $f(n)=O(g(n))$?

I posted a question in CS stackexchange and there this guy gave me this explanation. As, question was mathematical in nature, so I thought to post it here.

Umang.B
  • 19

2 Answers2

3

The expression $$\lim_{n\to\infty} f(n)= g(n)$$ is nonsensical. The expression $$\lim_{n\to\infty} f(n)$$ is a number, not a function. It is independent of $n$.

5xum
  • 123,496
  • 6
  • 128
  • 204
1

The big O notation is just a way to bound the asymptotic behaviour of a function. As it was noted in the comments $f(n)=O(g(n))$ means that there exists a constant $C$ and a constant $N$ such that if $x>N$ then $|f(x)| \le C |g(x)|$.

For example we have $\sin (x) = O(1)$, since for all $x\in\mathbb R$ we have $|\sin(x)|\le 1$. Note that we also have $10\sin (x) = O(1)$ since this changes only the constant.

Similarly we have $x^3+x+1 = O(x^3)$, since for $|x|\ge1$ it holds $|x^3+x+1| \le 3|x^3|$. Similarly $5x^3+10x-2 = O(x^3)$.

As it was noted before, the limit $\lim_{n\to\infty} f(n)= g(n)$ is nonsensical. We could write $$\lim_{n\to\infty} f(n)= a$$ and ask whether $a$ is a number, but this is not so relevant to the question.

PS. It is related to the previous in the sense that if the limit exists then the function has to be in the $O(1)$ class.

tst
  • 1,415
  • 9
  • 18