8

TL; DR: Is this equation true, and how do I prove it? $$ \sum_{k=0}^n \binom{n}{k}(-1)^k(n-k)^n = n! \;\; \forall \;\; n \; \in N $$


Context:

I came across this question while thinking about powers of natural numbers. Imagine you have a list of numbers like this:

$$ 1^3 \;\; 2^3 \;\; 3^3 \;\; 4^3 \;\; 5^3 \;\; 6^3 \;\; ... $$ Then if you difference of each number with its neighbor, from right to left:

$$ \;\;\;\;\;\;\;\;1^3 \;\; 2^3 \;\; 3^3 \;\; 4^3 \;\; 5^3 \;\; 6^3 \;\; ...\\ \text \/ \;\;\text \/\;\;\text \/\;\;\text \/\;\;\text \/ \\ \;\;\;\;\;\;7 \;\; 19 \;\; 37 \;\; 61 \;\; 91 \;\; ...\\ \;\;\text \/ \;\;\text \/\;\;\text \/\;\;\text \/\;\; \\ \;\;\;\;\;\;12 \;\;18 \;\; 24 \;\; 30 \;\; ...\\ \;\;\;\text \/ \;\;\text \/\;\; \text \/ \;\; \\ \;\;\;\;\;\;\;6 \;\;\;\ 6 \;\;\;\; 6 \;\ ... $$ If we try another, say with the degree n=4: $$ \;\;\;\;\;\;\;\;1^4 \;\; 2^4 \;\; 3^4 \;\; 4^4 \;\; 5^4 \;\; 6^4 \;\; ...\\ \text \/ \;\;\text \/\;\;\text \/\;\;\text \/\;\;\text \/ \\ \;\;\;\;\;\;\;15 \;\; 65 \; 175 \; 369 \; 671 \;\; ...\\ \;\;\text \/ \;\;\text \/\;\;\text \/\;\;\text \/\;\; \\ \;\;\;\;\;\;\;\;50 \;110 \; 194 \; 302 \;\; ...\\ \;\;\;\text \/ \;\;\text \/\; \;\text \/ \;\; \\ \;\;\;\;\;\;\;\;60 \;\; 84 \;\; 108 \;\ ... \\ \;\;\;\text \/ \;\;\text \/ \\ \;\;\;\;\;\;\;\;\;\;24\;\;\;24 \;\;... $$ Or, with n=2: $$ \;\;\;\;\;\;\;\;1^2 \;\; 2^2 \;\; 3^2 \;\; 4^2 \;\; 5^2 \;\; 6^2 \;\; ...\\ \text \/ \;\;\text \/\;\;\text \/\;\;\text \/\;\;\text \/ \\ \;\;\;\;\;\;\;\;3 \;\;\;\; 5 \;\;\; 7 \;\;\;\; 9 \;\;\; 11 \;\;\;\; ...\\ \;\;\;\text \/ \;\;\text \/ \;\;\text \/ \;\;\text \/\;\; \\ \;\;\;\;\;\;\;2 \;\;\;\; 2 \;\;\;\; 2 \;\;\;\; 2 \;\; ...\\ $$

A clear pattern begins to emerge. For degree n, the "final" difference leads to n!. With n=2, the final row appears to be a infinite row of $2 = 2! = n!$ With n=4, final row is $24 = 4! = n!$

Finally, if I rewrite the diagram like this: $$ \;\;\;\;\;\;\;\;1^3 \;\;\;\;\;\;\;\;\;\; 2^3 \;\;\;\;\;\;\;\;\;\; 3^3 \;\;\;\;\;\;\;\;\;\; 4^3 \\ \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\text \/ \;\;\;\;\;\;\;\;\;\;\text \/\;\;\;\;\;\;\;\;\;\;\text \/\;\;\;\;\;\;\;\;\;\; \\ \;\;\;\;\;\;\;\;\;\;\;2^3 - 1^3 \;\;\; 3^3 - 2^3 \;\;\; 4^3 - 3^3 \\ \;\;\;\;\;\;\;\;\text \/ \;\;\;\;\;\;\;\;\;\;\text \/ \\ \;\;\;\;\;\;\;\;3^3 - 2(2^3) + 1^3 \;\;\;\;\;\; 4^3 - 2(3^3) + 2^3 \\ \;\;\;\;\;\;\;\;\text \/ \\ \;\;\;\;\;\;\;4^3 -3(3^3) + 3(2^3) - 1^3 $$

