taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Volume P2 · Concrete mathematics

Binomial identities

Draft. This chapter is written and checked by the tools of the project, and a person has not reviewed it yet. Read it with care.

Contents
  1. Vandermonde's convolution
  2. Orthogonality and binomial inversion
  3. Abel's identity and convolutions
  4. Multinomials, partial sums and q-binomials

Vandermonde's convolution

Statement

In this chapter rr, ss and xx are real numbers unless the text says otherwise, and kk, mm and nn are integers. The binomial coefficient (rk)\binom{r}{k} is rk‾/k!r^{\underline{k}}/k! for k≥0k \ge 0 and 00 for k<0k < 0 (Section 6.2). A sum ∑k\sum_k with no limits runs over all integers kk. In each sum of this section only a finite number of terms are not zero, so the sum is a finite sum in the sense of Section 1.1.

Definition P2.7.1 (convolution). Let (ak)(a_k) and (bk)(b_k) be two sequences of numbers indexed by the integers, with ak=bk=0a_k = b_k = 0 for every k<0k < 0. Their convolution is the sequence (cn)(c_n) with cn=∑kakbn−kc_n = \sum_k a_k b_{n-k}. The term with index kk is zero unless 0≤k≤n0 \le k \le n, so cn=a0bn+a1bn−1+⋯+anb0c_n = a_0 b_n + a_1 b_{n-1} + \cdots + a_n b_0 for n≥0n \ge 0, and cn=0c_n = 0 for n<0n < 0.

Example P2.7.2. Let ak=bk=1a_k = b_k = 1 for every k≥0k \ge 0. Then cnc_n is a sum of n+1n + 1 ones, so cn=n+1c_n = n + 1 for n≥0n \ge 0. The convolution of the constant sequence with itself is the sequence 1,2,3,4,…1, 2, 3, 4, \dots.

Example P2.7.3. Let ak=(2k)a_k = \binom{2}{k} and bk=(3k)b_k = \binom{3}{k}, so the nonzero terms are 1,2,11, 2, 1 and 1,3,3,11, 3, 3, 1. The convolution has c0=1c_0 = 1, c1=3+2=5c_1 = 3 + 2 = 5, c2=3+6+1=10c_2 = 3 + 6 + 1 = 10, c3=1+6+3=10c_3 = 1 + 6 + 3 = 10, c4=2+3=5c_4 = 2 + 3 = 5 and c5=1c_5 = 1. These are the numbers (5n)\binom{5}{n}. The theorem below says that this is no accident.

A polynomial in several variables is a finite sum of terms c x1e1⋯xdedc\, x_1^{e_1} \cdots x_d^{e_d} with real coefficients cc and exponents ei≥0e_i \ge 0. Section 6.4 used the fact that a polynomial in one variable with infinitely many roots is the zero polynomial. The lemma below is the same fact for dd variables. It is the tool that lifts an identity from the nonnegative integers to all real numbers.

Lemma P2.7.4 (polynomial argument). Let P(x1,…,xd)P(x_1, \dots, x_d) be a polynomial with real coefficients, and let T1,…,TdT_1, \dots, T_d be infinite sets of real numbers. If P(a1,…,ad)=0P(a_1, \dots, a_d) = 0 for every choice of a1∈T1,…,ad∈Tda_1 \in T_1, \dots, a_d \in T_d, then every coefficient of PP is zero. So P(a1,…,ad)=0P(a_1, \dots, a_d) = 0 for all real a1,…,ada_1, \dots, a_d.

Lean: Mathlib MvPolynomial.funext is the case where every TiT_i is the whole of an infinite domain, and MvPolynomial.funext_set is the case of this lemma with a set for each variable (proved in Mathlib).

Proof. Use induction on dd. For d=1d = 1 a nonzero polynomial of degree ee has at most ee roots (Section 6.4). The polynomial PP has infinitely many roots, the elements of T1T_1, so it is the zero polynomial. Now let d≥2d \ge 2 and assume the lemma for d−1d - 1 variables. Collect the terms of PP by the power of xdx_d: P=∑j=0epj(x1,…,xd−1) xdjP = \sum_{j=0}^{e} p_j(x_1, \dots, x_{d-1})\, x_d^j, where each pjp_j is a polynomial in d−1d - 1 variables. Fix a1∈T1,…,ad−1∈Td−1a_1 \in T_1, \dots, a_{d-1} \in T_{d-1}. The polynomial Q(y)=∑jpj(a1,…,ad−1)yjQ(y) = \sum_j p_j(a_1, \dots, a_{d-1}) y^j in one variable is zero at every y∈Tdy \in T_d. That is an infinite set, so the case d=1d = 1 gives pj(a1,…,ad−1)=0p_j(a_1, \dots, a_{d-1}) = 0 for each jj. This holds for every choice of the aia_i, so the induction hypothesis gives that each pjp_j has only zero coefficients. The coefficients of PP are the coefficients of the pjp_j, so they are all zero. □\square

