0

I am practicing problems on asymptotic analysis and I am stuck with this problem.

Is log(n!) = O((log(n))^2) ?

I am able to show that

log(n!) = O(n*log(n)) 
(log 1 + log 2 + .. + log n <= log n + log n + ... + log n)

and

 (log(n))^2 = O(n*log(n)) 
(log n <= n => (log n)^2 <= n*logn )

I am not able to proceed further. Any hint or intuition on how to proceed further? Thanks

Rider_BY
  • 1,071
  • 13
  • 26
Janaky Murthy
  • 60
  • 2
  • 8

2 Answers2

3

Accoriding to Stirling's Approximation:

log(n!) = n*log(n) - n + O(log(n))

So clearly upper bound for log(n!) will be O(nlogn)

Lower bound can be calculated by removing first half of the equation as:

log(1) + ... + log(n/2) + ... + log(n) = log(n/2) + ... + log(n)
= log(n/2) + ... + log(n/2)
= n/2 * log(n/2)

So Lower bound is also nlogn. Clearly answer would be NO

Nikhil Pathania
  • 694
  • 5
  • 19
0

I think I got the answer to my own question. We will prove the following facts:

1) n*log(n) is a tight bound for log(n!)

2) n*log(n) is a upper bound for (log(n))^2

3)n*log(n) is not a lower bound for (log(n))^2

For proof of (1) see this.

Proof(2) & (3) is provided in the question itself. growth rate of log n < growth rate of n. So growth rate of log(n)^2 < growth rate of n*log(n). So log(n)^2 = o(n*log(n)) (Here I have used little-o to denote that growth rate of n*log(n) is strictly greater than growth rate of log(n)^2

So the conclusion is that log(n!) = big-omega(log(n^2)) Correct me if I have made any mistake

Community
  • 1
  • 1
Janaky Murthy
  • 60
  • 2
  • 8
  • About proof 3, in the link given by you approach is same as mine for lower bound and his lower bound was `n/2*log(n/2)` @janaky – Nikhil Pathania Oct 28 '16 at 09:57