Alternating sum of binomial coefficients: given $n \in \mathbb N$, prove $\sum^n_{k=0}(-1)^k {n \choose k} = 0$

Using Binomial Theorem for positive integer exponent $n$

$$(a+b)^n=\sum_{0\le r\le n}\binom nr a^{n-r}b^r$$

Set $\displaystyle a=1,b=-1$ in the above identity


I think the easiest way to prove it is to think of a finite set of $n$ elements,

If you think of it that way, it's the number of even sized ($(-1)^k = 1$) subsets of $\{1,\,\dotsc,\,n\}$ minus the number of odd-sized ($(-1)^k = -1$) subsets.

The map

$$\varphi \colon S \mapsto \begin{cases} S\cup \{1\} &, 1 \notin S\\ S \setminus \{1\} &, 1 \in S \end{cases}$$

that "flips $1$", i.e. adds $1$ to $S$ if $1\notin S$ and removes it if $1\in S$, is a bijection between the set of even-sized and the set of odd-sized subsets. Thus $\{1,\, \dotsc,\,n\}$ has as many even-sized subsets as odd-sized, i.e.

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

for all $n \geqslant 1$.


Please allow me to give a less direct proof. Let $p$ be the product of $n$ different primes $q_1,\ldots,q_n$.

We know $$\sum_{d \mid p}\mu(d)=0,$$ where $\mu$ is the Möbius function.

Each divisor $d$ of $p$ is the product of primes from the set $\{q_1,\ldots,q_n\}$, and will satisfy $\mu(d)=1$ or $\mu(d)=-1$, depending on the parity of the number of primes dividing $d$.

It follows that there as many ways to choose an odd number of primes as ways to choose an even number of primes.

Equivalently, $$\sum_{0\leq 2k \leq n}\binom{n}{2k}=\sum_{0\leq 2k+1 \leq n}\binom{n}{2k+1},$$ it follows that $$\sum_{k=0}^n\binom{n}{k}(-1)^k=0.$$