How to solve this using using stirling approx?

160 Views Asked by At

I have a relation $log(n!)=\Theta(n\log n)$ .

And i really don't know how to reduce this using using stirling approx. ?

But do know and tried with few logrithmic property like " Even if its $\log(n^n)$, its equal to $O(nlogn)$ using log property, right? Clearly $\log(n!)$ is < $log(n^n)$. So $log(n!)=\Theta(n\log n)$ "

And i have been to this article too but didn't find any luck. https://en.wikipedia.org/wiki/Stirling%27s_approximation

1

There are 1 best solutions below

2
On

$n!\sim\sqrt{2n\pi}\cdot(\frac{n}{e})^n$.

Take the logarithm of both sides (noting that $\log(ab)=\log a+\log b$): $$ \begin{align} \log(n!)\sim & \log(\sqrt{2\pi})+\log(\sqrt{n})+\log(n^n)-\log(e^n)\\ =&\log(\sqrt{2\pi})+\frac{1}{2}\log{n}+n\log{n}-n\\ =&\Theta(n\log n) \end{align} $$