Theorem P2.7.5 (Vandermonde's convolution). For all real rr and ss and every integer nn, ∑k(rk)(sn−k)=(r+sn).\sum_k \binom{r}{k} \binom{s}{n-k} = \binom{r+s}{n}.

Lean: Mathlib Nat.add_choose_eq for natural rr and ss, and Ring.add_choose_eq for rr and ss in a binomial ring, which includes ℚ\mathbb{Q} and ℝ\mathbb{R} (proved in Mathlib). In the form with TAOCP.binom of TAOCP/Notation (tamnd/taocp-lean main), not yet stated.

Proof. If n<0n < 0, then each term has k<0k < 0 or n−k<0n - k < 0, so each term is zero, and the right side is zero too. Let n≥0n \ge 0. First let rr and ss be nonnegative integers. Take a set XX with rr elements and a set YY with ss elements, with no element in common. The right side counts the subsets of X∪YX \cup Y with nn elements. Sort these subsets by kk, the number of their elements in XX. A subset with kk elements in XX is a choice of kk elements of XX and of n−kn - k elements of YY, and the two choices are free. So there are (rk)(sn−k)\binom{r}{k}\binom{s}{n-k} such subsets, and the sum over kk counts each subset once. The identity holds for all nonnegative integers rr and ss.

Now fix n≥0n \ge 0. The left side is ∑k=0n(rk)(sn−k)\sum_{k=0}^{n} \binom{r}{k}\binom{s}{n-k}, and each (rk)=rk‾/k!\binom{r}{k} = r^{\underline{k}}/k! is a polynomial in rr. So the left side is a polynomial in rr and ss, and the right side (r+s)n‾/n!(r+s)^{\underline{n}}/n! is a polynomial in rr and ss too. Their difference is zero at every point of T1×T2T_1 \times T_2, where T1=T2T_1 = T_2 is the set of nonnegative integers. The lemma shows that the difference is the zero polynomial, so the identity holds for all real rr and ss. □\square

Corollary P2.7.6 (shifted indices). For all real rr and ss and all integers mm and nn, ∑k(rm+k)(sn−k)=(r+sm+n).\sum_k \binom{r}{m+k}\binom{s}{n-k} = \binom{r+s}{m+n}.

Lean: not in Mathlib in this form; it follows from Ring.add_choose_eq by a change of the index.

Proof. Put j=m+kj = m + k. As kk runs over all integers, jj runs over all integers, each once (Section 1.2). The term becomes (rj)(sm+n−j)\binom{r}{j}\binom{s}{m+n-j}, and Vandermonde's convolution with m+nm + n in place of nn gives the result. □\square

Corollary P2.7.7 (indices running together). Let rr be a nonnegative integer. For every real ss and all integers mm and nn, ∑k(rm+k)(sn+k)=(r+sr−m+n).\sum_k \binom{r}{m+k}\binom{s}{n+k} = \binom{r+s}{r-m+n}.

Lean: not in Mathlib in this form.

Proof. For a nonnegative integer rr the symmetry (rj)=(rr−j)\binom{r}{j} = \binom{r}{r-j} holds for every integer jj (Section 6.2). For 0≤j≤r0 \le j \le r it is the factorial form, and for j<0j < 0 or j>rj > r both sides are zero. So the term is (sn+k)(r(r−m)−k)\binom{s}{n+k}\binom{r}{(r-m) - k}. In this form the lower indices have the sum n+r−mn + r - m, which does not depend on kk. The corollary on shifted indices, with the roles of rr and ss exchanged, gives (s+rn+r−m)\binom{s+r}{n+r-m}. □\square

The condition on rr cannot be dropped. For r=12r = \frac12 the right side would have the lower index 12−m+n\frac12 - m + n, which is not an integer, and the symmetry step fails.

Corollary P2.7.8 (negated form). Let rr be a nonnegative integer. For every real ss and every integer nn, ∑k(rk)(s+kn)(−1)r−k=(sn−r).\sum_k \binom{r}{k}\binom{s+k}{n}(-1)^{r-k} = \binom{s}{n-r}.

Lean: not in Mathlib in this form; the case s=0s = 0, n=0n = 0 is close to Int.alternating_sum_range_choose (proved in Mathlib).

Proof. Vandermonde's convolution with upper indices kk and ss gives (s+kn)=∑j(kj)(sn−j)\binom{s+k}{n} = \sum_j \binom{k}{j}\binom{s}{n-j}. Put this into the left side. The index kk runs from 00 to rr and jj runs from 00 to kk, so both sums are finite and they may change places (Section 1.2): ∑k(rk)(s+kn)(−1)r−k=∑j(sn−j)∑k(rk)(kj)(−1)r−k.\sum_k \binom{r}{k}\binom{s+k}{n}(-1)^{r-k} = \sum_j \binom{s}{n-j} \sum_k \binom{r}{k}\binom{k}{j}(-1)^{r-k}. Call the inner sum IjI_j. If j<0j < 0, each (kj)\binom{k}{j} is zero, so Ij=0I_j = 0. If j>rj > r, trinomial revision (Section 6.3) gives (rk)(kj)=(rj)(r−jk−j)\binom{r}{k}\binom{k}{j} = \binom{r}{j}\binom{r-j}{k-j}, and (rj)=0\binom{r}{j} = 0, so Ij=0I_j = 0. If 0≤j≤r0 \le j \le r, the same revision and the index i=k−ji = k - j give Ij=(rj)∑i(r−ji)(−1)r−j−i=(rj)(1−1)r−jI_j = \binom{r}{j}\sum_i \binom{r-j}{i}(-1)^{r-j-i} = \binom{r}{j}(1 - 1)^{r-j} by the binomial theorem, with 00=10^0 = 1. This is 11 for j=rj = r and 00 for j<rj < r. So Ij=[j=r]I_j = [j = r], and the left side is (sn−r)\binom{s}{n-r}. □\square

Corollary P2.7.9 (a sum with two limits). Let tt, rr and mm be nonnegative integers. For every real ss, ∑k=0r(r−km)(sk−t)(−1)k−t=(r−t−sr−t−m).\sum_{k=0}^{r} \binom{r-k}{m}\binom{s}{k-t}(-1)^{k-t} = \binom{r-t-s}{r-t-m}.

Lean: not in Mathlib in this form.

Proof. Let 0≤k≤r0 \le k \le r. Then r−kr - k is a nonnegative integer, so symmetry gives (r−km)=(r−kr−k−m)\binom{r-k}{m} = \binom{r-k}{r-k-m}. Negation of the upper index, (xj)=(−1)j(j−x−1j)\binom{x}{j} = (-1)^j\binom{j-x-1}{j} for every integer jj (Section 6.3), then gives (r−km)=(−1)r−k−m(−m−1r−k−m)\binom{r-k}{m} = (-1)^{r-k-m}\binom{-m-1}{r-k-m}. The sign of the term becomes (−1)r−k−m(−1)k−t=(−1)r−m−t(-1)^{r-k-m}(-1)^{k-t} = (-1)^{r-m-t}, which does not depend on kk. Now the limits can go. For k>rk > r the lower index r−k−mr - k - m is negative, so (−m−1r−k−m)=0\binom{-m-1}{r-k-m} = 0. For k<0k < 0 the lower index k−tk - t is negative, so (sk−t)=0\binom{s}{k-t} = 0. So ∑k=0r(r−km)(sk−t)(−1)k−t=(−1)r−m−t∑k(sk−t)(−m−1(r−m−t)−(k−t))=(−1)r−m−t(s−m−1r−m−t)\sum_{k=0}^{r} \binom{r-k}{m}\binom{s}{k-t}(-1)^{k-t} = (-1)^{r-m-t}\sum_k \binom{s}{k-t}\binom{-m-1}{(r-m-t) - (k-t)} = (-1)^{r-m-t}\binom{s-m-1}{r-m-t} by Vandermonde's convolution with the index k−tk - t. A second negation gives (s−m−1r−m−t)=(−1)r−m−t(r−t−sr−m−t)\binom{s-m-1}{r-m-t} = (-1)^{r-m-t}\binom{r-t-s}{r-m-t}, and the two signs cancel. □\square

Corollary P2.7.10 (upper indices running). Let rr, mm, nn and ss be integers with r≥0r \ge 0, m≥0m \ge 0 and n≥s≥0n \ge s \ge 0. Then ∑k=0r(r−km)(s+kn)=(r+s+1m+n+1).\sum_{k=0}^{r} \binom{r-k}{m}\binom{s+k}{n} = \binom{r+s+1}{m+n+1}.

Lean: not in Mathlib in this form; the case m=0m = 0, s=0s = 0 is Nat.sum_Icc_choose (proved in Mathlib).

Proof. Let N=r+s+1N = r + s + 1. The right side counts the subsets XX of {1,2,…,N}\{1, 2, \dots, N\} with m+n+1m + n + 1 elements. For such an XX let xx be its element of rank n+1n + 1 from below. Then XX has nn elements below xx and mm elements above xx. Write x=s+k+1x = s + k + 1. Since x≥n+1x \ge n + 1 and n≥sn \ge s, the integer k=x−s−1k = x - s - 1 is at least n−s≥0n - s \ge 0. Since x≤N−m≤Nx \le N - m \le N, k≤rk \le r. For a fixed xx the set XX is a choice of nn elements from the s+ks + k numbers below xx and of mm elements from the r−kr - k numbers above xx, so there are (s+kn)(r−km)\binom{s+k}{n}\binom{r-k}{m} sets with this xx. Each kk from 00 to rr appears in the sum. A value of kk that is not possible gives a zero term: for k<n−sk < n - s the factor (s+kn)\binom{s+k}{n} is zero because 0≤s+k<n0 \le s + k < n, and for k>r−mk > r - m the factor (r−km)\binom{r-k}{m} is zero because 0≤r−k<m0 \le r - k < m. So the sum counts each XX once. □\square

The condition n≥sn \ge s is used once: it makes k≥0k \ge 0 for every set XX. Exercise 5 shows that the identity is false without it.

Corollary P2.7.11 (sum of squares of a row). For every integer n≥0n \ge 0, ∑k(nk)2=(2nn)\sum_k \binom{n}{k}^2 = \binom{2n}{n}.

Lean: Mathlib Nat.sum_range_choose_sq (proved in Mathlib).

Proof. Symmetry gives (nk)=(nn−k)\binom{n}{k} = \binom{n}{n-k} for every integer kk, so the sum is ∑k(nk)(nn−k)\sum_k \binom{n}{k}\binom{n}{n-k}, which is (2nn)\binom{2n}{n} by Vandermonde's convolution. □\square

Proof

All the identities of this section come from one counting fact: to choose nn things from two disjoint piles, choose some from the first pile and the rest from the second. The polynomial argument then carries the count from whole numbers to real numbers. The argument works because each binomial coefficient with a fixed lower index is a polynomial in its upper index. It needs the lower indices to be fixed integers or to run over integers. It never applies to a lower index that depends on rr in a way that leaves the integers.

The relatives of the convolution come from three moves that Chapter 6 proved: a change of the summation index, symmetry, and negation of the upper index. Symmetry needs an upper index that is a nonnegative integer, and that is why the corollaries carry such conditions. Negation moves a variable from the upper index to the lower index or back, and it costs a sign. The negated form also uses the binomial theorem in the form (1−1)p=[p=0](1 - 1)^{p} = [p = 0] for an integer p≥0p \ge 0. This small fact is the root of the inversion formulas of Section 7.2.

To use the section on a given sum, look at where the index kk appears. If kk appears in the two lower indices with opposite signs, as kk and n−kn - k, the sum is a convolution. If it appears in both lower indices with the same sign, try symmetry on a factor whose upper index is a nonnegative integer. If kk appears in an upper index, try negation to bring it down, or try the form with upper indices running. A factor kk or 1k+1\frac{1}{k+1} outside the coefficients goes away by absorption (Section 6.3). After each move, check the conditions of the identity that you plan to use, and test the result for a small case.

Examples

Example P2.7.12. Take r=5r = 5, s=4s = 4 and n=3n = 3. The terms of the convolution are (50)(43)=4\binom50\binom43 = 4, (51)(42)=30\binom51\binom42 = 30, (52)(41)=40\binom52\binom41 = 40 and (53)(40)=10\binom53\binom40 = 10. Their sum is 8484, and (93)=9⋅8⋅76=84\binom93 = \frac{9 \cdot 8 \cdot 7}{6} = 84.

Example P2.7.13. Take r=s=12r = s = \frac12 and n=2n = 2. The coefficients are (1/20)=1\binom{1/2}{0} = 1, (1/21)=12\binom{1/2}{1} = \frac12 and (1/22)=(1/2)(−1/2)2=−18\binom{1/2}{2} = \frac{(1/2)(-1/2)}{2} = -\frac18. The terms of the convolution are −18-\frac18, 14\frac14 and −18-\frac18, with the sum 00. The right side is (12)=0\binom{1}{2} = 0. The identity holds for real upper indices, as the polynomial argument promised.

Example P2.7.14. Find ∑kk(nk)2\sum_k k \binom{n}{k}^2 for an integer n≥1n \ge 1. Absorption gives k(nk)=n(n−1k−1)k\binom{n}{k} = n\binom{n-1}{k-1} for every integer kk, and symmetry gives (nk)=(nn−k)\binom{n}{k} = \binom{n}{n-k}. So the sum is n∑k(n−1k−1)(nn−k)n \sum_k \binom{n-1}{k-1}\binom{n}{n-k}. The lower indices k−1k - 1 and n−kn - k have the constant sum n−1n - 1, so the shifted form of the convolution gives n(2n−1n−1)n\binom{2n-1}{n-1}. For n=3n = 3 the terms are 1⋅91 \cdot 9, 2⋅92 \cdot 9 and 3⋅13 \cdot 1, with the sum 3030, and 3(52)=303\binom52 = 30.

Example P2.7.15. Show that ∑k=0n(2kk)(2n−2kn−k)=4n\sum_{k=0}^{n} \binom{2k}{k}\binom{2n-2k}{n-k} = 4^n. Each factor is a central binomial coefficient, and the upper indices 2k2k and 2n−2k2n - 2k move with kk, so the sum does not look like a convolution. Section 6.4 gives (−1/2k)=(−14)k(2kk)\binom{-1/2}{k} = \left(-\frac14\right)^k\binom{2k}{k} for k≥0k \ge 0. So (2kk)=(−4)k(−1/2k)\binom{2k}{k} = (-4)^k\binom{-1/2}{k}, and the sum is ∑k(−4)k(−1/2k)(−4)n−k(−1/2n−k)=(−4)n(−1n)=(−4)n(−1)n=4n,\sum_k (-4)^k\binom{-1/2}{k}(-4)^{n-k}\binom{-1/2}{n-k} = (-4)^n\binom{-1}{n} = (-4)^n(-1)^n = 4^n, by the convolution with r=s=−12r = s = -\frac12 and the value (−1n)=(−1)n\binom{-1}{n} = (-1)^n. For n=2n = 2 the terms are 1⋅61 \cdot 6, 2⋅22 \cdot 2 and 6⋅16 \cdot 1, with the sum 1616. The trick was to move the variable from the upper index to the lower index with a real upper index.

Example P2.7.16. Find ∑k(nk)(nk+1)\sum_k \binom{n}{k}\binom{n}{k+1} for an integer n≥1n \ge 1. Here kk appears in both lower indices with the same sign, and the upper index nn is a nonnegative integer. The form with indices running together, with r=nr = n, m=0m = 0 and 11 in place of nn, gives (2nn+1)=(2nn−1)\binom{2n}{n+1} = \binom{2n}{n-1}. For n=3n = 3 the terms are 1⋅31 \cdot 3, 3⋅33 \cdot 3 and 3⋅13 \cdot 1, with the sum 15=(62)15 = \binom62.

Example P2.7.17. The negated form with r=3r = 3, s=2s = 2 and n=4n = 4 says ∑k(3k)(2+k4)(−1)3−k=(21)=2\sum_k \binom3k\binom{2+k}{4}(-1)^{3-k} = \binom21 = 2. The terms for k=0,1,2,3k = 0, 1, 2, 3 are −(24)=0-\binom24 = 0, 3(34)=03\binom34 = 0, −3(44)=−3-3\binom44 = -3 and (54)=5\binom54 = 5. The sum is 22.

Exercises

  1. [10] Compute ∑k(4k)(32−k)\sum_k \binom4k\binom3{2-k} term by term, and compare the result with Vandermonde's convolution.
  2. [M15] Let mm and nn be nonnegative integers. Show that ∑k(mk)(nk)=(m+nm)\sum_k \binom{m}{k}\binom{n}{k} = \binom{m+n}{m}. Then show that for an integer n≥0n \ge 0 and a real ss, ∑k(nk)(sk)=(n+sn)\sum_k \binom{n}{k}\binom{s}{k} = \binom{n+s}{n}.
  3. [M20] Find a closed form for ∑kk2(nk)2\sum_k k^2\binom{n}{k}^2, where n≥1n \ge 1 is an integer, and check it for n=2n = 2 and n=3n = 3.
  4. [M22] Use the value of (1/2k)\binom{1/2}{k} from Section 6.4 and the convolution with r=s=12r = s = \frac12 to find ∑k=0n(2kk)(2n−2kn−k)(2k−1)(2n−2k−1)\sum_{k=0}^{n} \frac{\binom{2k}{k}\binom{2n-2k}{n-k}}{(2k-1)(2n-2k-1)} for every integer n≥0n \ge 0.
  5. [M15] Show that the identity with upper indices running is false for r=m=n=0r = m = n = 0 and s=1s = 1. Which step of the proof fails?
  6. [M20] Let n≥0n \ge 0 be an integer. Prove that ∑k(−1)k(nk)(2n−kn)=1\sum_k (-1)^k\binom{n}{k}\binom{2n-k}{n} = 1.
  7. [M15] Prove that ∑i+j+k=n(ri)(sj)(tk)=(r+s+tn)\sum_{i+j+k=n}\binom{r}{i}\binom{s}{j}\binom{t}{k} = \binom{r+s+t}{n} for all real rr, ss, tt and every integer nn, where the sum runs over all triples of integers with sum nn.
  8. [M20] Find a nonzero polynomial P(x,y)P(x, y) with P(a,b)=0P(a, b) = 0 for every integer aa and every b∈{0,1}b \in \{0, 1\}. Explain why this does not contradict the polynomial argument, and why the proof of Vandermonde's convolution needs both variables to range over infinite sets.

Lean

Mathlib has Vandermonde's convolution twice. Nat.add_choose_eq states it for natural numbers, with the sum over the antidiagonal Finset.antidiagonal k, which is the set of pairs (i,j)(i, j) with i+j=ki + j = k. Ring.add_choose_eq states it in a binomial ring, a ring with a binomial coefficient Ring.choose r k for each element rr and each natural kk. Mathlib has an instance that makes every ring that is a module over the nonnegative rationals a binomial ring. So ℚ\mathbb{Q} and ℝ\mathbb{R} are binomial rings, and Ring.add_choose_eq covers real upper indices. The sum of squares of a row is Nat.sum_range_choose_sq, and the polynomial argument is MvPolynomial.funext_set.

The book's coefficient has an integer lower index, which may be negative. TAOCP/Notation (tamnd/taocp-lean main) defines TAOCP.binom (r : R) : ℤ → R over a field RR, with the value zero for a negative lower index, and TAOCP.binom_natCast is the bridge to Nat.choose. The forms with shifted indices and the negated form need the integer lower index, and they are not yet stated for TAOCP.binom. A fidelity point: Nat.choose has a natural upper index and truncated subtraction, so a statement such as (r−km)\binom{r-k}{m} with k>rk > r has a different meaning there. Statements of this section should use TAOCP.binom on ℚ\mathbb{Q} or ℝ\mathbb{R}.

Notes and history

The convolution is named after Alexandre-Théophile Vandermonde, who published it in 1772. Zhu Shijie had it in 1303 in a Chinese text on the arithmetic of series, and Chu Shih-chieh is the older spelling of his name, so the identity is also called the Chu-Vandermonde identity. The counting proof and the polynomial argument used here are the standard modern proof. Another proof compares the coefficients of xnx^n in (1+x)r(1+x)s=(1+x)r+s(1+x)^r(1+x)^s = (1+x)^{r+s}, with the binomial series of Section 6.4. P3 gives that proof with formal power series.

TAOCP states the convolution as eq. 1.2.6(21) and its relatives as eqs. 1.2.6(22) to 1.2.6(25), and it proves some of them in the exercises of Section 1.2.6. The handbook proves them all in the text and leaves new problems for the exercises. The convolution is used throughout the later volumes: in the analysis of algorithms of Volume 3, where a sum over the sizes of two subfiles is a convolution, and in the generating functions of Section 1.2.9, where it is the product of two binomial series. GKP94 Section 5.1 has a table of the basic identities, and its Section 5.2 has a long set of worked sums that use the moves of this section.

Orthogonality and binomial inversion

Statement

This section solves one kind of equation. A sequence f(0),f(1),f(2),…f(0), f(1), f(2), \dots is not known, but the sums g(n)=∑k(nk)f(k)g(n) = \sum_k \binom{n}{k} f(k) are known for each n≥0n \ge 0. The answer is a formula for ff in terms of gg, and it rests on one identity, the orthogonality relation. The same identity gives the nnth difference of a function as a sum, and it shows that the rrth difference of a polynomial of degree rr is a constant.

Theorem P2.7.18 (orthogonality). Let rr be a nonnegative integer and let nn be an integer. Then ∑k(rk)(kn)(−1)r−k=[n=r].\sum_k \binom{r}{k}\binom{k}{n}(-1)^{r-k} = [n = r].

Lean: not in Mathlib in this form; the case n=0n = 0 is Int.alternating_sum_range_choose (proved in Mathlib).

Proof. This is the negated form of Section 7.1 with s=0s = 0. The right side of that form is (0n−r)\binom{0}{n-r}, which is 11 for n=rn = r and 00 otherwise. □\square

The sign (−1)r−k(-1)^{r-k} may also be written (−1)k−r(-1)^{k-r}, since r−kr - k and k−rk - r have the same parity. The name comes from linear algebra. Let PP be the matrix with the entry (ij)\binom{i}{j} in row ii and column jj, for 0≤i,j≤N0 \le i, j \le N, and let QQ be the matrix with the entry (−1)i−j(ij)(-1)^{i-j}\binom{i}{j}. The theorem says QP=IQP = I, the identity matrix. So QQ is the inverse of PP.

Definition P2.7.19 (binomial transform). Let f(0),f(1),f(2),…f(0), f(1), f(2), \dots be a sequence of numbers. Its binomial transform is the sequence gg with g(n)=∑k(nk)f(k)g(n) = \sum_k \binom{n}{k} f(k) for each n≥0n \ge 0. The sum has the terms 0≤k≤n0 \le k \le n, so it is finite.

Example P2.7.20. For f(k)=1f(k) = 1 the binomial theorem gives g(n)=∑k(nk)=2ng(n) = \sum_k \binom{n}{k} = 2^n. For f(k)=xkf(k) = x^k it gives g(n)=(1+x)ng(n) = (1 + x)^n. In this sense the binomial transform adds 11 to the base of a power.

Example P2.7.21. For f(k)=[k=1]f(k) = [k = 1] the sum has one term, and g(n)=(n1)=ng(n) = \binom{n}{1} = n. For f(k)=[k=2]f(k) = [k = 2], g(n)=(n2)g(n) = \binom{n}{2}. So f=(0,1,2,0,0,… )f = (0, 1, 2, 0, 0, \dots) has the transform g(n)=n+2(n2)=n2g(n) = n + 2\binom{n}{2} = n^2.

Theorem P2.7.22 (binomial inversion). Let ff and gg be sequences indexed by the nonnegative integers. Then g(n)=∑k(nk)f(k)g(n) = \sum_k \binom{n}{k} f(k) for every n≥0n \ge 0 if and only if f(n)=∑k(nk)(−1)n−kg(k)f(n) = \sum_k \binom{n}{k}(-1)^{n-k} g(k) for every n≥0n \ge 0.

Lean: not in Mathlib in this form; the difference forms below are in Mathlib.

Proof. Assume the first set of equations. Fix n≥0n \ge 0. Put the formula for g(k)g(k) into the right side of the second equation. The sums over kk and jj are finite, so they may change places: ∑k(nk)(−1)n−k∑j(kj)f(j)=∑jf(j)∑k(nk)(kj)(−1)n−k=∑jf(j)[j=n]=f(n),\sum_k \binom{n}{k}(-1)^{n-k}\sum_j \binom{k}{j} f(j) = \sum_j f(j)\sum_k \binom{n}{k}\binom{k}{j}(-1)^{n-k} = \sum_j f(j)[j = n] = f(n), by orthogonality with r=nr = n. For the converse, assume the second set of equations and compute in the same way: ∑k(nk)∑j(kj)(−1)k−jg(j)=∑jg(j)(−1)n−j∑k(nk)(kj)(−1)n−k.\sum_k \binom{n}{k}\sum_j \binom{k}{j}(-1)^{k-j} g(j) = \sum_j g(j)(-1)^{n-j}\sum_k \binom{n}{k}\binom{k}{j}(-1)^{n-k}. Here (−1)k−j=(−1)n−j(−1)n−k(-1)^{k-j} = (-1)^{n-j}(-1)^{n-k}, because (n−j)+(n−k)=(k−j)+2(n−k)(n - j) + (n - k) = (k - j) + 2(n - k). Orthogonality makes the inner sum [j=n][j = n], and the sign is then (−1)0=1(-1)^0 = 1. So the right side is g(n)g(n). □\square

Definition P2.7.23 (repeated difference). Let ff be a function on the real numbers, or on the integers. Chapter 3 defines Δf(x)=f(x+1)−f(x)\Delta f(x) = f(x+1) - f(x). Define Δ0f=f\Delta^0 f = f and Δm+1f=Δ(Δmf)\Delta^{m+1} f = \Delta(\Delta^m f) for m≥0m \ge 0. The function Δmf\Delta^m f is the mmth difference of ff.

Example P2.7.24. Let f(x)=x2f(x) = x^2. Then Δf(x)=(x+1)2−x2=2x+1\Delta f(x) = (x+1)^2 - x^2 = 2x + 1, Δ2f(x)=2(x+1)+1−(2x+1)=2\Delta^2 f(x) = 2(x+1) + 1 - (2x + 1) = 2, and Δmf=0\Delta^m f = 0 for m≥3m \ge 3. A table of values shows the same thing: the values 0,1,4,9,160, 1, 4, 9, 16 have the differences 1,3,5,71, 3, 5, 7, then 2,2,22, 2, 2, then 0,00, 0.

Example P2.7.25. Let f(x)=2xf(x) = 2^x. Then Δf(x)=2x+1−2x=2x\Delta f(x) = 2^{x+1} - 2^x = 2^x, so Δmf=f\Delta^m f = f for every mm. In the same way Δmcx=(c−1)mcx\Delta^m c^x = (c - 1)^m c^x for a real c>0c > 0.

Theorem P2.7.26 (difference formula). For every function ff, every xx and every integer n≥0n \ge 0, Δnf(x)=∑k(nk)(−1)n−kf(x+k).\Delta^n f(x) = \sum_k \binom{n}{k}(-1)^{n-k} f(x + k).

Lean: Mathlib fwdDiff_iter_eq_sum_shift (proved in Mathlib), with the step hh of fwdDiff h equal to 11.

Proof. Use induction on nn. For n=0n = 0 both sides are f(x)f(x). Assume the formula for nn. Then Δn+1f(x)=Δnf(x+1)−Δnf(x)=∑k(nk)(−1)n−kf(x+1+k)−∑k(nk)(−1)n−kf(x+k).\Delta^{n+1} f(x) = \Delta^n f(x+1) - \Delta^n f(x) = \sum_k \binom{n}{k}(-1)^{n-k} f(x+1+k) - \sum_k \binom{n}{k}(-1)^{n-k} f(x+k). In the first sum put k−1k - 1 in place of kk, so it becomes ∑k(nk−1)(−1)n+1−kf(x+k)\sum_k \binom{n}{k-1}(-1)^{n+1-k} f(x+k). In the second sum write −(−1)n−k=(−1)n+1−k-(-1)^{n-k} = (-1)^{n+1-k}. The coefficient of f(x+k)f(x+k) is then ((nk−1)+(nk))(−1)n+1−k\left(\binom{n}{k-1} + \binom{n}{k}\right)(-1)^{n+1-k}, which is (n+1k)(−1)n+1−k\binom{n+1}{k}(-1)^{n+1-k} by the addition formula. □\square

Theorem P2.7.27 (Newton's forward formula). For every function ff, every xx and every integer n≥0n \ge 0, f(x+n)=∑k(nk)Δkf(x).f(x + n) = \sum_k \binom{n}{k}\Delta^k f(x).

Lean: Mathlib shift_eq_sum_fwdDiff_iter (proved in Mathlib).

Proof. Fix xx and put g(n)=f(x+n)g(n) = f(x + n) and F(k)=Δkf(x)F(k) = \Delta^k f(x). The difference formula says F(n)=∑k(nk)(−1)n−kg(k)F(n) = \sum_k \binom{n}{k}(-1)^{n-k} g(k) for every n≥0n \ge 0. Binomial inversion turns this into g(n)=∑k(nk)F(k)g(n) = \sum_k \binom{n}{k} F(k), which is the claim. □\square

Theorem P2.7.28 (difference of a polynomial). Let r≥0r \ge 0 be an integer and let p(x)=b0+b1x+⋯+brxrp(x) = b_0 + b_1 x + \cdots + b_r x^r be a polynomial with real coefficients. Then Δrp(x)=r! br\Delta^r p(x) = r!\, b_r for every xx, and Δmp=0\Delta^m p = 0 for every m>rm > r. In particular ∑k(rk)(−1)r−kp(k)=r! br.\sum_k \binom{r}{k}(-1)^{r-k} p(k) = r!\, b_r.

Lean: Mathlib Polynomial.fwdDiff_iter_degree_eq_factorial, fwdDiff_iter_eq_factorial and Polynomial.fwdDiff_iter_eq_zero_of_degree_lt (proved in Mathlib).

Proof. For j≥1j \ge 1 the binomial theorem gives Δxj=(x+1)j−xj=jxj−1+(terms of degree less than j−1)\Delta x^j = (x+1)^j - x^j = j x^{j-1} + (\text{terms of degree less than } j - 1), and Δx0=0\Delta x^0 = 0. So if qq is a polynomial of degree at most dd with the coefficient cc at xdx^d, and d≥1d \ge 1, then Δq\Delta q is a polynomial of degree at most d−1d - 1 with the coefficient d cd\,c at xd−1x^{d-1}. If d=0d = 0, then qq is a constant and Δq=0\Delta q = 0. Apply this mm times, for m≤rm \le r: the function Δmp\Delta^m p is a polynomial of degree at most r−mr - m with the coefficient r(r−1)⋯(r−m+1) brr(r-1)\cdots(r-m+1)\, b_r at xr−mx^{r-m}. For m=rm = r this is the constant r! brr!\, b_r, and one more difference gives 00. The last formula is the difference formula with n=rn = r and x=0x = 0. □\square

Corollary P2.7.29 (a sum with a free step). For every integer r≥0r \ge 0 and all real ss and tt, ∑k(rk)(s−ktr)(−1)k=tr.\sum_k \binom{r}{k}\binom{s - kt}{r}(-1)^k = t^r.

Lean: not in Mathlib in this form.

Proof. The function p(k)=(s−ktr)=1r!(s−kt)(s−kt−1)⋯(s−kt−r+1)p(k) = \binom{s-kt}{r} = \frac{1}{r!}(s - kt)(s - kt - 1)\cdots(s - kt - r + 1) is a polynomial in kk of degree at most rr. Each of its rr factors has the coefficient −t-t at kk, so the coefficient of krk^r is (−t)r/r!(-t)^r/r!. Write (−1)k=(−1)r(−1)r−k(-1)^k = (-1)^r(-1)^{r-k}. The theorem on the difference of a polynomial gives the sum (−1)r⋅r!⋅(−t)r/r!=tr(-1)^r \cdot r! \cdot (-t)^r/r! = t^r. □\square

Definition P2.7.30 (derangement). A derangement of a finite set SS is a permutation π\pi of SS with π(i)≠i\pi(i) \ne i for every i∈Si \in S, that is, a permutation with no fixed point. Let DnD_n be the number of derangements of {1,2,…,n}\{1, 2, \dots, n\}. The empty permutation of the empty set has no fixed point, so D0=1D_0 = 1.

Example P2.7.31. For n=3n = 3 write a permutation as the list π(1)π(2)π(3)\pi(1)\pi(2)\pi(3). The six permutations are 123123, 132132, 213213, 231231, 312312 and 321321. Only 231231 and 312312 move every element, so D3=2D_3 = 2. For n=1n = 1 the only permutation fixes 11, so D1=0D_1 = 0, and for n=2n = 2 the only derangement is 2121, so D2=1D_2 = 1.

Example P2.7.32. For n=4n = 4 the derangements are 21432143, 23412341, 24132413, 31423142, 34123412, 34213421, 41234123, 43124312 and 43214321, so D4=9D_4 = 9. Three of them, 21432143, 34123412 and 43214321, are products of two exchanges, and the other six are single cycles of length 44.

Theorem P2.7.33 (derangements). For every integer n≥0n \ge 0, n!=∑k(nk)Dkn! = \sum_k \binom{n}{k} D_k, and Dn=∑k(nk)(−1)n−kk!=n!∑j=0n(−1)jj!.D_n = \sum_k \binom{n}{k}(-1)^{n-k} k! = n!\sum_{j=0}^{n}\frac{(-1)^j}{j!}.

Lean: Mathlib card_derangements_eq_numDerangements and numDerangements_sum (proved in Mathlib); the second has the sum in a form with Nat.ascFactorial.

Proof. Sort the n!n! permutations of {1,…,n}\{1, \dots, n\} by the set MM of the elements that they move. A permutation that moves exactly the elements of MM is the identity on the complement of MM, and on MM it is a derangement of MM. Conversely each derangement of MM, extended by the identity, gives such a permutation. A derangement of a set with kk elements is a derangement of {1,…,k}\{1, \dots, k\} after a renaming, so there are DkD_k of them. There are (nk)\binom{n}{k} sets MM with kk elements, so n!=∑k(nk)Dkn! = \sum_k \binom{n}{k} D_k. Binomial inversion with g(n)=n!g(n) = n! and f(k)=Dkf(k) = D_k gives the first formula for DnD_n. For the second, (nk)k!=n!/(n−k)!\binom{n}{k}k! = n!/(n-k)!, and the index j=n−kj = n - k gives Dn=∑j=0n(−1)jn!/j!D_n = \sum_{j=0}^{n} (-1)^j n!/j!. □\square

Corollary P2.7.34 (factorials in falling powers). Let ak=∑j=0k(−1)j/j!a_k = \sum_{j=0}^{k} (-1)^j/j!. Then n!=∑kak nk‾n! = \sum_k a_k\, n^{\underline{k}} for every integer n≥0n \ge 0. The numbers aka_k are the only numbers with this property.

Lean: not in Mathlib.

Proof. The theorem gives Dk=k! akD_k = k!\, a_k, and (nk)=nk‾/k!\binom{n}{k} = n^{\underline{k}}/k!, so n!=∑k(nk)Dk=∑kaknk‾n! = \sum_k \binom{n}{k} D_k = \sum_k a_k n^{\underline{k}}. For the uniqueness, let (ck)(c_k) be numbers with ∑kcknk‾=n!\sum_k c_k n^{\underline{k}} = n! for every n≥0n \ge 0. For k>nk > n the falling power nk‾n^{\underline{k}} has the factor n−n=0n - n = 0. So the equation for n=mn = m reads c0m0‾+⋯+cmmm‾=m!c_0 m^{\underline{0}} + \cdots + c_m m^{\underline{m}} = m!, with mm‾=m!≠0m^{\underline{m}} = m! \ne 0, and it determines cmc_m from c0,…,cm−1c_0, \dots, c_{m-1}. By induction on mm the numbers cmc_m are determined, so they are the ama_m. □\square

Proof

The proofs of this section are one idea used four times. Orthogonality says that the matrices ((ij))\left(\binom{i}{j}\right) and ((−1)i−j(ij))\left((-1)^{i-j}\binom{i}{j}\right) are inverse to each other. So an equation of the form "gg is the binomial transform of ff" can be solved for ff, and the solution is the alternating transform of gg. The proof is always the same: put one formula into the other, change the order of the two finite sums, and let orthogonality kill every term but one.

The difference formula is the case where ff is the sequence of differences of a function. Newton's forward formula is its inverse. The theorem on polynomials uses one more fact: each difference lowers the degree of a polynomial by one and multiplies the top coefficient by the degree. The corollary with a free step tt is an example of the general method: if the summand is a polynomial in kk times (rk)(−1)k\binom{r}{k}(-1)^k, then only the degree and the top coefficient of the polynomial matter. For derangements the method runs the other way: a count of all permutations by their fixed points gives the binomial transform of DnD_n, and inversion gives DnD_n.

Examples

Example P2.7.35. The binomial transform of f(k)=1f(k) = 1 is g(n)=2ng(n) = 2^n. Inversion gives 1=∑k(nk)(−1)n−k2k1 = \sum_k \binom{n}{k}(-1)^{n-k}2^k, which is the binomial theorem for (2−1)n(2 - 1)^n. For n=3n = 3 the terms are −1-1, 66, −12-12 and 88, with the sum 11.

Example P2.7.36. Find numbers f(k)f(k) with ∑k(nk)f(k)=n2\sum_k \binom{n}{k} f(k) = n^2 for all n≥0n \ge 0. Inversion gives f(k)=∑j(kj)(−1)k−jj2=Δkx2f(k) = \sum_j \binom{k}{j}(-1)^{k-j} j^2 = \Delta^k x^2 at x=0x = 0. The table of differences of 0,1,4,9,…0, 1, 4, 9, \dots starts with f(0)=0f(0) = 0, f(1)=1f(1) = 1, f(2)=2f(2) = 2, and f(k)=0f(k) = 0 for k≥3k \ge 3. So n2=(n1)+2(n2)n^2 = \binom{n}{1} + 2\binom{n}{2}, which is the second example after the definition of the transform.

Example P2.7.37. The difference formula with f(x)=x3f(x) = x^3, n=3n = 3 and x=0x = 0 gives ∑k(3k)(−1)3−kk3=−0+3⋅1−3⋅8+27=6\sum_k \binom3k(-1)^{3-k}k^3 = -0 + 3 \cdot 1 - 3 \cdot 8 + 27 = 6. The theorem on polynomials predicts 3!⋅1=63! \cdot 1 = 6. With f(x)=x3f(x) = x^3 and n=4n = 4 the same sum is 0−4+6⋅8−4⋅27+64=00 - 4 + 6 \cdot 8 - 4 \cdot 27 + 64 = 0, as the theorem predicts for m>rm > r.

Example P2.7.38. The corollary with a free step, for r=2r = 2, s=5s = 5 and t=3t = 3, says (52)−2(22)+(−12)=32\binom52 - 2\binom{2}{2} + \binom{-1}{2} = 3^2. The terms are 1010, −2-2 and (−12)=(−1)(−2)2=1\binom{-1}{2} = \frac{(-1)(-2)}{2} = 1, with the sum 99. The third term has a negative upper index, and the identity needs it.

Example P2.7.39. The first values of DnD_n are D0=1D_0 = 1, D1=0D_1 = 0, D2=1D_2 = 1, D3=2D_3 = 2, D4=9D_4 = 9, D5=44D_5 = 44, D6=265D_6 = 265, D7=1854D_7 = 1854 and D8=14833D_8 = 14833. For n=4n = 4 the identity n!=∑k(nk)Dkn! = \sum_k \binom{n}{k}D_k reads 1⋅1+4⋅0+6⋅1+4⋅2+1⋅9=241 \cdot 1 + 4 \cdot 0 + 6 \cdot 1 + 4 \cdot 2 + 1 \cdot 9 = 24. The formula D5=5!(1−1+12−16+124−1120)=60−20+5−1=44D_5 = 5!\left(1 - 1 + \frac12 - \frac16 + \frac1{24} - \frac1{120}\right) = 60 - 20 + 5 - 1 = 44 agrees.

Example P2.7.40. The numbers of the corollary on factorials start with a0=1a_0 = 1, a1=0a_1 = 0, a2=12a_2 = \frac12, a3=13a_3 = \frac13, a4=38a_4 = \frac38 and a5=1130a_5 = \frac{11}{30}. For n=3n = 3 the expansion reads 1+0⋅3+12⋅6+13⋅6=6=3!1 + 0 \cdot 3 + \frac12 \cdot 6 + \frac13 \cdot 6 = 6 = 3!. The terms with k>3k > 3 vanish because 3k‾=03^{\underline{k}} = 0.

Exercises

  1. [10] Compute D6D_6 from the formula of the theorem on derangements, and check it with the recurrence of Exercise 2.
  2. [M15] Prove that Dn=nDn−1+(−1)nD_n = n D_{n-1} + (-1)^n for every n≥1n \ge 1.
  3. [M20] Prove that Dn+1=n(Dn+Dn−1)D_{n+1} = n(D_n + D_{n-1}) for every n≥1n \ge 1 by a count. Look at the element that the derangement sends to n+1n + 1.
  4. [M20] Use binomial inversion to find numbers f(k)f(k) with ∑k(nk)f(k)=n3\sum_k \binom{n}{k} f(k) = n^3 for every n≥0n \ge 0, and check the result for n=2n = 2 and n=3n = 3.
  5. [M15] Compute ∑k(5k)(−1)kk5\sum_k \binom5k(-1)^k k^5 and ∑k(5k)(−1)k(k2+1)2\sum_k \binom5k(-1)^k (k^2 + 1)^2 without adding up the terms.
  6. [M20] Let r≥0r \ge 0 be an integer and let aa and bb be real numbers. Prove that ∑k(rk)(−1)k(a+bk)r=(−b)rr!\sum_k \binom{r}{k}(-1)^k(a + bk)^r = (-b)^r r!.
  7. [M22] A permutation of {1,…,n}\{1, \dots, n\} with exactly jj fixed points is called a partial derangement. Show that there are (nj)Dn−j\binom{n}{j}D_{n-j} of them, and prove that ∑jj(nj)Dn−j=n!\sum_j j\binom{n}{j}D_{n-j} = n! for n≥1n \ge 1. What does this say about the average number of fixed points of a permutation?
  8. [HM22] Use the series e−1=∑j≥0(−1)j/j!e^{-1} = \sum_{j \ge 0}(-1)^j/j! to prove that ∣Dn−n!/e∣<1/(n+1)|D_n - n!/e| < 1/(n+1) for every n≥0n \ge 0. Deduce that DnD_n is the integer nearest to n!/en!/e for every n≥1n \ge 1.

Lean

Mathlib has the difference operator as fwdDiff h f, with the notation Δ_[h] f, for a function on an additive monoid. The difference formula is fwdDiff_iter_eq_sum_shift, and Newton's forward formula is shift_eq_sum_fwdDiff_iter, which Mathlib calls the Gregory-Newton formula. The theorem on polynomials is fwdDiff_iter_eq_factorial for xnx^n, Polynomial.fwdDiff_iter_degree_eq_factorial for a polynomial of degree nn, and Polynomial.fwdDiff_iter_eq_zero_of_degree_lt for the higher differences. The theorem on derangements is card_derangements_eq_numDerangements together with numDerangements_sum, and the limit Dn/n!→1/eD_n/n! \to 1/e is numDerangements_tendsto_inv_e.

Orthogonality and binomial inversion with integer lower indices are not in Mathlib in this form, and they are not yet stated with TAOCP.binom of TAOCP/Notation (tamnd/taocp-lean main). Mathlib states the alternating row sum ∑m(−1)m(nm)=[n=0]\sum_m (-1)^m\binom{n}{m} = [n = 0] as Int.alternating_sum_range_choose, over the integers, because the sum has negative terms.

Notes and history

Binomial inversion goes back to the calculus of finite differences of the eighteenth century, and Newton's forward formula is in Newton's work on interpolation of the 1670s. Euler counted the derangements in 1753, and the problem is older: Pierre Rémond de Montmort posed it in 1708 as a problem about a card game, and Nicolaus Bernoulli solved it. The inclusion and exclusion principle gives the formula for DnD_n in one step; P3 has that principle. The proof here uses inversion instead, because inversion is the subject of this section.

TAOCP states orthogonality as eq. 1.2.6(33), the theorem on polynomials as eq. 1.2.6(34) and the corollary with a free step as eq. 1.2.6(35). Eqs. 1.2.6(31) and 1.2.6(32) are the expansion of n!n! in falling powers, which the corollary on factorials proves here by a count of derangements. Volume 3 meets the same numbers in the analysis of sorting, where the number of fixed points of a random permutation has mean 11 (Exercise 7). The difference operator returns in Chapter 8, where the mmth difference of xnx^n at 00 gives the Stirling numbers of the second kind, and in Chapter 11, where it gives the Bernoulli numbers. GKP94 Section 5.3 develops the same tricks under the heading of the inversion of sums, and its Section 2.6 is the finite calculus of Chapter 3.

Abel's identity and convolutions

Statement

Vandermonde's convolution of Section 7.1 has a family of relatives in which the upper index moves with the lower index. The members of the family are the polynomials An(x,t)A_n(x, t) below. For t=0t = 0 they are the binomial coefficients (xn)\binom{x}{n}, and the convolution formula for them is Vandermonde's convolution. For t=−2t = -2 and x=1x = 1 they are the Catalan numbers. This section proves the convolution formulas with a count of sequences and the polynomial argument, and it proves Abel's binomial theorem, an identity of the same kind with powers in place of binomial coefficients.

Definition P2.7.41 (the polynomials A and B). Let n≥0n \ge 0 be an integer. For real xx and tt define A0(x,t)=1A_0(x, t) = 1 and, for n≥1n \ge 1, An(x,t)=x (x−nt−1)(x−nt−2)⋯(x−nt−n+1)n!.A_n(x, t) = \frac{x\,(x - nt - 1)(x - nt - 2)\cdots(x - nt - n + 1)}{n!}. Define also Bn(x,t)=(x−ntn)B_n(x, t) = \binom{x - nt}{n}. Both are polynomials in xx and tt of degree at most nn. When x≠ntx \ne nt, the factorial form of Section 6.2 gives An(x,t)=xx−nt(x−ntn)A_n(x, t) = \dfrac{x}{x - nt}\dbinom{x - nt}{n}.

Example P2.7.42. For t=0t = 0 the definition gives An(x,0)=x(x−1)⋯(x−n+1)/n!=(xn)A_n(x, 0) = x(x-1)\cdots(x-n+1)/n! = \binom{x}{n}, and also Bn(x,0)=(xn)B_n(x, 0) = \binom{x}{n}. For n=3n = 3 and t=−1t = -1 it gives A3(x,−1)=x(x+2)(x+1)/6=(x+23)A_3(x, -1) = x(x+2)(x+1)/6 = \binom{x+2}{3}.

Example P2.7.43. For x=1x = 1 and t=−2t = -2 the definition gives An(1,−2)=12n+1(2n+1n)A_n(1, -2) = \frac{1}{2n+1}\binom{2n+1}{n}. The first values are 1,1,2,5,14,421, 1, 2, 5, 14, 42. These are the Catalan numbers Cn=1n+1(2nn)C_n = \frac{1}{n+1}\binom{2n}{n}, and the two forms agree, because (2n+1n)=2n+1n+1(2nn)\binom{2n+1}{n} = \frac{2n+1}{n+1}\binom{2n}{n}. For x=1x = 1 and t=−3t = -3 the values An(1,−3)=13n+1(3n+1n)A_n(1, -3) = \frac{1}{3n+1}\binom{3n+1}{n} are 1,1,3,12,55,2731, 1, 3, 12, 55, 273.

Theorem P2.7.44 (Abel's identity). For all real xx, yy and zz and every integer n≥0n \ge 0, ∑k(nk) x(x−kz)k−1(y+kz)n−k=(x+y)n.\sum_k \binom{n}{k}\, x(x - kz)^{k-1}(y + kz)^{n-k} = (x + y)^n. The term with k=0k = 0 is yny^n, that is, the factor x(x−kz)k−1x(x - kz)^{k-1} has the value 11 for k=0k = 0, and 00=10^0 = 1 in the term with k=nk = n.

Lean: not in Mathlib.

Proof. Fix xx and zz. Let Sn(y)S_n(y) be the left side, a polynomial in yy. The proof is by induction on nn. For n=0n = 0 the sum has one term, 11. Let n≥1n \ge 1 and assume Sn−1(y)=(x+y)n−1S_{n-1}(y) = (x + y)^{n-1} for all yy. The derivative of (y+kz)n−k(y + kz)^{n-k} with respect to yy is (n−k)(y+kz)n−k−1(n - k)(y + kz)^{n-k-1}, and (n−k)(nk)=n(n−1k)(n - k)\binom{n}{k} = n\binom{n-1}{k}. So Sn′(y)=n∑k(n−1k)x(x−kz)k−1(y+kz)n−1−k=nSn−1(y)=n(x+y)n−1.S_n'(y) = n \sum_k \binom{n-1}{k} x(x - kz)^{k-1}(y + kz)^{n-1-k} = n S_{n-1}(y) = n(x + y)^{n-1}. The polynomial Sn(y)−(x+y)nS_n(y) - (x + y)^n has the derivative zero, so it is a constant. To find the constant, put y=−xy = -x. Then y+kz=−(x−kz)y + kz = -(x - kz), and every term has the form (nk)(−1)n−kx(x−kz)n−1\binom{n}{k}(-1)^{n-k} x (x - kz)^{n-1}; for k=0k = 0 this is (−1)nxn(-1)^n x^n, which is the term yny^n. So Sn(−x)=x∑k(nk)(−1)n−kp(k),p(k)=(x−kz)n−1.S_n(-x) = x \sum_k \binom{n}{k}(-1)^{n-k} p(k), \qquad p(k) = (x - kz)^{n-1}. The function pp is a polynomial in kk of degree at most n−1n - 1. By the theorem on the difference of a polynomial in Section 7.2, the sum is Δnp(0)=0\Delta^n p(0) = 0. So Sn(−x)=0=(x−x)nS_n(-x) = 0 = (x - x)^n, the constant is zero, and Sn(y)=(x+y)nS_n(y) = (x + y)^n for all yy. □\square

Definition P2.7.45 (good sequence). Let a1,a2,…,ama_1, a_2, \dots, a_m be integers. The sequence is good if each partial sum a1+⋯+aia_1 + \cdots + a_i, for 1≤i≤m1 \le i \le m, is positive. Its cyclic shifts are the mm sequences aj,aj+1,…,am,a1,…,aj−1a_j, a_{j+1}, \dots, a_m, a_1, \dots, a_{j-1} for 1≤j≤m1 \le j \le m.

Example P2.7.46. The sequence 1,1,−11, 1, -1 has the partial sums 1,2,11, 2, 1, so it is good. Its cyclic shifts are 1,1,−11, 1, -1, then 1,−1,11, -1, 1 with the partial sums 1,0,11, 0, 1, and −1,1,1-1, 1, 1. Only the first shift is good, and the sum of the terms is 11.

Example P2.7.47. The sequence 1,0,1,−1,11, 0, 1, -1, 1 has the sum 22. Its shifts that start at a1a_1 and at a5a_5 are good: the shifts are 1,0,1,−1,11, 0, 1, -1, 1 and 1,1,0,1,−11, 1, 0, 1, -1, with the partial sums 1,1,2,1,21, 1, 2, 1, 2 and 1,2,2,3,21, 2, 2, 3, 2. The other three shifts start with 00, with 1,−11, -1 and with −1-1, so they are not good. So exactly 22 shifts are good, and 22 is the sum.

Lemma P2.7.48 (cycle lemma). Let a1,…,ama_1, \dots, a_m be integers with ai≤1a_i \le 1 for each ii and with the sum r=a1+⋯+am≥1r = a_1 + \cdots + a_m \ge 1. Then exactly rr of the mm cyclic shifts of the sequence are good.

Lean: not in Mathlib.

Proof. Extend the sequence to all integer indices by ai+m=aia_{i+m} = a_i, and let sis_i be the partial sums with s0=0s_0 = 0 and si−si−1=ais_i - s_{i-1} = a_i for every integer ii. Then si+m=si+rs_{i+m} = s_i + r. The shift that starts at ap+1a_{p+1} is good exactly when si>sps_i > s_p for p<i≤p+mp < i \le p + m. Since si+m=si+r>sis_{i+m} = s_i + r > s_i, this holds exactly when si>sps_i > s_p for every i>pi > p. Call such an index pp a low point.

For each integer vv let p(v)p(v) be the largest pp with sp≤vs_p \le v. It exists, because si→∞s_i \to \infty as i→∞i \to \infty and si→−∞s_i \to -\infty as i→−∞i \to -\infty. Each step ap+1a_{p+1} is at most 11 and sp(v)+1>vs_{p(v)+1} > v, so sp(v)≥vs_{p(v)} \ge v, and thus sp(v)=vs_{p(v)} = v. By the choice of p(v)p(v), every later partial sum exceeds vv, so p(v)p(v) is a low point. Conversely, a low point pp is p(sp)p(s_p). So v↦p(v)v \mapsto p(v) is a one to one map from the integers onto the low points. It is increasing: for v<wv < w, sp(v)=v≤ws_{p(v)} = v \le w gives p(v)≤p(w)p(v) \le p(w), and sp(w)=w≠vs_{p(w)} = w \ne v gives p(v)≠p(w)p(v) \ne p(w). It also satisfies p(v+r)=p(v)+mp(v + r) = p(v) + m, because sp+m=sp+rs_{p+m} = s_p + r.

Let v0v_0 be the smallest vv with p(v)≥0p(v) \ge 0. Then p(v0+r−1)=p(v0−1)+m<mp(v_0 + r - 1) = p(v_0 - 1) + m < m and p(v0+r)=p(v0)+m≥mp(v_0 + r) = p(v_0) + m \ge m. The map is increasing, so the low points in {0,1,…,m−1}\{0, 1, \dots, m-1\} are exactly p(v0),…,p(v0+r−1)p(v_0), \dots, p(v_0 + r - 1). These are rr low points, so rr shifts are good. □\square

Theorem P2.7.49 (count of good sequences). Let r≥1r \ge 1, u≥1u \ge 1 and n≥0n \ge 0 be integers. The number of good sequences of length r+unr + un that contain nn terms equal to 1−u1 - u and r+un−nr + un - n terms equal to 11 is An(r,−u)=rr+un(r+unn)A_n(r, -u) = \dfrac{r}{r + un}\dbinom{r + un}{n}.

Lean: not in Mathlib.

Proof. Let m=r+unm = r + un. The sum of every such sequence is (m−n)+n(1−u)=r(m - n) + n(1 - u) = r. There are (mn)\binom{m}{n} such sequences, one for each set of nn positions for the terms 1−u1 - u. Count the pairs (a,j)(a, j) in which aa is such a sequence and 1≤j≤m1 \le j \le m is a position where a good shift of aa starts. By the cycle lemma, each aa is in exactly rr pairs, so there are r(mn)r\binom{m}{n} pairs. Each pair gives the good sequence bb that is the shift of aa at jj. For a fixed good bb and a fixed jj there is exactly one aa whose shift at jj is bb, so each good bb comes from exactly mm pairs. So the number of good sequences is rm(mn)\frac{r}{m}\binom{m}{n}, and this is An(r,−u)A_n(r, -u) by the definition. □\square

Theorem P2.7.50 (convolution of A). For all real rr, ss and tt and every integer n≥0n \ge 0, ∑kAk(r,t) An−k(s,t)=An(r+s,t).\sum_k A_k(r, t)\, A_{n-k}(s, t) = A_n(r + s, t).

Lean: not in Mathlib.

Proof. Both sides are polynomials in rr, ss and tt. By the polynomial argument of Section 7.1 it is enough to prove the identity for integers r≥1r \ge 1, s≥1s \ge 1 and t=−ut = -u with u≥1u \ge 1. In that case the right side counts the good sequences with total r+sr + s and nn terms equal to 1−u1 - u. Let cc be such a sequence with the partial sums s0=0,s1,…,sMs_0 = 0, s_1, \dots, s_M. Every step up is exactly +1+1, and the walk starts at 0<s0 < s and ends at r+s>sr + s > s, so it takes the value ss at least once. Let pp be the last index with sp=ss_p = s. After pp the walk never takes the value ss again, and it ends above ss, so si>ss_i > s for i>pi > p. So the first pp terms form a good sequence with total ss, and the remaining terms form a good sequence with total rr. Conversely, put a good sequence with total ss in front of a good sequence with total rr; the result is good, its total is r+sr + s, and the last visit to the value ss is at the junction. So this split is a one to one correspondence. If the first part has kk terms equal to 1−u1 - u, the count of the previous theorem gives Ak(s,−u) An−k(r,−u)A_k(s, -u)\,A_{n-k}(r, -u) choices. The sum over kk is symmetric in rr and ss after the change k↦n−kk \mapsto n - k, and this proves the identity. □\square

Lemma P2.7.51 (from B to A). For every integer n≥1n \ge 1 and all real xx and tt, Bn(x,t)=An(x,t)−t Bn−1(x−t−1,t),B_n(x, t) = A_n(x, t) - t\,B_{n-1}(x - t - 1, t), and thus, for every n≥0n \ge 0, Bn(x,t)=∑j=0n(−t)jAn−j(x−j(t+1),t)B_n(x, t) = \sum_{j=0}^{n} (-t)^j A_{n-j}(x - j(t+1), t).

Lean: not in Mathlib.

Proof. Both sides of the first equation are polynomials in xx and tt, so it is enough to prove it when y=x−nty = x - nt is not zero. Then An(x,t)=xy(yn)A_n(x, t) = \frac{x}{y}\binom{y}{n} and Bn(x,t)−An(x,t)=(yn)(1−xy)=−t ny(yn)=−t(y−1n−1),B_n(x, t) - A_n(x, t) = \binom{y}{n}\Bigl(1 - \frac{x}{y}\Bigr) = -t\,\frac{n}{y}\binom{y}{n} = -t\binom{y-1}{n-1}, by absorption. Since (x−t−1)−(n−1)t=y−1(x - t - 1) - (n-1)t = y - 1, the last coefficient is Bn−1(x−t−1,t)B_{n-1}(x - t - 1, t). The second equation follows by induction on nn: for n=0n = 0 both sides are 11, and the first equation reduces the case nn to the case n−1n - 1 with x−t−1x - t - 1 in place of xx. □\square

Theorem P2.7.52 (convolution of A and B). For all real rr, ss and tt and every integer n≥0n \ge 0, ∑kAk(r,t) Bn−k(s,t)=Bn(r+s,t).\sum_k A_k(r, t)\, B_{n-k}(s, t) = B_n(r + s, t).

Lean: not in Mathlib.

Proof. Expand Bn−k(s,t)B_{n-k}(s, t) by the lemma, change the order of the two finite sums and use the convolution of AA: ∑kAk(r,t)∑j(−t)jAn−k−j(s−j(t+1),t)=∑j(−t)jAn−j(r+s−j(t+1),t).\sum_k A_k(r, t)\sum_j (-t)^j A_{n-k-j}(s - j(t+1), t) = \sum_j (-t)^j A_{n-j}(r + s - j(t+1), t). By the lemma again, the right side is Bn(r+s,t)B_n(r + s, t). □\square

With the definitions written out, this theorem is ∑k(r−tkk)(s−t(n−k)n−k)rr−tk=(r+s−tnn),\sum_k \binom{r - tk}{k}\binom{s - t(n-k)}{n-k}\frac{r}{r - tk} = \binom{r + s - tn}{n}, where the factor rr−tk\frac{r}{r - tk} means 11 for k=0k = 0 and the term means Ak(r,t)Bn−k(s,t)A_k(r, t)B_{n-k}(s, t) when r=tkr = tk.

Proof

The section has two kinds of proof. Abel's identity is proved with calculus on polynomials: the derivative in yy moves from nn to n−1n - 1, and one value of yy fixes the constant. The value y=−xy = -x is the one that makes each term a polynomial in kk of low degree times (nk)(−1)n−k\binom{n}{k}(-1)^{n-k}, so the result of Section 7.2 kills the sum.

The convolutions are proved with a count. The numbers An(r,−u)A_n(r, -u) count good sequences, by the cycle lemma, and a good sequence with total r+sr + s splits in one way at the last time its partial sums take the value ss. This proves the convolution of AA for positive integers, and the polynomial argument of Section 7.1 extends it to all real rr, ss and tt. The convolution of AA and BB then follows by algebra, because BnB_n is a sum of shifted copies of AA.

Examples

Example P2.7.53. The convolution of AA with r=s=1r = s = 1 and t=−2t = -2 gives ∑kCkCn−k=An(2,−2)=22n+2(2n+2n)=Cn+1\sum_k C_k C_{n-k} = A_n(2, -2) = \frac{2}{2n+2}\binom{2n+2}{n} = C_{n+1}, the recurrence of the Catalan numbers. For n=3n = 3: 1⋅5+1⋅2+2⋅1+5⋅1=141 \cdot 5 + 1 \cdot 2 + 2 \cdot 1 + 5 \cdot 1 = 14.

Example P2.7.54. The convolution of AA and BB with r=1r = 1, s=0s = 0 and t=−2t = -2 gives Bn−k(0,−2)=(2n−2kn−k)B_{n-k}(0, -2) = \binom{2n-2k}{n-k} and Bn(1,−2)=(2n+1n)B_n(1, -2) = \binom{2n+1}{n}. So ∑kCk(2n−2kn−k)=(2n+1n).\sum_k C_k\binom{2n-2k}{n-k} = \binom{2n+1}{n}. For n=2n = 2 the terms are 1⋅6+1⋅2+2⋅1=10=(52)1 \cdot 6 + 1 \cdot 2 + 2 \cdot 1 = 10 = \binom52.

Example P2.7.55. With r=1r = 1, s=0s = 0 and t=−3t = -3 the same theorem gives ∑k12k+1(3kk)(3n−3kn−k)=(3n+1n)\sum_k \frac{1}{2k+1}\binom{3k}{k}\binom{3n-3k}{n-k} = \binom{3n+1}{n}, because Ak(1,−3)=13k+1(3k+1k)=12k+1(3kk)A_k(1, -3) = \frac{1}{3k+1}\binom{3k+1}{k} = \frac{1}{2k+1}\binom{3k}{k}. For n=2n = 2: 1⋅15+1⋅3+3⋅1=21=(72)1 \cdot 15 + 1 \cdot 3 + 3 \cdot 1 = 21 = \binom72.

Example P2.7.56. Abel's identity with x=1x = 1, z=−1z = -1 and y=ny = n gives ∑k(nk)(k+1)k−1(n−k)n−k=(n+1)n\sum_k \binom{n}{k}(k+1)^{k-1}(n-k)^{n-k} = (n+1)^n. For n=2n = 2 the terms are 44, 22 and 33, and the sum is 9=329 = 3^2. For n=3n = 3 the terms are 2727, 1212, 99 and 1616, and the sum is 64=4364 = 4^3.

Example P2.7.57. The good sequences with r=1r = 1, u=2u = 2 and n=3n = 3 have length 77, three terms −1-1 and four terms 11. The count is A3(1,−2)=5A_3(1, -2) = 5, and each of the five sequences starts with 11. After the first term comes one of 1,1,1,−1,−1,−11,1,1,-1,-1,-1, then 1,1,−1,1,−1,−11,1,-1,1,-1,-1, then 1,1,−1,−1,1,−11,1,-1,-1,1,-1, then 1,−1,1,1,−1,−11,-1,1,1,-1,-1 and then 1,−1,1,−1,1,−11,-1,1,-1,1,-1.

Exercises

  1. [10] Write A3(x,1)A_3(x, 1) and A3(x,−1)A_3(x, -1) as products of linear factors, and compute A3(5,1)A_3(5, 1).
  2. [M15] Check Abel's identity for n=2n = 2 by an expansion of the three terms.
  3. [M18] List the good sequences with r=1r = 1, u=3u = 3 and n=2n = 2, and compare their number with A2(1,−3)A_2(1, -3).
  4. [M15] The sequence 3,−13, -1 has the sum 22. How many of its cyclic shifts are good? Which hypothesis of the cycle lemma fails?
  5. [M20] Put y=0y = 0 and z=1z = 1 in Abel's identity. Write the identity that results, and check it for n=3n = 3.
  6. [M20] Use the convolution of AA and BB to prove ∑kCk(2n−2k+1n−k)=(2n+2n)\sum_k C_k\binom{2n-2k+1}{n-k} = \binom{2n+2}{n}, and check it for n=2n = 2.
  7. [M20] Prove that An(0,t)=[n=0]A_n(0, t) = [n = 0], and deduce that ∑kAk(r,t)An−k(−r,t)=[n=0]\sum_k A_k(r, t)A_{n-k}(-r, t) = [n = 0] for all real rr and tt.
  8. [M22] A sequence of nn terms 11 and nn terms −1-1 is balanced if all its partial sums are nonnegative. Use the count of good sequences to prove that there are CnC_n balanced sequences.
  9. [M20] Let Tk=Ak(1,−3)T_k = A_k(1, -3). Use the convolution of AA to find a closed form for ∑kTkTn−k\sum_k T_k T_{n-k}, and check it for n=3n = 3.

Lean

No result of this section is in Mathlib. Mathlib has the Catalan numbers as catalan, with the recurrence catalan_succ and the closed form catalan_eq_centralBinom_div. So the first worked example is in Mathlib in this special form. The polynomials An(x,t)A_n(x, t) and Bn(x,t)B_n(x, t) can be stated with TAOCP.binom of TAOCP/Notation (tamnd/taocp-lean main) when x≠ntx \ne nt, but the polynomial form of the definition is better for a formal statement, because it has no exception. A formal proof of the convolution of AA needs the cycle lemma, a bijection on sequences and the polynomial argument, MvPolynomial.funext_set; none of these steps is in Mathlib in a ready form, and they are not yet stated in TAOCP/Notation.

Notes and history

Niels Henrik Abel published his identity in 1826, in a paper on series. The cycle lemma is due to Aryeh Dvoretzky and Theodore Motzkin (1947), and the same idea is in the ballot problem of Joseph Bertrand (1887). The polynomials An(x,t)A_n(x, t) appear in the work of Heinrich August Rothe (1793) and Hagen (1891). The proof here, with a count for positive integers and the polynomial argument for the rest, is a standard method of enumerative combinatorics.

TAOCP states Abel's identity as eq. 1.2.6(16), the convolution of AA and BB as eq. 1.2.6(26) and the convolution of AA as eq. 1.2.6(30); eqs. 1.2.6(27) to 1.2.6(29) are special cases with worked sums like those above. The term (k+1)k−1(k+1)^{k-1} in the fourth example counts the labeled trees on k+1k + 1 vertices, a fact of Section 2.3.4.4, and Abel's identity is the main tool for sums over trees and mappings in Volume 3. The generating function of An(x,t)A_n(x, t) is a power of the solution of the equation w=1+zw−tw = 1 + z w^{-t}, and P3 proves this with Lagrange inversion. GKP94 Section 5.4 calls these generating functions the generalized binomial series. TAOCP counts the binary trees with the Catalan numbers in Section 2.3.4.4.

Multinomials, partial sums and q-binomials

Statement

This section collects four extensions of the binomial coefficient. Multinomial coefficients count words with more than two kinds of letter. Partial sums of a row of Pascal's triangle have a closed form only in special cases, and the section proves two of them. The qq-binomial coefficients are polynomials in qq that become the binomial coefficients at q=1q = 1. Hypergeometric series are a common notation for almost all the sums of this chapter.

Definition P2.7.58 (multinomial coefficient). Let m≥1m \ge 1 and let k1,…,kmk_1, \dots, k_m be nonnegative integers with the sum n=k1+⋯+kmn = k_1 + \cdots + k_m. The multinomial coefficient is (nk1,k2,…,km)=n!k1! k2!⋯km!.\binom{n}{k_1, k_2, \dots, k_m} = \frac{n!}{k_1!\,k_2! \cdots k_m!}. For m=2m = 2 it is the binomial coefficient: (nk,n−k)=(nk)\binom{n}{k, n-k} = \binom{n}{k}.

Example P2.7.59. The word AABC has n=4n = 4 letters, with k1=2k_1 = 2 letters A, k2=1k_2 = 1 letter B and k3=1k_3 = 1 letter C. The multinomial coefficient is 4!2! 1! 1!=12\frac{4!}{2!\,1!\,1!} = 12, and the next theorem shows that it counts the words with these letters: AABC, AACB, ABAC, ABCA, ACAB, ACBA, BAAC, BACA, BCAA, CAAB, CABA and CBAA.

Example P2.7.60. The word BOOKKEEPER has 1010 letters: one B, two O, two K, three E, one P and one R. The number of words with the same letters is 10!2! 2! 3!=362880024=151200\frac{10!}{2!\,2!\,3!} = \frac{3628800}{24} = 151200.

Theorem P2.7.61 (words with given letters). Let k1,…,kmk_1, \dots, k_m be nonnegative integers with the sum nn. The number of words of length nn with kik_i letters equal to ii, for each ii, is (nk1,…,km)\binom{n}{k_1, \dots, k_m}.

Lean: Mathlib Nat.multinomial, with the defining equation Nat.multinomial_spec (proved in Mathlib).

Proof. Give the kik_i copies of the letter ii the distinct labels 1,…,ki1, \dots, k_i. Then the nn labeled letters are distinct, and there are n!n! ways to put them in a row (Section 6.1). Each word arises from exactly k1! k2!⋯km!k_1!\,k_2! \cdots k_m! rows, one for each way to order the labels of each letter among themselves. So the number of words is n!/(k1!⋯km!)n!/(k_1! \cdots k_m!). □\square

Theorem P2.7.62 (product form). Let k1,…,kmk_1, \dots, k_m be nonnegative integers and let sj=k1+⋯+kjs_j = k_1 + \cdots + k_j. Then (smk1,…,km)=(s2s1)(s3s2)⋯(smsm−1).\binom{s_m}{k_1, \dots, k_m} = \binom{s_2}{s_1}\binom{s_3}{s_2}\cdots\binom{s_m}{s_{m-1}}.

Lean: Mathlib Nat.multinomial_insert, and List.multinomial_cons for a list (proved in Mathlib).

Proof. Since 0≤sj−1≤sj0 \le s_{j-1} \le s_j, the factorial form gives (sjsj−1)=sj!sj−1! kj!\binom{s_j}{s_{j-1}} = \frac{s_j!}{s_{j-1}!\,k_j!}. In the product the factor sj!s_j! in the numerator of one term cancels with the factor sj!s_j! in the denominator of the next term. What remains is sm!s1! k2!⋯km!\frac{s_m!}{s_1!\,k_2! \cdots k_m!}, and s1=k1s_1 = k_1. □\square

Theorem P2.7.63 (multinomial theorem). For all real x1,…,xmx_1, \dots, x_m and every integer n≥0n \ge 0, (x1+⋯+xm)n=∑k1+⋯+km=nk1,…,km≥0(nk1,…,km)x1k1⋯xmkm.(x_1 + \cdots + x_m)^n = \sum_{\substack{k_1 + \cdots + k_m = n \\ k_1, \dots, k_m \ge 0}} \binom{n}{k_1, \dots, k_m} x_1^{k_1} \cdots x_m^{k_m}.

Lean: Mathlib Finset.sum_pow_eq_sum_piAntidiag (proved in Mathlib).

Proof. The left side is a product of nn factors x1+⋯+xmx_1 + \cdots + x_m. When the product is expanded, each term picks one xijx_{i_j} from factor jj, for j=1,…,nj = 1, \dots, n. So the terms are in one to one correspondence with the words i1i2⋯ini_1 i_2 \cdots i_n over the letters 1,…,m1, \dots, m. A word with kik_i letters ii gives the term x1k1⋯xmkmx_1^{k_1} \cdots x_m^{k_m}. By the theorem on words, there are (nk1,…,km)\binom{n}{k_1, \dots, k_m} such words. □\square

Theorem P2.7.64 (alternating partial sum). For every integer n≥0n \ge 0, ∑k≤n(−2k)=(−1)n⌈n+12⌉\sum_{k \le n}\binom{-2}{k} = (-1)^n\left\lceil \frac{n+1}{2}\right\rceil.

Lean: not in Mathlib.

Proof. Negation of the upper index gives (−2k)=(−1)k(k+1k)=(−1)k(k+1)\binom{-2}{k} = (-1)^k\binom{k+1}{k} = (-1)^k(k+1) for k≥0k \ge 0, and the terms with k<0k < 0 are zero. So the sum is 1−2+3−4+⋯+(−1)n(n+1)1 - 2 + 3 - 4 + \cdots + (-1)^n(n+1). For odd n=2j+1n = 2j + 1, group the terms in j+1j + 1 pairs (2i−1)−2i=−1(2i - 1) - 2i = -1; the sum is −(j+1)=−n+12-(j + 1) = -\frac{n+1}{2}. For even n=2jn = 2j, the sum is the sum for 2j−12j - 1, which is −j-j, plus 2j+12j + 1, so it is j+1=⌈2j+12⌉j + 1 = \left\lceil\frac{2j+1}{2}\right\rceil. In both cases this is the right side. □\square

Theorem P2.7.65 (a partial sum with a linear factor). For every real mm and every integer nn, ∑k≤n(mk)(k−m2)=−m2(m−1n).\sum_{k \le n}\binom{m}{k}\Bigl(k - \frac{m}{2}\Bigr) = -\frac{m}{2}\binom{m-1}{n}.

Lean: not in Mathlib.

Proof. For n<0n < 0 both sides are zero. Absorption gives k(mk)=m(m−1k−1)k\binom{m}{k} = m\binom{m-1}{k-1}, and the addition formula gives (mk)=(m−1k)+(m−1k−1)\binom{m}{k} = \binom{m-1}{k} + \binom{m-1}{k-1}, for every integer kk. So (mk)(k−m2)=m(m−1k−1)−m2(m−1k)−m2(m−1k−1)=m2((m−1k−1)−(m−1k)).\binom{m}{k}\Bigl(k - \frac{m}{2}\Bigr) = m\binom{m-1}{k-1} - \frac{m}{2}\binom{m-1}{k} - \frac{m}{2}\binom{m-1}{k-1} = \frac{m}{2}\left(\binom{m-1}{k-1} - \binom{m-1}{k}\right). The sum over 0≤k≤n0 \le k \le n telescopes to m2((m−1−1)−(m−1n))=−m2(m−1n)\frac{m}{2}\left(\binom{m-1}{-1} - \binom{m-1}{n}\right) = -\frac{m}{2}\binom{m-1}{n}. □\square

Corollary P2.7.66 (half of an odd row). For every integer n≥0n \ge 0, ∑k=0n(2n+1k)=4n\sum_{k=0}^{n}\binom{2n+1}{k} = 4^n.

Lean: Mathlib Nat.sum_range_choose_halfway (proved in Mathlib).

Proof. By symmetry, (2n+1k)=(2n+12n+1−k)\binom{2n+1}{k} = \binom{2n+1}{2n+1-k}, and k↦2n+1−kk \mapsto 2n + 1 - k maps {0,…,n}\{0, \dots, n\} onto {n+1,…,2n+1}\{n+1, \dots, 2n+1\}. So the two halves of the row have the same sum. The full row has the sum 22n+12^{2n+1}, so each half has the sum 22n=4n2^{2n} = 4^n. □\square

Remark P2.7.67 (partial sums in general). For general mm and nn the partial sum ∑k≤n(mk)\sum_{k \le n}\binom{m}{k} has no closed form of the kind of this chapter. The two theorems above work because a linear factor, or the special upper index −2-2, makes the terms telescope or pair up. GKP94 Section 5.7 gives an algorithm that decides whether a partial sum of this kind telescopes.

Definition P2.7.68 (q-binomial coefficient). Let n≥0n \ge 0 and kk be integers. For 0≤k≤n0 \le k \le n the qq-binomial coefficient is the rational function of qq (nk)q=(1−qn)(1−qn−1)⋯(1−qn−k+1)(1−q)(1−q2)⋯(1−qk),\binom{n}{k}_q = \frac{(1 - q^n)(1 - q^{n-1})\cdots(1 - q^{n-k+1})}{(1 - q)(1 - q^2)\cdots(1 - q^k)}, and (nk)q=0\binom{n}{k}_q = 0 for k<0k < 0 and for k>nk > n. In particular (n0)q=(nn)q=1\binom{n}{0}_q = \binom{n}{n}_q = 1.

Example P2.7.69. For k=1k = 1 the definition gives (n1)q=1−qn1−q=1+q+⋯+qn−1\binom{n}{1}_q = \frac{1 - q^n}{1 - q} = 1 + q + \cdots + q^{n-1}. Its value at q=1q = 1 is n=(n1)n = \binom{n}{1}.

Example P2.7.70. For n=4n = 4 and k=2k = 2 the definition gives (42)q=(1−q4)(1−q3)(1−q)(1−q2)=(1+q2)(1+q+q2)=1+q+2q2+q3+q4.\binom{4}{2}_q = \frac{(1 - q^4)(1 - q^3)}{(1 - q)(1 - q^2)} = (1 + q^2)(1 + q + q^2) = 1 + q + 2q^2 + q^3 + q^4. The sum of the coefficients is 6=(42)6 = \binom42, and the coefficients read the same in both directions.

Theorem P2.7.71 (q-Pascal rules). For every integer n≥1n \ge 1 and every integer kk, (nk)q=(n−1k−1)q+qk(n−1k)q=qn−k(n−1k−1)q+(n−1k)q.\binom{n}{k}_q = \binom{n-1}{k-1}_q + q^k\binom{n-1}{k}_q = q^{n-k}\binom{n-1}{k-1}_q + \binom{n-1}{k}_q. So each (nk)q\binom{n}{k}_q is a polynomial in qq with nonnegative integer coefficients, and its value at q=1q = 1 is (nk)\binom{n}{k}.

Lean: not in Mathlib; Mathlib lists the qq-binomials as future work in RingTheory/Polynomial/Pochhammer.

Proof. If k<0k < 0 or k>nk > n all terms are zero. If k=0k = 0 or k=nk = n one term on each side is 11 and the other terms are zero, since q0=1q^0 = 1. Let 1≤k≤n−11 \le k \le n - 1. The definition gives (n−1k)q=(n−1k−1)q⋅1−qn−k1−qk\binom{n-1}{k}_q = \binom{n-1}{k-1}_q \cdot \frac{1 - q^{n-k}}{1 - q^k} and (nk)q=(n−1k−1)q⋅1−qn1−qk\binom{n}{k}_q = \binom{n-1}{k-1}_q \cdot \frac{1 - q^n}{1 - q^k}. So (nk)q−(n−1k−1)q=(n−1k−1)q qk−qn1−qk=qk(n−1k−1)q 1−qn−k1−qk=qk(n−1k)q.\binom{n}{k}_q - \binom{n-1}{k-1}_q = \binom{n-1}{k-1}_q\,\frac{q^k - q^n}{1 - q^k} = q^k\binom{n-1}{k-1}_q\,\frac{1 - q^{n-k}}{1 - q^k} = q^k\binom{n-1}{k}_q. The second rule follows in the same way. The definition gives (nk)q=(n−1k)q 1−qn1−qn−k\binom{n}{k}_q = \binom{n-1}{k}_q\,\frac{1 - q^n}{1 - q^{n-k}} and (n−1k−1)q=(n−1k)q 1−qk1−qn−k\binom{n-1}{k-1}_q = \binom{n-1}{k}_q\,\frac{1 - q^k}{1 - q^{n-k}}, so (nk)q−(n−1k)q=(n−1k)q qn−k(1−qk)1−qn−k=qn−k(n−1k−1)q\binom{n}{k}_q - \binom{n-1}{k}_q = \binom{n-1}{k}_q\,\frac{q^{n-k}(1 - q^k)}{1 - q^{n-k}} = q^{n-k}\binom{n-1}{k-1}_q. The rules build each (nk)q\binom{n}{k}_q from the row n−1n - 1 with sums and products by powers of qq, so induction on nn gives a polynomial with nonnegative integer coefficients. At q=1q = 1 the rules become the addition formula, and induction gives the value (nk)\binom{n}{k}. □\square

Theorem P2.7.72 (q-binomials count subset sums). Let 0≤k≤n0 \le k \le n. The coefficient of qjq^j in (nk)q\binom{n}{k}_q is the number of kk-element subsets of {1,…,n}\{1, \dots, n\} whose elements have the sum j+(k+12)j + \binom{k+1}{2}.

Lean: not in Mathlib.

Proof. For a kk-element subset SS let w(S)=∑s∈Ss−(k+12)w(S) = \sum_{s \in S} s - \binom{k+1}{2}, and let Pn,k(q)=∑Sqw(S)P_{n,k}(q) = \sum_S q^{w(S)} over the kk-element subsets of {1,…,n}\{1, \dots, n\}. The claim is Pn,k=(nk)qP_{n,k} = \binom{n}{k}_q. For k=0k = 0 or k=nk = n there is one subset, with w=0w = 0, so P=1P = 1. Let 1≤k≤n−11 \le k \le n - 1. A subset that does not contain nn is a subset of {1,…,n−1}\{1, \dots, n-1\}. A subset that contains nn is S′∪{n}S' \cup \{n\} for a (k−1)(k-1)-element subset S′S' of {1,…,n−1}\{1, \dots, n-1\}, and w(S′∪{n})=w(S′)+(k2)+n−(k+12)=w(S′)+n−kw(S' \cup \{n\}) = w(S') + \binom{k}{2} + n - \binom{k+1}{2} = w(S') + n - k. So Pn,k=Pn−1,k+qn−kPn−1,k−1P_{n,k} = P_{n-1,k} + q^{n-k}P_{n-1,k-1}. This is the second qq-Pascal rule, so induction on nn gives Pn,k=(nk)qP_{n,k} = \binom{n}{k}_q. □\square

Theorem P2.7.73 (q-binomial theorem). For every integer n≥0n \ge 0 and all real qq and xx, ∏j=0n−1(1+qjx)=∑k(nk)q q(k2) xk.\prod_{j=0}^{n-1}(1 + q^j x) = \sum_k \binom{n}{k}_q\, q^{\binom{k}{2}}\, x^k.

Lean: not in Mathlib.

Proof. Induction on nn. For n=0n = 0 both sides are 11. Assume the identity for nn and multiply both sides by 1+qnx1 + q^n x. The coefficient of xkx^k on the right becomes (nk)qq(k2)+qn(nk−1)qq(k−12)\binom{n}{k}_q q^{\binom{k}{2}} + q^n\binom{n}{k-1}_q q^{\binom{k-1}{2}}. Since (k−12)=(k2)−(k−1)\binom{k-1}{2} = \binom{k}{2} - (k - 1), this is q(k2)((nk)q+qn+1−k(nk−1)q)q^{\binom{k}{2}}\left(\binom{n}{k}_q + q^{n+1-k}\binom{n}{k-1}_q\right), and the second qq-Pascal rule for n+1n + 1 makes it q(k2)(n+1k)qq^{\binom{k}{2}}\binom{n+1}{k}_q. □\square

Definition P2.7.74 (hypergeometric series). Let aa, bb, cc and zz be real, and let cc be such that ck‾≠0c^{\overline{k}} \ne 0 for the values of kk that occur. The hypergeometric series is F(a,b;c;z)=∑k≥0ak‾ bk‾ck‾ zkk!,F(a, b; c; z) = \sum_{k \ge 0}\frac{a^{\overline{k}}\, b^{\overline{k}}}{c^{\overline{k}}}\,\frac{z^k}{k!}, with the rising powers xk‾=x(x+1)⋯(x+k−1)x^{\overline{k}} = x(x+1)\cdots(x+k-1) of Chapter 3. If a=−na = -n for an integer n≥0n \ge 0, then ak‾=0a^{\overline{k}} = 0 for k>nk > n, the series is a finite sum, and only cn‾≠0c^{\overline{n}} \ne 0 is needed. Otherwise the series is infinite, and P5 treats its convergence.

Example P2.7.75. Since 1k‾=k!1^{\overline{k}} = k!, the definition gives F(1,1;1;z)=∑k≥0zkF(1, 1; 1; z) = \sum_{k \ge 0} z^k, the geometric series, which converges to 11−z\frac{1}{1 - z} for ∣z∣<1|z| < 1.

Example P2.7.76. For an integer n≥0n \ge 0, (−n)k‾=(−1)knk‾(-n)^{\overline{k}} = (-1)^k n^{\underline{k}}, so (−n)k‾k!=(−1)k(nk)\frac{(-n)^{\overline{k}}}{k!} = (-1)^k\binom{n}{k}. With b=cb = c this gives F(−n,b;b;−z)=∑k(nk)zk=(1+z)nF(-n, b; b; -z) = \sum_k \binom{n}{k}z^k = (1 + z)^n, the binomial theorem.

Theorem P2.7.77 (Vandermonde in hypergeometric form). Let n≥0n \ge 0 be an integer, and let bb and cc be real with cn‾≠0c^{\overline{n}} \ne 0. Then F(−n,b;c;1)=(c−b)n‾cn‾.F(-n, b; c; 1) = \frac{(c - b)^{\overline{n}}}{c^{\overline{n}}}.

Lean: not in Mathlib.

Proof. The term kk of the left side is (−1)knk‾ bk‾/(ck‾ k!)(-1)^k n^{\underline{k}}\, b^{\overline{k}}/(c^{\overline{k}}\, k!), because (−n)k‾=(−1)knk‾(-n)^{\overline{k}} = (-1)^k n^{\underline{k}}. Multiply it by cn‾/n!c^{\overline{n}}/n!. Since cn‾=ck‾(c+k)n−k‾c^{\overline{n}} = c^{\overline{k}}(c + k)^{\overline{n-k}} and nk‾/n!=1/(n−k)!n^{\underline{k}}/n! = 1/(n-k)!, the result is (−1)kbk‾k!⋅(c+k)n−k‾(n−k)!=(−bk)(c+n−1n−k).(-1)^k\frac{b^{\overline{k}}}{k!}\cdot\frac{(c + k)^{\overline{n-k}}}{(n-k)!} = \binom{-b}{k}\binom{c + n - 1}{n - k}. Here both factors come from the rule xj‾/j!=(x+j−1j)x^{\overline{j}}/j! = \binom{x + j - 1}{j} and the negation of the upper index, (−1)k(b+k−1k)=(−bk)(-1)^k\binom{b + k - 1}{k} = \binom{-b}{k}. Vandermonde's convolution gives ∑k(−bk)(c+n−1n−k)=(c−b+n−1n)=(c−b)n‾/n!\sum_k \binom{-b}{k}\binom{c+n-1}{n-k} = \binom{c - b + n - 1}{n} = (c - b)^{\overline{n}}/n!. Divide by cn‾/n!c^{\overline{n}}/n!. □\square

Proof

The four topics of the section need four kinds of argument. The multinomial coefficient is proved by a count with labels, and its product form by the factorial form and cancellation. The two partial sums are proved by telescoping and by pairs of terms; a sum of a row with no such structure does not have a closed form. The qq-binomials are proved by the qq-Pascal rules, which turn every question into an induction on nn. The subset sums show what the coefficients count. The hypergeometric form of Vandermonde's convolution needs only the translation between rising powers and binomial coefficients.

Examples

Example P2.7.78. The coefficient of x2y3z4x^2y^3z^4 in (x+y+z)9(x + y + z)^9 is (92,3,4)=9!2! 3! 4!=1260\binom{9}{2, 3, 4} = \frac{9!}{2!\,3!\,4!} = 1260. The product form gives the same number as (52)(95)=10⋅126\binom{5}{2}\binom{9}{5} = 10 \cdot 126.

Example P2.7.79. The theorem with a linear factor, for m=4m = 4 and n=1n = 1, reads (40)(0−2)+(41)(1−2)=−2(31)\binom40(0 - 2) + \binom41(1 - 2) = -2\binom31, that is, −2−4=−6-2 - 4 = -6. For m=−1m = -1 it gives ∑k≤n(−1)k(k+12)=12(−2n)=12(−1)n(n+1)\sum_{k \le n}(-1)^k\left(k + \frac12\right) = \frac12\binom{-2}{n} = \frac12(-1)^n(n+1).

Example P2.7.80. The 33-element subsets of {1,…,5}\{1, \dots, 5\} have the sums 6,7,8,8,9,9,10,10,11,126, 7, 8, 8, 9, 9, 10, 10, 11, 12. After the shift by (42)=6\binom42 = 6 they give the polynomial 1+q+2q2+2q3+2q4+q5+q6=(53)q1 + q + 2q^2 + 2q^3 + 2q^4 + q^5 + q^6 = \binom{5}{3}_q, and this is also (52)q\binom52_q. The reason is that the definition is the quotient of (1−q)(1−q2)⋯(1−qn)(1-q)(1-q^2)\cdots(1-q^n) by the two products for kk and for n−kn - k, and this form is symmetric in kk and n−kn - k.

Example P2.7.81. The qq-binomial theorem for n=2n = 2 reads (1+x)(1+qx)=1+(1+q)x+qx2(1 + x)(1 + qx) = 1 + (1 + q)x + q x^2, with (21)q=1+q\binom21_q = 1 + q and q(22)=qq^{\binom22} = q.

Example P2.7.82. The theorem on hypergeometric series with n=2n = 2, b=12b = \frac12 and c=32c = \frac32 gives the three terms 11, (−2)(1/2)3/2=−23\frac{(-2)(1/2)}{3/2} = -\frac23 and (−2)(−1)(1/2)(3/2)(3/2)(5/2)⋅2!=15\frac{(-2)(-1)(1/2)(3/2)}{(3/2)(5/2) \cdot 2!} = \frac15 on the left side, with the sum 815\frac{8}{15}, and 12‾(3/2)2‾=215/4=815\frac{1^{\overline{2}}}{(3/2)^{\overline{2}}} = \frac{2}{15/4} = \frac{8}{15} for the right side.

Exercises

  1. [10] How many words can be formed with all the letters of COMMITTEE?
  2. [M15] Find the coefficient of x2y3z4x^2y^3z^4 in (2x−y+z)9(2x - y + z)^9.
  3. [M15] Prove that the sum of (nk1,…,km)\binom{n}{k_1, \dots, k_m} over all k1+⋯+km=nk_1 + \cdots + k_m = n is mnm^n.
  4. [M20] Prove that (nk1,…,km)=∑i(n−1k1,…,ki−1,…,km)\binom{n}{k_1, \dots, k_m} = \sum_i \binom{n-1}{k_1, \dots, k_i - 1, \dots, k_m} for n≥1n \ge 1, where the sum is over the ii with ki≥1k_i \ge 1.
  5. [M20] Prove that ∑k≤n(−3k)=(−1)n⌊(n+2)24⌋\sum_{k \le n}\binom{-3}{k} = (-1)^n\left\lfloor\frac{(n+2)^2}{4}\right\rfloor for every integer n≥0n \ge 0.
  6. [M20] Use the theorem with a linear factor and the corollary on half of an odd row to find ∑k=0nk(2n+1k)\sum_{k=0}^{n} k\binom{2n+1}{k} in closed form.
  7. [M15] Compute (52)q\binom52_q from a qq-Pascal rule, and check its value at q=1q = 1.
  8. [M20] Prove that qk(n−k)(nk)1/q=(nk)qq^{k(n-k)}\binom{n}{k}_{1/q} = \binom{n}{k}_q for 0≤k≤n0 \le k \le n, so the coefficients of (nk)q\binom{n}{k}_q read the same in both directions. Use the subsets of {1,…,n}\{1, \dots, n\} and the map s↦n+1−ss \mapsto n + 1 - s.
  9. [M22] Prove that F(−n,−n;1;1)=(2nn)F(-n, -n; 1; 1) = \binom{2n}{n} in two ways: by the theorem of this section, and by the sum of the squares of a row from Section 7.1.

Lean

Mathlib defines Nat.multinomial s f for a finite set s and a function f to the natural numbers, with the defining property Nat.multinomial_spec: the product of the factorials times the coefficient is the factorial of the sum. The product form is the step Nat.multinomial_insert, which adds one part, and List.multinomial_cons is the same for a list of parts. The multinomial theorem is Finset.sum_pow_eq_sum_piAntidiag, with the sum over the functions in Finset.piAntidiag; Finset.sum_pow is the same theorem with the sum over multisets. The half row is Nat.sum_range_choose_halfway.

Mathlib defines the hypergeometric series as ordinaryHypergeometric, but the value F(−n,b;c;1)F(-n, b; c; 1) is not in Mathlib. The qq-binomial coefficients and the partial sums with a negative upper index are not in Mathlib. A statement of the partial sums uses TAOCP.binom of TAOCP/Notation (tamnd/taocp-lean main), because the upper index is negative or real; these statements are not yet in TAOCP/Notation.

Notes and history

Leibniz found the multinomial theorem near the end of the seventeenth century, and Abraham de Moivre published a proof in 1697. The qq-binomial coefficients are due to Gauss (1808), who used them to evaluate quadratic Gauss sums, and they are also called Gaussian polynomials. The coefficient of qjq^j in (nk)q\binom{n}{k}_q also counts the words with kk letters 11 and n−kn - k letters 00 that have exactly jj inversions, that is, jj pairs of a 11 before a 00; Volume 3 uses this fact for the inversions of permutations of a multiset. Gauss studied the hypergeometric series in a long paper of 1812, and the theorem on F(−n,b;c;1)F(-n, b; c; 1) is the finite case of his evaluation of F(a,b;c;1)F(a, b; c; 1). GKP94 Sections 5.5 and 5.6 show that almost every identity of this chapter is a hypergeometric identity, and P3 continues that point of view.

TAOCP states the partial sums as eqs. 1.2.6(36) to 1.2.6(38), the hypergeometric series as eq. 1.2.6(39), the qq-binomials as eq. 1.2.6(40) and the multinomial coefficients as eqs. 1.2.6(41) to 1.2.6(43). This section ends the chapter. The table shows where the equations of TAOCP 1.2 that the outline gives to this chapter appear.

TAOCP 1.2 Result of P2
1.2.6(16) Theorem P2.7.44 (Abel's identity)
1.2.6(21) Theorem P2.7.5 (Vandermonde's convolution)
1.2.6(22) Corollary P2.7.7 (indices running together)
1.2.6(23) Corollary P2.7.8 (negated form)
1.2.6(24) Corollary P2.7.9 (a sum with two limits)
1.2.6(25) Corollary P2.7.10 (upper indices running)
1.2.6(26) Theorem P2.7.52 (convolution of A and B)
1.2.6(27) to 1.2.6(29) Examples P2.7.53 to P2.7.55
1.2.6(30) Theorem P2.7.50 (convolution of A)
1.2.6(31), 1.2.6(32) Corollary P2.7.34 (factorials in falling powers)
1.2.6(33) Theorem P2.7.18 (orthogonality)
1.2.6(34) Theorem P2.7.28 (difference of a polynomial)
1.2.6(35) Corollary P2.7.29 (a sum with a free step)
1.2.6(36) Remark P2.7.67 (partial sums in general)
1.2.6(37) Theorem P2.7.64 (alternating partial sum)
1.2.6(38) Theorem P2.7.65 (a partial sum with a linear factor)
1.2.6(39) Definition P2.7.74 (hypergeometric series), Theorem P2.7.77 (Vandermonde in hypergeometric form)
1.2.6(40) Definition P2.7.68 (q-binomial coefficient), Theorem P2.7.71 (q-Pascal rules)
1.2.6(41) Definition P2.7.58 (multinomial coefficient)
1.2.6(42) Theorem P2.7.63 (multinomial theorem)
1.2.6(43) Theorem P2.7.62 (product form)

Chapter 6 defined the binomial coefficient (rk)\binom{r}{k} for a real upper index rr and an integer lower index kk, and it proved the rules that act on one coefficient at a time: the factorial form, symmetry, absorption, the addition formula, negation of the upper index, trinomial revision and the binomial theorem. This chapter is about sums of products of binomial coefficients. A sum of this kind has a closed form much more often than a first look suggests, and the reason is almost always one of a small number of identities. The chapter proves these identities, shows how to recognize them in disguise, and shows where they stop.

Section 7.1 proves Vandermonde's convolution ∑k(rk)(sn−k)=(r+sn)\sum_k \binom{r}{k}\binom{s}{n-k} = \binom{r+s}{n} and its four relatives with shifted indices, a negated sign and running upper indices. It also proves the polynomial argument in several variables, the tool that lifts an identity from the nonnegative integers to all real numbers. Section 7.2 proves the orthogonality relation for binomial coefficients and its consequence, binomial inversion. The same section shows that the rrth difference of a polynomial of degree rr is constant, and it counts the derangements. Section 7.3 proves Abel's binomial theorem and the convolution formulas for the polynomials An(x,t)A_n(x, t), which contain Vandermonde's convolution as the case t=0t = 0. The proof there is a counting proof with the cycle lemma. Section 7.4 is about multinomial coefficients, partial sums of a row of Pascal's triangle, qq-binomial coefficients and hypergeometric series.

TAOCP uses these results from Section 1.2.6 on. Equations 1.2.6(21) to 1.2.6(43) are the subject of this chapter, and the table at the end of Section 7.4 maps each of them to its item here. Section 1.2.9 meets the same identities again as products of generating functions, and Volume 4A uses the multinomial coefficients and the qq-binomials for the analysis of combinatorial algorithms. The volume P3 of the handbook proves the generating function forms, and it proves Lagrange inversion, which is the analytic side of Section 7.3.

The chapter assumes P1 (induction, sets and functions) and the earlier chapters of P2. Chapter 1 gives the laws for sums, the change of the index and Iverson's bracket. Chapter 3 gives the falling powers xk‾=x(x−1)⋯(x−k+1)x^{\underline{k}} = x(x-1)\cdots(x-k+1), the difference operator Δf(x)=f(x+1)−f(x)\Delta f(x) = f(x+1) - f(x) and the rule Δxk‾=kxk−1‾\Delta x^{\underline{k}} = k x^{\underline{k-1}}. Chapter 6 gives the rules for one binomial coefficient named above. A reference such as "Section 6.3" points to the place where a rule is proved.

The source of this page. Something is wrong? Report it.