If I rewrite each diagram in this format, I end up with the final difference as:

$ n = 2: 1(3^2) - 2(2^2) + 1(1^2) \\ n = 3: 1(4^3) - 3(3^3) + 3(2^3) - 1(1^3) \\ n = 4: 1(5^4) - 4(4^4) + 6(3^4) - 4(2^4) + 1(1^4)\\ ...\\ $

Notice how the coefficients form Pascal's Triangle. It makes sense that Pascal's Triangle should show up, since the construction of this diagram is strikingly similar to the construction of Pascal's Triangle, the only difference being, well, a difference rather than a sum of the neighbors.

Recall how earlier it was noticed that the final difference always seems to be n!.

The equation that I seek to prove and ask for help is: $$ \sum_{k=0}^n \binom{n}{k}(-1)^k(n-k)^n = n! \;\; \forall \;\; n \; \in N $$

RobPratt
  • 45,619

3 Answers3

13

Let $S=\{1,2,\dots,n\}.$ Consider all onto functions $f:S\to S.$

An onto function from a finite set to itself is just a permutation, so there are $n!$ such functions.

But we can also count this by inclusion-exclusion.

Let $A$ be the set of all functions, $S\to S.$ Let $A_i$ be the subset of such functions which do not contain $i$ in the range.

Then by inclusion-exclusion:

$$|A\setminus(A_1\cup\cdots\cup A_n)|=\sum_{k=0}^n (-1)^k\binom nk(n-k)^n$$

But $A\setminus(A_1\cup\cdots\cup A_n)$ is just the set of onto functions, $S\to S.$


A lot of the time when you see equalities like:

$$\sum_{k=0}^n (-1)^k\binom nk f(n,n-k)= g(n),$$ where $f,g$ have ranges of the natural numbers, it is worth thinking about inclusion-exclusion, and trying to represent $g(n)$ as a count on some set.


Ultimately, this follows from the fact that if $f(x)$ is a polynomial of degree $n$ with lead coefficient $a,$ then $(\Delta f)(x)=f(x+1)-f(x)$ is a polynomial with lead coefficient $na$ and degree $d-1.$

So if $f(x)$ is a monic polynomial of degree $n,$ $\Delta^n f$ is a polynomial of degree zero and lead coefficient $n!,$ and thus $(\Delta ^n f)(x)=n!.$

If we define an operator $S$ on polynomials as $(Sf)(x)=f(x+1),$ then $\Delta=S-I,$ where $I$ is the identity, and $$\Delta^n =\sum_{k=0}^n (-1)^k\binom nkS^{n-k}$$

Then $$(\Delta^n f)(x)=\sum_{k=0}^n(-1)^n\binom nk f(n-k+x)$$

The case $f(x)=x^n$ gives a stronger result:

$$n!=(\Delta^n f)(x)=\sum_{k=0}^n(-1)^n\binom nk (n-k+x)^n,$$ for any $x$ in any commutative ring.

Thomas Andrews
  • 177,126
5

Let $$S_n=\sum_{k=0}^n \binom{n}{k}(-1)^k(n-k)^n$$

Then, Using this well known substitution :

$$\binom n k =\frac{n}{k} \binom {n-1} {k-1} $$

Can you observe this ?

$$S_n = nS_{n-1}$$

An_Elephant
  • 2,704
3

No combinatorics needed, only algebraic identities. All the technical tools required for the proof are contained in https://en.wikipedia.org/wiki/Finite_difference, in particular

$$ \nabla^n[f](x) = \sum_{k=0}^n (-1)^k \binom{n}{k} f(x-k) $$

  • the relationship between backward and forward differences:

$$ \nabla^n[f](x) = \Delta^n[f](x-n) $$

$$ f(x) = \sum_{i=0}^n a_ix^i \quad\Longrightarrow\quad \Delta^n[f](x) = a_nn! $$

Now, taking $f(x)=x^n$, hence $a_n=1$, we have

$$ \sum_{k=0}^n (-1)^k \binom{n}{k} (n-k)^n = \nabla^n[f](n) = \Delta^n[f](0) = n! $$

Federico
  • 5,900