# a combinatorial exercise

The problem asks us to calculate:
$$\sum_{i = 0}^{n}(-1)^i \binom{n}{i} \binom{n}{n-i}$$

The way I tried solving is:

The given sum is the coefficient of $x^n$ in $(1+x)^n(1-x)^n$, which is $(1 - x^2)^n$. The coefficient of $x^n$ in $(1 -x^2)^n$ is $$(-1)^{n/2} \binom{n}{n/2}.$$

Am I doing it right?

-
Thanks, fixed it. –  user813 Sep 22 '10 at 15:57

Your solution is correct for even $n$.
If $n$ is odd then your last sentence should read "The coefficient of $x^n$ in $(1-x^2)^n$ is $0$." This is because only even powers of $x$ occur when expanding $(1-x^2)^n$.