How can I prove this: f(n) = o(g(n)) if and only if f(n) = O(g(n)), but f(n) ≠ Θ(g(n)) ?
1 Answer
$\begingroup$
$\endgroup$
The result is false. For example, consider the following functions:
- $f(n) = \left\{\begin{array}{ll}n&\text{if }n\text{ is even}\\ n^2&\text{otherwise}\end{array}\right.$;
- $g(n) = n^2$.
Then $f \in \mathcal{O}(g)$ and $f\notin \Theta(g)$, but $f\notin o(g)$ either.