TITLE: How to prove n! is equivalent to $n^n$?
QUESTION [6 upvotes]: I have been using $n!$ as $n^n$ when talking about big-$O$ and time complexity but never exactly knew why? I searched also but couldn't find anything. Somebody, please help me understand.

REPLY [2 votes]: It has already been answered that $$ \lim_{n\to\infty} \frac{n!}{n^{n}} = 0, $$
so using $n!$ as if it has the same asymptotic behavior of $n^{n}$ is not right. 
However, $ \log{(n!)} $ and $ \log{(n^{n})} $ are equivalent, as we can see by Stirling's approximation (see Stirling's approximation on Wikipedia):
$$  \sqrt{2\pi}\cdot \sqrt{n}\cdot n^{n}\cdot e^{-n} \leq n! \leq  e\cdot \sqrt{n}\cdot n^{n}\cdot e^{-n}  $$
$$ \Rightarrow n\log{(n)} -n+\log{(\sqrt{2\pi n})}  \leq \log{(n!)}  $$
Therefore, 
$$ \lim_{n\to \infty} \frac{n\log{(n)}+O(n)}{n\log{(n)}} = 1 =
\lim_{n\to \infty} \frac{\log{(n!)}}{\log{(n^{n})}} $$
I think it is worth pointing out because it is often used in computer science (the question mentioned time complexity) that $ \log{(n!)} $ and $ \log{(n^{n})} $ are equivalent, although $ n! $ and $ n^{n} $ are not, and that is a pretty counterintuitive idea, at least for me.