I need to prove or disprove:
I start with the Big O notation:
$\sum \limits_{i=1}^n $ log(i) = Θ(n log n)
$\sum$ log i ≤ $\sum$ log n = n log n
(dont know if this is enough or not)
I need to prove or disprove:
I start with the Big O notation:
$\sum \limits_{i=1}^n $ log(i) = Θ(n log n)
$\sum$ log i ≤ $\sum$ log n = n log n
(dont know if this is enough or not)
Use Stirling's formula. We have
$$\sum_{i=1}^n\ln i=\ln n!\sim\ln\left[\sqrt{2\pi n}\left(\frac{n}{e}\right)^n\right]=n\ln n-n+\frac{1}{2}\ln n+\ln\sqrt{2\pi}.$$
So $\ln n!\leq Cn\ln n,\,(C>1)$ for sufficiently large $n$, i.e., $\ln n!\sim\mathcal{O}(n\ln n)$. Notice that this does not imply $\mathcal{O}(n!)\sim\mathcal{O}(n^n)$ ($\times$), since $n^n$ is greater than $n!$ by a factor of $e^n/\sqrt{2\pi n}$.