relationship between Big $O$ notation and limit

78 Views Asked by At

If I have a function $f(n)$ such that $f(n) \geq 0$ for all positive integers $n$ and that $\lim\limits_{n\to \infty} f(n) = 0$, then can I conclude that $f(n) = O\left( \dfrac{1}{n^k}\right)$ for some real $k > 0$?

The converse of what I want to know is clearly true, but how do I prove/disprove my claim?

3

There are 3 best solutions below

1
On

Yes, that is true.

Indeed, $f(n) = O(n^k)$ means that there exist constants $n_0$ and $C$, such that $f(n) \leq Cn^k$ for all $n\geq n_0$.

Since $n^k\rightarrow\infty$ as $n\rightarrow\infty$ no matter the value of $k>0$, and since $f(n)\rightarrow 0$, you certainly have that $f(n)\leq n^k$ from some point and onwards.

2
On

If $\lim_{n \to \infty} f(n) = 0$, then your function is $O(1)$, i.e. bounded above by a constant function. So there's no need to use positive powers on $n$, you can come up with better big-O bounds. However if you really want to use (positive) powers on $n$ for your big-O bounds, then what you say is certainly true, for any positive power, or, for that matter, even if the power is 0.

However if you want to use NEGATIVE powers on $n$, then note that $1/\log n$ is not $O(n^k)$ for any negative $k$. This can be verified with L'Hopital's rule.

1
On

$$\lim _{n\to\infty}f(n)=0\iff f(n)=o(1).$$