# Formal definition of Big-O Notation?

Big O Notation is formally defined as:

Let $f(n)$ and $g(n)$ be function from positive integers to positive reals. We say $f = \theta(g)$ (which means that "$f$ grows no faster than $g$*) if there is a constant $c>0$ such that $f(n) ≤ c ⋅ g(n)$.

Using this definition how is:

• $n^2 + n$ simplified to $n^2$
• $n + 20$ simplified to $n$

I don't see a $c$ constant that defines their relationship. How do the above examples work?

-

Try to prove that if $n$ is a positive integer then $n^2+n\le2n^2$ and $n+20\le21n$.
More specifically, $|f(n)| \le c |g(n)|$ for $n$ sufficiently large. So $$|n + 20|\le 2n$$ if $n\ge 20$.
In this case we usually say, "as $n\to\infty$." – ncmathsadist Jun 17 '12 at 1:38
If you want for $n\ge 1$, use the last commenter's definition. If $n=0$, your goose is cooked. – ncmathsadist Jun 17 '12 at 1:39
The finding by the last commenter works if $n \ge 1$ is required. If you want $n\ge 0$, your goose is cooked. – ncmathsadist Jun 17 '12 at 1:40