# Help with proving an equation factorial-time complexity

I've been recently asked by one of my friends to prove an equation but still, I'm confused how to get it started tho.

log(n!)= θ(nlog(n))

Does anyone know how to help? I'll be very grateful if someone comes to reply to my issue.

• $\log(n!)=\sum_{k=1}^n\log{k}$ Use a Riemann sum. – saulspatz Feb 3 at 13:20
• And now you just go for a worst case scenario, so you estimate every term by the upper bound $\log(n)$ – Wesley Strik Feb 3 at 13:23
$$O(\log{(n!)})$$$$=O(\log{(n(n-1)(n-2)...(2)(1))})$$$$=O(\log{(n)}+\log{(n-1)}+\log{(n-2)}+...+\log{(2)}+\log{(1)})$$$$=O(n\log{(n))}$$ As $$n$$ logarithms are added, we have a worst case time complexity of $$O(n\log{(n))}$$.