Is it possible for a function(f) to be $O(f)$ but not $o(f)$?

90 Views Asked by At

Is it possible for a function(f) to be $O(f)$ but not $o(f)$? or $o(f)$ but not $O(f)$?

I guess it might be possible for a function that is not monotonically increasing.

Is there an example of this case?

Added: Is it correct if I say subtracting $\theta(f)$ from $O(f)$ equals $o(f)$?

2

There are 2 best solutions below

1
On BEST ANSWER

Certainly: the function $f(x)=x$ is such a function. In fact $f$ is always $O(f)$ and never $o(f)$ (when these both make sense).

Added: As Did points out in the comments, I am assuming here that $f$ is not identically $0$ in a neighborhood of the target; in particular, if we’re looking at the behavior of $f$ as $x\to\infty$, I’m assuming that $f$ is not eventually $0$.

2
On

Look at the definitions.

$f(x) = O(g(x))$ means there is a constant $C$ such that $|f(x)| < C |g(x)|$ for $x$ close enough to wherever it is going ($0$, $\infty$, San Jose).

$f(x) = o(g(x))$ means for any $\epsilon > 0$, $|f(x)| < \epsilon |g(x)|$ for $x$ close enough to wherever it is going.

Therefore, $f(x) = o(g(x))$ implies that $f(x) = O(g(x))$.

An intuitive way to see this is that $f(x) = o(g(x))$ means $f$ is small compared to $g$ and $f(x) = O(g(x))$ means $f$ is not large compared to $g$. "small" implies "not large", but "not large" does not necessarily imply "small" - it might mean "about the same" in a particular case.