9

In our algorithms class, my professor insists that n! has a higher order of growth than n^n. This doesn't make sense to me, when I work through what each expression means.

n! = n * (n-1) * (n-2) * ... * 2 * 1
n^n = n * n * n * n * ... * n * n

Since n is, by definition, greater than n -1 or n-2, shouldn't any n^n, which is the product of n number of n's, be greater than n!, which is the product of an n number of integers less than n?

4 Answers4

9

"Higher order of growth" does not mean that $n!\lt n^n$ but the stronger property that $$n!/n^n\to0.$$ To prove that this property holds, note that $n\geqslant2k$ for every $1\leqslant k\leqslant n/2$ and $n\geqslant k$ for every $n/2\lt k\leqslant n$, hence $$ n^n=\prod_{k=1}^{n}n\geqslant\prod_{1\leqslant k\leqslant n/2}(2k)\cdot\prod_{n/2\lt k\leqslant n}k=2^{n/2}\cdot n!, $$ which proves that $$ \frac{n!}{n^n}\leqslant\frac1{2^{n/2}}\to0. $$ Thus, indeed $n^n$ has a higher order of growth than $n!$, not the opposite.

Did
  • 279,727
  • 2
    Although n^n > n! does not prove that n!/n^n -> 0 BUT it does prove that n^n/n! -/> 0. That is, it doesn't prove that it's a higher order of growth, but it proves that it's order of growth is at least as high. This is contrary to his professors claims. – Cruncher Feb 12 '14 at 18:21
7

You are right that $n^n$ grows faster than $n!$. You can see this question with answer (thanks to @JohnHabert for his comment above) for a proof which says exactly what you are saying. This is illustrated by just considering the first couple of numbers $$ \begin{align} 1^1 = 1 \quad &\quad\quad 1! = 1\\ 2^2 = 4 \quad &\quad\quad 2! = 2\\ 3^3 = 27 \quad &\quad\quad 3! = 6\\ 4^4 = 256 \quad &\quad\quad 4! = 24 \\ 5^5 = 3125 \quad &\quad\quad 5! = 120 \\ \end{align} $$ (Your professor might just have misspoken. I would go ask him for clarification.)

Thomas
  • 43,555
  • 2
    Why the downvote? – Thomas Feb 12 '14 at 16:56
  • Because the explanation is wrong. –  Feb 12 '14 at 16:56
  • 3
    This is definitely not a proof, not even very convincing: there are quite a huge number of sequences growing very slowly for the first $K$ terms, and yet very fast afterwards... – Clement C. Feb 12 '14 at 16:56
  • 1
    He didn't mispeak. He literally just corrected a student, and expanded on it in a previous lecture. He's a smart guy, I'm going to assume its a simple mixup. – beachwood23 Feb 12 '14 at 16:56
  • @ClementC.: I did not claim to provide a proof. The OP did that! – Thomas Feb 12 '14 at 16:58
  • 2
    @PLKTU: What is the "correct explanation" then? I don't see you trying to provide one. – Thomas Feb 12 '14 at 17:09
  • @ClementC.: It seems like the other answer agree with me... ? – Thomas Feb 12 '14 at 17:12
  • 1
    I did not say the answer was wrong — I merely said that th evidence you give is not a proof (on which you agree) not even evidence at all — since it can be discarded easily by other examples of sequence with the same first terms. Phrased differently, my point is that your answer is not bringing much insight. – Clement C. Feb 12 '14 at 17:29
  • 1
    @ClementC.: If you read the OP's question you see that the OP provides justification for why $n^n$ grows faster than $n!$. His question is simply whether or not he is correct in his thinking. My answer addresses exactly that. If he wanted a proof, I then even provide a link to a proof. Also, while examples in general don't prove anything, they can still illustrate. – Thomas Feb 12 '14 at 18:08
3

If $n\in \mathbb{N}$, Then $n! = 1 \times 2 \times 3\times 4...............\times (n-2)\times (n-1)\times n$

Now $n\geq n$ and $n>(n-1)$ and $n>(n-2)$ and $n>(n-3)$......... $n>4\;\;,n>3\;\;,n>2\;\;,n>1$

So $n\cdot n\cdot n\cdot ............\cdot n(n-\bf{times})\geq n\cdot (n-1)\cdot (n-2)....3\cdot 2 \cdot 1$

So $n^n\geq n!$

juantheron
  • 53,015
1

Your professor is wrong, and the explanation can be found here on page 5.

Ruslan
  • 6,775
imranfat
  • 10,029