# Thread: Big O notation.Show using the definition of O(f)?

1. ## Big O notation.Show using the definition of O(f)?

Hi I'm having some trouble with big O notation. I know how to do the simple ones but this is above my head. Any help would be appreciated.

Show using only the definition of O(f) that:
1) 5^n is O(n!)
2)n! is not O(5^n)

I know that 5^n<=n! for n=12 but I don't know how to show this. The book says to use induction 'but I don't know how and for 2 as well. Any ideas?

Thanks in advance.

2. 1) 5^n is O(n!)
Intuitive idea: in $\displaystyle 5^n$, all factors are equal to 5, whereas in $\displaystyle n!$, the factors start with 1 but soon overtake 5 and continue to increase. So, $\displaystyle 5^5>5!$, but this won't last long. Calculate $\displaystyle 5^n$ and $\displaystyle n!$ for n=6,7,...,12. As you said, $\displaystyle 5^{12}$ is already less than 12!. This can be established by direct calculation (e.g., in Windows' calculator).

Now what happens when we move from $\displaystyle n$ to $\displaystyle n+1$ for $\displaystyle n\ge 12$? $\displaystyle 5^n$ is multiplied by 5 to get $\displaystyle 5^{n+1}$; but $\displaystyle n!$ is multiplied by $\displaystyle n+1>5$ to get $\displaystyle (n+1)!$. So, it is clear that $\displaystyle 5^n<n!$ implies $\displaystyle 5^{n+1}<(n+1)!$ for $\displaystyle n\ge12$.