How to prove that $n! = n^n - C_{n,1} (n-1)^n +C_{n,2} (n-2)^n - \cdots\,{} $?
I faced this problem when trying to find the number of onto functions possible from one set having n elements to another set having $n$ elements.
How to prove that $n! = n^n - C_{n,1} (n-1)^n +C_{n,2} (n-2)^n - \cdots\,{} $?
I faced this problem when trying to find the number of onto functions possible from one set having n elements to another set having $n$ elements.
Let $(e^x-1)^n$ expanded by the binomial theorem.After expanding it we will get
$(e^x-1)^n=e^{nx}-{{n}\choose{1}}e^{(n-1)x}+...+(-1)^n$. We know that
$e^x=1+x+x^2/2!+x^3/3!+...+x^n/n!+...$
Now we have $(1+x+x^2/2!+...+x^n/n!+...-1)^n=[1+nx+(nx)^2/2!+...+(nx)^n/n!+...]-{{n}\choose{1}}[1+(n-1)x+{(n-1)^2x}^2/2!+...+{(n-1)^nx}^n/n!+...]+...+(-1)^{(n-1)}{{n}\choose{n-1}}[1+x+x^2/2!+...+x^n/n!+...]+(-1)^n$
Now comparing coefficient of x^n on both sides we get
$$1=n^n/n!-{{n}\choose{1}}(n-1)^n/n!+{{n}\choose{2}}(n-2)^n/n!-...+(-1)^n{{n}\choose{n-1}}/n!$$
Now multiply both sides by $n!$, then you will get answer for your question.