Meaning of $f(n) = \mathcal {O}(g(n)), g(n) \neq \mathcal O(f(n)) $

36 Views Asked by At

Meaning of $f(n) = \mathcal {O}(g(n)), g(n) \neq \mathcal O(f(n)) $

First condition says f(n) is upper bounded by g(n) ie., $f(n) \leq c g(n),$ for some c , $n_0 >0$

Second condition says that $g(n) \nleq c' f(n)$ for some $c', n_0' >0$

It means $g(n) >c'f(n)$ But 1st condition says $f(n) \leq cg(n)$.It means overall f(n) < g(n)

But why can we just write it as single one condition - 2nd condition. We dont need 1st condition to get f(n)<g(n) right. Please correct me if i am thinking wrongly

1

There are 1 best solutions below

0
On BEST ANSWER

No, the second condition is not enough.
For example, consider $f(n) = n^3$ for all $n$; $g(n) = n^4$ for $n$ even, $g(n) = n^2$ for $n$ odd. Then $f(n) \neq \mathcal {O}(g(n))$ and $g(n) \neq \mathcal O(f(n))$ .


$f(n) = \mathcal {O}(g(n)), g(n) \neq \mathcal O(f(n))$ means: $$ \limsup_{n \to +\infty} \frac{f(n)}{g(n)} < + \infty, \quad\text{but}\quad \limsup_{n \to +\infty} \frac{g(n)}{f(n)} = +\infty . $$ Stated another way (assuming $f(n), g(n)$ are both positive) $$ 0 = \liminf_{n \to +\infty}\frac{f(n)}{g(n)} \le \limsup_{n \to +\infty}\frac{f(n)}{g(n)} < + \infty. $$