3

I saw this equation in "Introduction to Algorithm" 3th edition in page 58 :

$$\lg(n!) = \Theta(n\lg(n))$$

If $\lg(n!) = \Omega(n\lg(n))$ and $\lg(n!) = O(n\lg(n))$ then we can prove that.

I can easily show $\lg(n!) = O(n\lg(n))$, but I have no idea about $\Omega$.

Bumblebee
  • 18,220
  • 5
  • 47
  • 87
CVDE
  • 173
  • This is a possible duplicate of http://math.stackexchange.com/questions/966928/proving-nlogn-is-ologn - The previous question I linked to is not a duplicate – wlad Jul 09 '15 at 10:46
  • 2
    For large $n$ values $$n!\approx\sqrt{2\pi n}\left(\dfrac{n}{e}\right)^n.$$ This is called Stirling's approximation. – Bumblebee Jul 09 '15 at 10:51
  • @Nilan It's works , thanks. – CVDE Jul 09 '15 at 11:41
  • Possible duplicate of http://math.stackexchange.com/questions/640602/show-that-if-n2-then-n2nn or http://math.stackexchange.com/questions/521421/solve-lnn-thetan-lnn-without-stirling-approximation. – lhf Jul 09 '15 at 11:51

2 Answers2

4

Since $n=\prod_{j=1}^{n-1}\left(1+\frac{1}{j}\right)$, we have:

$$ n! = \frac{n^{n-1}}{\prod_{j=1}^{n-1}\left(1+\frac{1}{j}\right)^j}\tag{1}$$ but for any $n\geq 1$ we also have: $$ \left(1+\frac{1}{j}\right)^{j+\frac{1}{2}}\geq e,\qquad \left(1+\frac{1}{j}\right)^{j}\leq e,\tag{2} $$ hence: $$ \frac{n^{n-1}}{e^{n-1}}\leq n! \leq \frac{n^{n-\frac{1}{2}}}{e^{n-1}}\tag{3}$$ and by taking logs it follows that $\log(n!)$ is both $O(n\log n)$ and $\Omega(n\log n)$ as $n\to +\infty$.

Jack D'Aurizio
  • 353,855
  • 2
    Nice and +1. This is a purely analytical method (before which I only knew a geometrical one). – Vim Jul 09 '15 at 14:09
2

By the inequality of geometric and harmonic means, we have:

$$\sqrt[n]{n!} > \frac{n}{\frac{1}{1}+\frac{1}{2}+\frac{1}{3}+\cdots+\frac{1}{n}} = \frac{n}{H_n} = \Theta\left(\frac{n}{\ln(n)}\right)$$

Therefore

$$\ln(n!) \in \Omega\left(n\ln\left(\frac{n}{\ln(n)}\right)\right)$$

$$\ln(n!) \in \Omega\left(n\ln(n)-n\ln(\ln(n))\right)$$

$$\ln(n!) \in \Omega\left(n\ln(n)\right)$$

$$\lg(n!) \in \Omega\left(n\lg(n)\right)$$

wythagoras
  • 25,026