2

We say that a function $f(x)=O(g(x))$ if $\exists x_0\in \mathbb{R}_+$ and $\exists C\in \mathbb{R}_+$ such that $\forall x\geq x_0$, $|f(x)|\leq C g(x)$.

So with this definition, the function $f(x)=3x^2+2$ can be said to be $O(x^2)$, because $\forall x \geq 100$, $|3x^2+2|\leq 4x^2$.

But with this definition, would $f(x)=O(x^3)$, or any other $O(x^n)$ with $n>2$? If this is so, then wouldn't it be impossible to say whether a function that is $O(x^3)$ necessarilly has to grow faster than a function that is $O(x^2)$? (Because the $O(x^3)$ function might be $O(x)$)

1 Answers1

4

$O(f(x))$ is the set of all functions that eventually, up to a constant, $f(x)$ is an upper bound for. A function that is $O(x^2)$ is also therefore $O(x^3)$, because $x^2$ is $O(x^3)$. The equivalent notation for lower bounds is $\Omega(f(x))$. $f(x)$ is $\Omega(g(x))$ if and only if $g(x)$ is $O(f(x))$.

If $f(x)$ is $O(g(x))$ and $\Omega(g(x))$, then we say that $f(x)$ is $\Theta(g(x))$. This is equivalent to saying that $0<\displaystyle\lim_{x\to\infty}{\frac{f(x)}{g(x)}}<\infty$ provided $g(x)$ is eventually not zero.

Matt Samuel
  • 58,164
  • 1
    Good answer. Possibly it is worth adding also $\Theta$ when $f$ is both a $O$ and a $\Omega$ of $g$, and which thus allows for comparison as mentioned in the question. – quid Jan 26 '15 at 01:37