# 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$.
$\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{\mathrm{i}} \newcommand{\iff}{\Leftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\, #2 \,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$