How do you prove using Stirling's approximation?
log(n!)=Θ(nlogn)
Any ideas?
I'll give you the broad outline of the proof. You'll have to fill in the details. From this wikipedia article, Stirling's approximation states that for all positive integers n
:
Using a little algebra to rearrange the terms, we get
So n!
is bounded above and below by the function
Since we're interested in log(n!)
we need to determine the behavior of log(f(n))
for large values of n
. Doing some more algebra:
For large values of n, the first term is much larger than the rest, so
which completes the outline of the proof.