3

How would you calculate this sum using generating functions? I have tried a lot of things but cannot seem to get the right solution which should even contain $\sqrt{π}$

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

RobPratt
  • 45,619
vens
  • 41

3 Answers3

3

A slight variation of the theme. It is convenient to use the coefficient of operator $[x^n]$ to denote the coefficient of $x^n$. This way we can write for instance \begin{align*} [x^k](1+x)^n=\binom{n}{k}\tag{1} \end{align*}

We obtain \begin{align*} \color{blue}{\sum_{k=0}^n\binom{n}{k}^2(-1)^k} &=\sum_{k=0}^n\binom{n}{k}(-1)^k\binom{n}{n-k}\tag{2}\\ &=\sum_{k=0}^n\binom{n}{k}(-1)^k[x^{n-k}](1+x)^n\tag{3}\\ &=[x^n](1+x)^n\sum_{k=0}^n\binom{n}{k}(-x)^k\tag{4}\\ &=[x^n](1+x)^n(1-x)^n\tag{5}\\ &=[x^n](1-x^2)^n\\ &\,\,\color{blue}{=(-1)^{n/2}\binom{n}{\frac{n}{2}}[n\equiv0 \operatorname{mod} 2]}\tag{6} \end{align*}

Comment:

  • In (2) we use the binomial identity $\binom{p}{q}=\binom{p}{p-q}$.

  • In (3) we apply the coefficient of operator according to (1).

  • In (4) we apply the rule $[x^{p-q}]A(x)=[x^p]x^qA(x)$.

  • In (5) we apply the binomial theorem.

  • In (6) we select the coefficient of $[x^n]$ using Iverson brackets.

Jair Taylor
  • 16,852
Markus Scheuer
  • 108,315
  • So is the advantage of this approach that you can start computing without initially recognizing a convolution? Or just that it looks prettier because you can do it in one string of equations? – Jair Taylor Feb 26 '20 at 21:43
  • 1
    @JairTaylor: For this problem both approaches are well suited and its just a matter of convenience which one to use. The benefit of the coefficient of operator is better seen in somewhat more complex problems like this one. In fact a mastership using these techniques can be found here. – Markus Scheuer Feb 26 '20 at 22:07
  • 1
    Ah, I see. That is indeed a scary looking identity :) – Jair Taylor Feb 26 '20 at 22:11
2

Recall that the coefficients of the product of polynomials (or power series) is given by the convolution of the coefficients of each series: $$\left(\sum_{k=0}^\infty a_k x^k \right)\left(\sum_{k=0}^\infty b_k x^k \right) = \sum_{n=0}^\infty \left(\sum_{k=0}^n a_k b_{n-k}\right) x^n$$ Thus since $\binom{n}{k} = \binom{n}{n-k}$, \begin{align*} \sum_{k=0}^n (-1)^k \binom{n}{k}^2 = \sum_{k=0}^n (-1)^k \binom{n}{k} \binom{n}{n-k} \end{align*}

is the coefficient of $x^n$ in $$\left(\sum_{k=0}^n (-1)^k \binom{n}{k} x^k\right) \left(\sum_{k=0}^n \binom{n}{k} x^k\right) = (1-x)^n(1+x)^n = (1-x^2)^n = \sum_{k=0}^n \binom{n}{k} (-x^2)^k$$

which is $0$ if $n$ is odd, otherwise $\binom{n}{n/2}(-1)^{n/2}$, corresponding to the $k = n/2$ term in the above sum.

RobPratt
  • 45,619
Jair Taylor
  • 16,852
1

A tricky one. Remember that $\binom{n}{k} = \binom{n}{n - k}$, so:

$\begin{equation*} \sum_k (-1)^k \binom{n}{k}^2 = \sum_k (-1)^k \binom{n}{k} \binom{n}{n - k} \end{equation*}$

This is a convolution, we can write it as the coefficient of $z^n$ in the product:

$\begin{align*} [z^n] \left( \sum_k \binom{n}{k} (-1)^k z^k \right) \cdot \left( \sum_k \binom{n}{k} z^k \right) &= [z^n] (1 - z)^n (1 + z)^n \\ &= [z^n] (1 - z^2)^n \\ &= \begin{cases} (-1)^{n/2} \binom{n}{n / 2} & n \text{ even} \\ 0 & n \text{ odd} \end{cases} \end{align*}$

RobPratt
  • 45,619
vonbrand
  • 27,812