1
$\begingroup$

I'm having problem proving that $log(n^n)=\Theta(log(n!))$

I tried to use Stirling's formula but it seems it doesn't help me in this case.

This is what i wrote :

$n \to \infty : \frac{log(n!)}{log(n^n)}=\frac{log(\frac{\sqrt {2\pi n}}{e^n }.n^n)}{log(n^n)}$
Now what? nothing can be erased ... nothing can be made more simple ( Or maybe i don't know it) Any idea?

  • 2
    $\log(n^n)=n\cdot\log(n)$. $\log(n!)=\log(1)+\cdots+\log(n)$. Have you tried sth like this? It would also be nice to include you Stirling attempts in the question2017-02-18
  • 0
    @MichaelFreimann no... but how is this useful?2017-02-18
  • 1
    @PaoloMolina Given that Stirling's formula is canonically an asymptotic expression for $\log(n!)$, it's hard for us to guess what difficulty you encountered in using it. Without more details it seems extremely straightforward. But also there is a simple argument that doesn't require the precision of Stirling.2017-02-18
  • 0
    Consider the second equality and just take $\sum_{i>n/2}^n \log(i)$.2017-02-18

1 Answers 1

3

I adapted my answer for you using an older Stack Overflow post:

$$\log(n!) = \log(1) + \log(2) + \dots + \log(n-1) + \log(n)$$

Upper bound can be calculated using Sterling's approximation:

$$\log(1) + \dots + \log(n) \leq \log(n) + \dots + \log(n) \text{ or } \boxed{n\log(n)}$$

Lower bound can be determined by reasoning: your answer will be the full expression after dropping the first half:

\begin{align*} {} \log(1) + \dots + \log(\frac{n}{2}) + \dots + \log(n) \\ {} \geq \log(\frac{n}{2}) + \dots + \log(n) \\ {} \geq \log(\frac{n}{2}) + ... + \log(\frac{n}{2}) \text{ or } \boxed{\frac{n\log(n/2)}{2}} \end{align*}

  • 0
    You can also use Stirling's approximation for the lower bound (but it requires a slightly more complete version of Stirling's approximation).2017-02-18
  • 0
    They're equivalent, if $f=\Theta(g)$, then $g=\Theta(f)$. Also, remember your log rules, $n\log n=\log(n^n)$.2017-02-18
  • 0
    Oh, my bad!!! now i understand it !!! Thank you !2017-02-18
  • 0
    $f=\mathcal{O}(g)$ is equivalent to $g=o(f)$ hence the equivalence in Theta notaion.2017-02-18