Prove that log n! = Theta(n log n)
Analyze the prove that log n! = theta(n log n).
Examples
Input: "test_input_1"
Output: "output_1"
Input: "test_input_2"
Output: "output_2"
Hints
Recall that n! = 1 * 2 * 3 * ... * n and consider how the sum of logarithms relates to the product of numbers.
Use Stirling's approximation to approximate log(n!) and compare it with n log n.
Prove both the upper bound (log(n!) ≤ n log n) and lower bound (log(n!) ≥ (n/2) log(n/2)) using integral approximation or summation techniques.
Prove that log n! = Theta(n log n)
Analyze the prove that log n! = theta(n log n).