taocp

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

Volume C1 · Basic concepts · TAOCP Section 1.2.6

Binomial coefficients

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.

Read it next to Section 1.2.6 of the book. The nodes and the exercises of the section.

Contents
  1. The coefficients and their identities
  2. Inversion, generalizations and Stirling numbers

The coefficients and their identities

Overview

Section 1.2.6 of TAOCP starts from a count: how many ways are there to choose kk objects out of nn, when the order of the chosen objects does not matter. The answer is the binomial coefficient (nk)\binom{n}{k}, and the section turns it into a tool. It extends the coefficient to every real upper index rr, so that (rk)\binom{r}{k} is a polynomial in rr of degree kk. It lists the basic operations on the coefficients, in the order of the letters A to I of the book: the factorial form, the symmetry, the moving of a factor in and out of the coefficient, the addition formula, the sums along a row, a column and a diagonal of Pascal's triangle, the binomial theorem, the negation of the upper index, the products of two coefficients and the sums of such products. Five worked problems then show how the operations combine. This first file of the chapter covers eqs. (1) to (30), that is, the definitions, the basic operations, Vandermonde's convolution and its relatives, Rothe's convolution (26), and the model problems that lead to eqs. (27) to (30). The second file covers the inversion method, the partial sums, the generalizations and the Stirling numbers. The section uses the factorial and the falling power of Section 1.2.5, the sums of Section 1.2.3 and induction from Section 1.2.1.

The ideas

Counting by overcounting. The number of ordered choices of kk objects is the falling power n(n−1)⋯(n−k+1)n(n-1)\cdots(n-k+1) of Section 1.2.5. Each unordered choice appears in exactly k!k! of the ordered ones, so the number of unordered choices is the quotient of the two. The same idea, to count a larger set and divide by a known multiplicity, is behind many of the identities below.

A formula that is a polynomial can be stretched. For a fixed integer k≥0k \ge 0 the coefficient (rk)\binom{r}{k} is a polynomial in rr. If two polynomials of degree at most dd agree for d+1d+1 values of the variable, they are the same polynomial. So an identity that is shown for all positive integers rr holds for all real rr, as long as both sides are polynomials in rr for fixed integer indices. This is the way the book gets from combinatorial counting, where rr is a natural number, to real rr, and C1 uses it at each such step.

Two ways to split a sum, and one way to split a product. The addition formula (9) splits a coefficient into two. The convolution (21) splits a coefficient (r+sn)\binom{r+s}{n} of a sum of upper indices into a sum of products. The product rule (20) moves an index that appears twice to a single place. Almost every identity of the section is a chain of these three steps, with the symmetry (6) and the negation (17) to turn an upper index into a lower one or the reverse.

Sums over a diagonal and over a column come from the addition formula alone. Apply (9) again and again and the terms telescope. This gives (10) and (11) and, with the negation (17), (18).

A hard sum is made harder on purpose. In the third model problem the sum has no direct reduction, so the book replaces a coefficient by a sum of simpler ones, swaps the order of the double sum, and applies a known result inside. C1 shows where each condition on the indices is needed.

C1 differs from the book in a few places. It proves the binomial series (15) for real rr by a differential equation, and it proves Abel's formula (16) by one calculation that combines the book's two steps of exercises 50 and 51. It proves Rothe's convolution (26) by an induction on nn that needs one value of ss, where the book leaves the argument to exercises 22 to 24. It proves (23) by finite differences and (24) with power series. It uses the forms of the section with the restrictions that the book lists, and it says which restriction each proof uses.

Definitions, results and proofs

Example (the ten choices of three letters from five, TAOCP eq. 1.2.6(1)). The combinations of the five letters a,b,c,d,ea, b, c, d, e taken three at a time are abc,abd,abe,acd,ace,ade,bcd,bce,bde,cdeabc, abd, abe, acd, ace, ade, bcd, bce, bde, cde.

Node: TAA0HS0JNT · status: not stated yet

Explanation. A combination is a choice of letters in which the order is not recorded, so abcabc and cabcab are the same combination. The ten rows are listed in the order of the alphabet, by the first letter, then the second, then the third. The first letter is aa in six rows, bb in three rows and cc in one row, and 6+3+1=106 + 3 + 1 = 10. The same list in Lean is the finset of the subsets of size 33 of a five-element type, Finset.powersetCard 3 s, from Mathlib.

Example. The Python call list(itertools.combinations('abcde', 3)) returns these ten rows in this order, and math.comb(5, 3) gives 1010. The rows that contain the letter ee are abe,ace,ade,bce,bde,cdeabe, ace, ade, bce, bde, cde, six rows, and the rows without ee are the four combinations of a,b,c,da, b, c, d taken three at a time, as the later formula (9) predicts: (53)=(43)+(42)=4+6\binom{5}{3} = \binom{4}{3} + \binom{4}{2} = 4 + 6.

Proof. The list is complete and has no repeat. A combination of three of the five letters, written in the order of the alphabet, is a word xyzxyz with x<y<zx < y < z. Each such word is in the list once, since the list runs through the words in lexicographic order. There are (53)\binom{5}{3} of them, and the count by the first letter is (42)+(32)+(22)=6+3+1=10\binom{4}{2} + \binom{3}{2} + \binom{2}{2} = 6 + 3 + 1 = 10. □\square

Theorem (the number of kk-combinations, TAOCP eq. 1.2.6(2)). For integers n≥k≥0n \ge k \ge 0, the number of kk-element subsets of an nn-element set is (nk)=n(n−1)⋯(n−k+1)k(k−1)⋯1.\binom{n}{k} = \frac{n(n-1)\cdots(n-k+1)}{k(k-1)\cdots 1}.

Node: TAGVB6EYV8 · status: proved

Explanation. The book introduces the symbol (nk)\binom{n}{k} by this count, and then it takes the quotient of products as the formula to extend. The numerator is the falling power nk‾n^{\underline{k}} of eq. 1.2.5(2), the number of kk-permutations of the nn objects. The denominator is k!k!. In Lean the number of subsets of size kk of a finset ss is Finset.card_powersetCard, and its value is Nat.choose s.card k, both from Mathlib. The symbol Nat.choose n k is defined by the addition formula (9), and the quotient form is Nat.choose_eq_descFactorial_div_factorial.

Example. For n=6n = 6 and k=4k = 4 the quotient is 6⋅5⋅4⋅34⋅3⋅2⋅1=36024=15\frac{6 \cdot 5 \cdot 4 \cdot 3}{4 \cdot 3 \cdot 2 \cdot 1} = \frac{360}{24} = 15, and math.comb(6, 4) gives 1515. In the list of the four-letter words of the alphabet aa to ff in increasing order, abcdabcd is the first and cdefcdef is the last, and there are 1515 rows in all.

Proof. Let cc be the number of kk-element subsets. Count the kk-permutations of the nn objects, the ordered rows of kk different objects, in two ways. By eq. 1.2.5(2) there are n(n−1)⋯(n−k+1)n(n-1)\cdots(n-k+1) of them. On the other hand, a kk-permutation is made by choosing the set of its kk objects, in cc ways, and then ordering this set, in k!k! ways by eq. 1.2.5(2) with n=kn = k. Different choices of the set or of the order give different rows, so there are c⋅k!c \cdot k! rows. Then c⋅k!=n(n−1)⋯(n−k+1)c \cdot k! = n(n-1)\cdots(n-k+1), and division by k!=k(k−1)⋯1k! = k(k-1)\cdots 1 gives the formula. □\square

Definition (the binomial coefficient for a real upper index, TAOCP eq. 1.2.6(3)). For every real number rr and every integer kk, (rk)=r(r−1)⋯(r−k+1)k(k−1)⋯1=rk‾k!=∏j=1kr+1−jj(k≥0),(rk)=0(k<0).\binom{r}{k} = \frac{r(r-1)\cdots(r-k+1)}{k(k-1)\cdots 1} = \frac{r^{\underline{k}}}{k!} = \prod_{j=1}^{k}\frac{r+1-j}{j} \quad (k \ge 0), \qquad \binom{r}{k} = 0 \quad (k < 0).

Node: TAR88GD350 · Lean: TAOCP.binom, TAOCP.S1_2_6.eq3, TAOCP.S1_2_6.eq3_neg · status: proved

Explanation. The quotient (2) makes sense for every real rr, since it only multiplies and divides by non-zero integers. The upper index may be negative, a fraction or irrational, and the lower index is an integer. For a fixed k≥0k \ge 0 the value is a polynomial in rr of degree kk with leading coefficient 1/k!1/k!. The convention of zero for negative kk makes many sums run over all integers. The empty product for k=0k = 0 gives 11. In the code of the project, TAOCP.binom r k takes r in a field and k an integer and it is defined by this rule. Mathlib has Ring.choose r k for a natural kk and Nat.choose n k for natural nn and kk, and the project proves that they agree: TAOCP.binom_natCast and TAOCP.binom_eq_ringChoose.

Example. For r=5/2r = 5/2 and k=3k = 3 the product is (5/2)(3/2)(1/2)6=15/86=516\frac{(5/2)(3/2)(1/2)}{6} = \frac{15/8}{6} = \frac{5}{16}. For r=−1/2r = -1/2 and k=3k = 3 it is (−1/2)(−3/2)(−5/2)6=−516\frac{(-1/2)(-3/2)(-5/2)}{6} = -\frac{5}{16}, and for r=1/2r = 1/2 and k=3k = 3 it is 116\frac{1}{16}. For r=7r = 7 and k=9k = 9 one factor is 7−7=07 - 7 = 0, so the value is 00, and for k=−2k = -2 the value is 00 by the rule. Python with fractions.Fraction confirms all five values.

Proof. The three product forms of the definition are the same number: rk‾=r(r−1)⋯(r−k+1)r^{\underline{k}} = r(r-1)\cdots(r-k+1) by eq. 1.2.5(18), and the product ∏j=1k(r+1−j)/j\prod_{j=1}^{k}(r+1-j)/j is the quotient written factor by factor. For kk a natural number and r=n≥kr = n \ge k the value agrees with (2). For r=n<kr = n < k the numerator has the factor n−n=0n - n = 0, and the value is 00, which is the number of kk-element subsets of a smaller set. □\square

Theorem (the values for lower index 0, 1 and 2, TAOCP eq. 1.2.6(4)). For every real rr, (r0)=1,(r1)=r,(r2)=r(r−1)2.\binom{r}{0} = 1, \qquad \binom{r}{1} = r, \qquad \binom{r}{2} = \frac{r(r-1)}{2}.

Node: TARSX7SBQQ · Lean: TAOCP.S1_2_6.eq4 · status: proved

Explanation. These are the definition (3) read with k=0,1,2k = 0, 1, 2. The first is the empty product. For k=1k = 1 the numerator is rr and the denominator is 11. For k=2k = 2 the numerator is r(r−1)r(r-1) and the denominator is 2⋅12 \cdot 1. The Lean lemma TAOCP.binom_zero_right gives the first of the three, and Mathlib has Nat.choose_zero_right, Nat.choose_one_right and Nat.choose_two_right for natural arguments.

Example. For r=10r = 10 the three values are 11, 1010 and 10⋅92=45\frac{10 \cdot 9}{2} = 45. For r=1/2r = 1/2 they are 11, 1/21/2 and (1/2)(−1/2)2=−1/8\frac{(1/2)(-1/2)}{2} = -1/8. For r=−3r = -3 they are 11, −3-3 and (−3)(−4)2=6\frac{(-3)(-4)}{2} = 6.

Proof. In (3) with k=0k = 0 the product has no factor, so the value is 11. With k=1k = 1 the product has the single factor (r+1−1)/1=r(r + 1 - 1)/1 = r. With k=2k = 2 it has the two factors r/1r/1 and (r−1)/2(r-1)/2, and their product is r(r−1)/2r(r-1)/2. □\square

Theorem (the form with three factorials, TAOCP eq. 1.2.6(5)). For integers n≥k≥0n \ge k \ge 0, (nk)=n!k! (n−k)!.\binom{n}{k} = \frac{n!}{k!\,(n-k)!}.

Node: TASM3DCEB1 · Lean: TAOCP.S1_2_6.eq5 · status: proved

Explanation. This form lets one trade a quotient of factorials for a binomial coefficient and back. It needs nn and kk to be natural numbers with k≤nk \le n, since the factorial of a negative integer or of a number larger than the upper index has no meaning here. The Lean lemma Nat.choose_eq_factorial_div_factorial states it with a hypothesis k ≤ n, and Nat.choose_mul_factorial_mul_factorial states it without a division as (nk) k! (n−k)!=n!\binom{n}{k}\,k!\,(n-k)! = n!.

Example. For n=10n = 10 and k=4k = 4 the quotient 10!4! 6!=362880024⋅720=210\frac{10!}{4!\,6!} = \frac{3628800}{24 \cdot 720} = 210, and (104)=10⋅9⋅8⋅724=210\binom{10}{4} = \frac{10 \cdot 9 \cdot 8 \cdot 7}{24} = 210 as well. For n=kn = k the formula reads n!/(n! 0!)=1n!/(n!\,0!) = 1.

Proof. Multiply the numerator and the denominator of (2) by (n−k)!=(n−k)(n−k−1)⋯1(n-k)! = (n-k)(n-k-1)\cdots 1. The numerator becomes n(n−1)⋯(n−k+1)⋅(n−k)(n−k−1)⋯1=n!n(n-1)\cdots(n-k+1) \cdot (n-k)(n-k-1)\cdots 1 = n!, and the denominator becomes k! (n−k)!k!\,(n-k)!. □\square

Theorem (the symmetry of the coefficients, TAOCP eq. 1.2.6(6)). For an integer n≥0n \ge 0 and every integer kk, (nk)=(nn−k).\binom{n}{k} = \binom{n}{n-k}.

Node: TA7P7ECNEB · Lean: TAOCP.S1_2_6.eq6 · status: proved

Explanation. In Pascal's triangle each row reads the same from the left and from the right. The statement holds for all integers kk: when k<0k < 0 or k>nk > n both sides are 00 by the definition (3), since one of kk and n−kn - k is negative. The condition that nn is a non-negative integer is needed; for n=−1n = -1 the value (−11)=−1\binom{-1}{1} = -1 differs from (−1−2)=0\binom{-1}{-2} = 0. In Lean, Nat.choose_symm takes the hypothesis k ≤ n, and Nat.choose_symm_add is a variant.

Example. For n=12n = 12: (125)=(127)=792\binom{12}{5} = \binom{12}{7} = 792. For k=−2k = -2 or k=14k = 14 both (12k)\binom{12}{k} and (1212−k)\binom{12}{12-k} are 00. For n=5n = 5 the row is 1,5,10,10,5,11, 5, 10, 10, 5, 1.

Proof. If 0≤k≤n0 \le k \le n, then (5) gives (nk)=n!k! (n−k)!\binom{n}{k} = \frac{n!}{k!\,(n-k)!}, and the same formula with kk replaced by n−kn - k gives the same fraction, since the two factorials in the denominator are exchanged. If k<0k < 0 or k>nk > n, then k<0k < 0 or n−k<0n - k < 0, and both coefficients are 00: the first by the definition for k<0k < 0, and for k>nk > n because the numerator of (3) contains the factor n−n=0n - n = 0; and the second the same way. □\square

Theorem (moving a factor in and out, when k≠0k \ne 0, TAOCP eq. 1.2.6(7)). For every real rr and every integer k≠0k \ne 0, (rk)=rk(r−1k−1).\binom{r}{k} = \frac{r}{k}\binom{r-1}{k-1}.

Node: TAPSHK05AG · Lean: TAOCP.S1_2_6.eq7 · status: proved

Explanation. The identity pulls a factor rr out of the numerator of the coefficient and lowers both indices. It is most used in the equivalent forms k(rk)=r(r−1k−1)k\binom{r}{k} = r\binom{r-1}{k-1}, valid for all integers kk, and 1r(rk)=1k(r−1k−1)\frac{1}{r}\binom{r}{k} = \frac{1}{k}\binom{r-1}{k-1}, valid when no division by zero occurs. These forms let one absorb a loose factor kk or rr in a sum into a coefficient. The Mathlib lemma for natural arguments is Nat.add_one_mul_choose_eq.

Example. (104)=104(93)=104⋅84=210\binom{10}{4} = \frac{10}{4}\binom{9}{3} = \frac{10}{4} \cdot 84 = 210. Also 4(104)=840=10⋅84=10(93)4\binom{10}{4} = 840 = 10 \cdot 84 = 10\binom{9}{3}. For r=1/2r = 1/2 and k=3k = 3: (1/23)=1/23(−1/22)=16⋅38=116\binom{1/2}{3} = \frac{1/2}{3}\binom{-1/2}{2} = \frac{1}{6} \cdot \frac{3}{8} = \frac{1}{16}.

Proof. Take k≥1k \ge 1. Then (rk)=r(r−1)⋯(r−k+1)k!\binom{r}{k} = \frac{r(r-1)\cdots(r-k+1)}{k!}, and the numerator is rr times (r−1)(r−2)⋯((r−1)−(k−1)+1)(r-1)(r-2)\cdots((r-1)-(k-1)+1), which is the numerator of (r−1k−1)\binom{r-1}{k-1}. Also k!=k (k−1)!k! = k\,(k-1)!. Dividing out gives (rk)=rk⋅(r−1)k−1‾(k−1)!\binom{r}{k} = \frac{r}{k} \cdot \frac{(r-1)^{\underline{k-1}}}{(k-1)!}. For k<0k < 0 both sides are 00, since k−1<0k - 1 < 0 too. The form k(rk)=r(r−1k−1)k\binom{r}{k} = r\binom{r-1}{k-1} holds also for k=0k = 0, as both sides are 00, and for k<0k < 0 the same way. □\square

Theorem (moving a factor in and out, when k≠rk \ne r, TAOCP eq. 1.2.6(8)). For every real rr and every integer k≠rk \ne r, (rk)=rr−k(r−1k).\binom{r}{k} = \frac{r}{r-k}\binom{r-1}{k}.

Node: TAH0TQCS7T · Lean: TAOCP.S1_2_6.eq8 · status: proved

Explanation. This is the companion of (7), which lowers both indices, and it lowers only the upper one. It is the same as (r−k)(rk)=r(r−1k)(r-k)\binom{r}{k} = r\binom{r-1}{k}, which needs no condition on kk and rr. The book proves it by the symmetry (6) and (7) when rr is a positive integer different from kk, and then extends it to all real rr by the fact that both sides of r(r−1k)=(r−k)(rk)r\binom{r-1}{k} = (r-k)\binom{r}{k} are polynomials in rr. C1 gives a direct proof.

Example. (104)=106(94)=106⋅126=210\binom{10}{4} = \frac{10}{6}\binom{9}{4} = \frac{10}{6} \cdot 126 = 210. For r=5/2r = 5/2 and k=2k = 2: (5/22)=158\binom{5/2}{2} = \frac{15}{8}, and 5/21/2(3/22)=5⋅38=158\frac{5/2}{1/2}\binom{3/2}{2} = 5 \cdot \frac{3}{8} = \frac{15}{8}.

Proof. The claim is (r−k)(rk)=r(r−1k)(r - k)\binom{r}{k} = r\binom{r-1}{k} for all real rr and integers kk. For k<0k < 0 both sides are 00. For k≥0k \ge 0 the left side is r(r−1)⋯(r−k+1)(r−k)k!\frac{r(r-1)\cdots(r-k+1)(r-k)}{k!}. The right side is r (r−1)(r−2)⋯(r−k)k!r\,\frac{(r-1)(r-2)\cdots(r-k)}{k!}. The two numerators have the same k+1k + 1 factors r,r−1,…,r−kr, r-1, \ldots, r-k. If k≠rk \ne r, division by r−kr - k gives (8). □\square

Theorem (the addition formula, TAOCP eq. 1.2.6(9)). For every real rr and every integer kk, (rk)=(r−1k)+(r−1k−1).\binom{r}{k} = \binom{r-1}{k} + \binom{r-1}{k-1}.

Node: TA32KRG1YP · Lean: TAOCP.S1_2_6.eq9 · status: proved

Explanation. In Pascal's triangle each entry is the sum of the entry above it and the entry above and to the left. The identity holds for real rr and for all integers kk, which is what lets one extend the triangle upward to negative rows. The book gives a proof from (7) and (8) when r≠0r \ne 0. For natural numbers, Lean states it as Nat.choose_succ_succ: (n+1k+1)=(nk)+(nk+1)\binom{n+1}{k+1} = \binom{n}{k} + \binom{n}{k+1}. For a general ring, Ring.choose_succ_succ states it for Ring.choose.

Example. (104)=(94)+(93)=126+84=210\binom{10}{4} = \binom{9}{4} + \binom{9}{3} = 126 + 84 = 210. For r=5/2r = 5/2 and k=2k = 2: (3/22)+(3/21)=38+32=158=(5/22)\binom{3/2}{2} + \binom{3/2}{1} = \frac{3}{8} + \frac{3}{2} = \frac{15}{8} = \binom{5/2}{2}. For r=0r = 0 and k=3k = 3: (−13)+(−12)=−1+1=0=(03)\binom{-1}{3} + \binom{-1}{2} = -1 + 1 = 0 = \binom{0}{3}.

Proof. For k≤0k \le 0 check directly: if k<0k < 0 all three terms are 00; if k=0k = 0 the terms are 11, 11 and 00. Take k≥1k \ge 1 and r≠0r \ne 0. By (8) and (7), r(r−1k)=(r−k)(rk)r\binom{r-1}{k} = (r-k)\binom{r}{k} and r(r−1k−1)=k(rk)r\binom{r-1}{k-1} = k\binom{r}{k}. Add: r((r−1k)+(r−1k−1))=r(rk)r\left(\binom{r-1}{k} + \binom{r-1}{k-1}\right) = r\binom{r}{k}. Divide by rr. Both sides of (9) are polynomials in rr for a fixed kk, and they agree at all r≠0r \ne 0, which are infinitely many values, so they are equal at r=0r = 0 also. □\square

Theorem (a sum along a diagonal, TAOCP eq. 1.2.6(10)). For every real rr and every integer n≥0n \ge 0, ∑k=0n(r+kk)=(r0)+(r+11)+⋯+(r+nn)=(r+n+1n).\sum_{k=0}^{n}\binom{r+k}{k} = \binom{r}{0} + \binom{r+1}{1} + \cdots + \binom{r+n}{n} = \binom{r+n+1}{n}.

Node: TAVXNSS0N6 · Lean: TAOCP.S1_2_6.eq10 · status: proved

Explanation. The terms lie on a diagonal of Pascal's triangle, each one step down and one step to the right of the one before, and the sum is the entry below the last term and to the right. For natural rr Mathlib states the sum as Nat.sum_range_add_choose. The general real rr is the form that the book proves, and it is used in the proof of (18) below.

Example. For r=3r = 3 and n=4n = 4: (30)+(41)+(52)+(63)+(74)=1+4+10+20+35=70=(84)\binom{3}{0} + \binom{4}{1} + \binom{5}{2} + \binom{6}{3} + \binom{7}{4} = 1 + 4 + 10 + 20 + 35 = 70 = \binom{8}{4}.

Proof. Induct on nn. For n=0n = 0 both sides are 11, as (r+10)=1\binom{r+1}{0} = 1. If the formula holds for n−1n - 1, then by (9) with r+n+1r+n+1 and k=nk = n, ∑k=0n(r+kk)=(r+nn−1)+(r+nn)=(r+n+1n).□\sum_{k=0}^{n}\binom{r+k}{k} = \binom{r+n}{n-1} + \binom{r+n}{n} = \binom{r+n+1}{n}. \qquad \square

Theorem (a sum down a column, TAOCP eq. 1.2.6(11)). For integers m≥0m \ge 0 and n≥0n \ge 0, ∑k=0n(km)=(0m)+(1m)+⋯+(nm)=(n+1m+1).\sum_{k=0}^{n}\binom{k}{m} = \binom{0}{m} + \binom{1}{m} + \cdots + \binom{n}{m} = \binom{n+1}{m+1}.

Node: TA9Y0JGGN3 · Lean: TAOCP.S1_2_6.eq11 · status: proved

Explanation. The terms lie in one column of Pascal's triangle, and the sum is the entry that is one step down and to the right of the last. For m=1m = 1 it is the sum of an arithmetic progression, 0+1+⋯+n=(n+12)0 + 1 + \cdots + n = \binom{n+1}{2}. The Lean lemma Nat.sum_Icc_choose states the sum over kk from mm to nn, which is the same, since the terms with k<mk < m are zero. The proof below is an induction. The book derives it also from (10) with two uses of (6).

Example. For m=2m = 2 and n=6n = 6: (02)+(12)+⋯+(62)=0+0+1+3+6+10+15=35=(73)\binom{0}{2} + \binom{1}{2} + \cdots + \binom{6}{2} = 0 + 0 + 1 + 3 + 6 + 10 + 15 = 35 = \binom{7}{3}.

Proof. Induct on nn. For n=0n = 0 the left side is (0m)\binom{0}{m} and the right side is (1m+1)\binom{1}{m+1}. For m=0m = 0 both are 11, and for m>0m > 0 both are 00. For the step, by (9), ∑k=0n(km)=(nm+1)+(nm)=(n+1m+1)\sum_{k=0}^{n}\binom{k}{m} = \binom{n}{m+1} + \binom{n}{m} = \binom{n+1}{m+1} where the sum up to n−1n - 1 is (nm+1)\binom{n}{m+1} by the hypothesis, and the last step is (9) with r=n+1r = n + 1 and k=m+1k = m + 1. □\square

Example (the sum of squares by (11), TAOCP eq. 1.2.6(12)). For every integer n≥0n \ge 0, 12+22+⋯+n2=2(n+13)+(n+12)=n(n+1)(2n+1)6.1^2 + 2^2 + \cdots + n^2 = 2\binom{n+1}{3} + \binom{n+1}{2} = \frac{n(n+1)(2n+1)}{6}.

Node: TAVKZESWFB · Lean: TAOCP.S1_2_6.eq12 (partial) · status: proved

Explanation. The method of the book is to write the summand as a combination of binomial coefficients with the index kk in the upper place, and then to apply (11) to each term. Here k2=2(k2)+(k1)k^2 = 2\binom{k}{2} + \binom{k}{1}. The method works for every polynomial in kk, since the polynomials (k0),(k1),…,(km)\binom{k}{0}, \binom{k}{1}, \ldots, \binom{k}{m} have degrees 0,1,…,m0, 1, \ldots, m and so form a basis of the polynomials of degree at most mm. In Lean the sum of the first powers is Finset.sum_range_id_mul_two, which has the sum over range n, so the index is shifted by one.

Example. For n=10n = 10: 2(113)+(112)=2⋅165+55=3852\binom{11}{3} + \binom{11}{2} = 2 \cdot 165 + 55 = 385, and 1+4+9+⋯+100=3851 + 4 + 9 + \cdots + 100 = 385. The closed form gives 10⋅11⋅216=385\frac{10 \cdot 11 \cdot 21}{6} = 385 too.

Proof. Since (k2)=k(k−1)2\binom{k}{2} = \frac{k(k-1)}{2}, one gets 2(k2)+(k1)=k(k−1)+k=k22\binom{k}{2} + \binom{k}{1} = k(k-1) + k = k^2. Sum over kk from 00 to nn and apply (11) with m=2m = 2 and m=1m = 1: ∑k=0nk2=2(n+13)+(n+12)=(n+1)n(n−1)3+(n+1)n2=(n+1)n(2(n−1)+3)6=n(n+1)(2n+1)6\sum_{k=0}^{n}k^2 = 2\binom{n+1}{3} + \binom{n+1}{2} = \frac{(n+1)n(n-1)}{3} + \frac{(n+1)n}{2} = \frac{(n+1)n(2(n-1) + 3)}{6} = \frac{n(n+1)(2n+1)}{6}. □\square

Theorem (the binomial theorem, TAOCP eq. 1.2.6(13)). For an integer r≥0r \ge 0 and any numbers xx and yy, (x+y)r=∑k(rk)xkyr−k.(x+y)^r = \sum_k \binom{r}{k}x^k y^{r-k}.

Node: TAER5MY5KP · Lean: TAOCP.S1_2_6.eq13 · status: proved

Explanation. The sum runs over all integers kk, and the terms with k<0k < 0 or k>rk > r are zero, so it is the same as ∑k=0r\sum_{k=0}^{r}. The book prefers the form with no limits, since manipulations of sums are simpler when the range of the index is the set of all integers. The numbers xx and yy can be in any commutative ring. Mathlib states it as add_pow : (x + y) ^ n = ∑ m ∈ range (n + 1), x ^ m * y ^ (n - m) * n.choose m for a commutative semiring, and Commute.add_pow when xx and yy only commute. The name of the coefficient comes from this theorem.

Example. With x=2x = 2, y=3y = 3 and r=5r = 5 the sum is ∑k(5k)2k35−k=243+810+1080+720+240+32=3125=55\sum_k\binom{5}{k}2^k3^{5-k} = 243 + 810 + 1080 + 720 + 240 + 32 = 3125 = 5^5.

Proof. Induct on rr. For r=0r = 0 both sides are 11, with x0y0=1x^0y^0 = 1 as in (14). Suppose that the formula holds for r−1r - 1 with r≥1r \ge 1. Then (x+y)r=(x+y)∑k(r−1k)xkyr−1−k=∑k(r−1k)xk+1yr−1−k+∑k(r−1k)xkyr−k(x+y)^r = (x+y)\sum_k\binom{r-1}{k}x^ky^{r-1-k} = \sum_k\binom{r-1}{k}x^{k+1}y^{r-1-k} + \sum_k\binom{r-1}{k}x^ky^{r-k}. Replace kk by k−1k - 1 in the first sum, which gives ∑k(r−1k−1)xkyr−k\sum_k\binom{r-1}{k-1}x^ky^{r-k}. The two sums combine to ∑k((r−1k−1)+(r−1k))xkyr−k\sum_k\left(\binom{r-1}{k-1} + \binom{r-1}{k}\right)x^ky^{r-k}, and (9) turns the bracket into (rk)\binom{r}{k}. □\square

Definition (the convention 00=10^0 = 1, TAOCP eq. 1.2.6(14)). The symbol 000^0 means 11.

Node: TAH396BRK7 · Lean: TAOCP.S1_2_6.eq14 · status: proved

Explanation. The theorem (13) is wrong at x=0x = 0 or y=0y = 0 unless 00=10^0 = 1, as the proof of (13) just showed: with y=0y = 0, (x+0)r=xr(x+0)^r = x^r and the sum has the single term k=rk = r, (rr)xr00\binom{r}{r}x^r0^0. The same convention makes x0=1x^0 = 1 for all xx, makes the polynomial ∑kakxk\sum_k a_kx^k equal to a0a_0 at x=0x = 0, and is the one that Lean and Python use: 0 ^ 0 = 1 in Mathlib (pow_zero) and 0 ** 0 == 1 in Python. For real functions the limit of xyx^y at (0,0)(0,0) does not exist, so the convention is a choice made for algebra and not a result of analysis.

Example. Put r=0r = 0 and x=y=0x = y = 0 in (13): the left side is (0+0)0(0+0)^0 and the right side is (00)0000\binom{0}{0}0^00^0. With 00=10^0 = 1 both are 11. Python's 0**0 returns 11, and so does pow(0, 0).

Proof. A definition has no proof, and the reason for the choice is that (13) holds for r≥0r \ge 0 and all x,yx, y only with it. Suppose that (x+y)r=∑k(rk)xkyr−k(x+y)^r = \sum_k\binom{r}{k}x^ky^{r-k} for all numbers, with a value cc for 000^0. Set x=1x = 1, y=0y = 0 and r=1r = 1: the left side is 11, and the right side is (10)1001+(11)1100=c\binom{1}{0}1^00^1 + \binom{1}{1}1^10^0 = c. Hence c=1c = 1. □\square

Theorem (the binomial theorem with one variable, TAOCP eq. 1.2.6(15)). For every real rr and every real xx with ∣x∣<1|x| < 1, and also for every integer r≥0r \ge 0 and every xx, ∑k(rk)xk=(1+x)r.\sum_k\binom{r}{k}x^k = (1+x)^r.

Node: TA8N294CZG · Lean: TAOCP.S1_2_6.eq15 (partial), binomialSeries, from Mathlib · status: proved

Explanation. This is (13) with y=1y = 1. For a non-integer rr the sum is an infinite series, since no coefficient (rk)\binom{r}{k} with k≥0k \ge 0 is zero, and it converges for ∣x∣<1|x| < 1. At x=±1x = \pm1 it can converge or not, depending on rr. Mathlib has the series as binomialSeries in Mathlib/Analysis/Analytic/Binomial.lean, with the coefficients Ring.choose a n, and Real.one_add_rpow_hasFPowerSeriesOnBall_zero states that its sum is (1+x)a(1+x)^a for ∣x∣<1|x| < 1. Newton announced the result in letters of 1676 and gave no proof. Euler tried a proof in 1774, and the first complete proof is due to Gauss in 1812.

Example. For r=−2r = -2 and x=1/2x = 1/2 the coefficients are (−2k)=(−1)k(k+1)\binom{-2}{k} = (-1)^k(k+1), and the series is ∑k(−1)k(k+1)2−k=1−1+34−48+⋯\sum_k(-1)^k(k+1)2^{-k} = 1 - 1 + \frac{3}{4} - \frac{4}{8} + \cdots. It converges to (1+12)−2=49=0.4444…\left(1 + \frac{1}{2}\right)^{-2} = \frac{4}{9} = 0.4444\ldots. Two hundred terms in Python give 0.44444444444444440.4444444444444444.

Proof. For an integer r≥0r \ge 0 this is (13). Let rr be any real number, and f(x)=∑k≥0(rk)xkf(x) = \sum_{k \ge 0}\binom{r}{k}x^k. If rr is an integer ≥0\ge 0 the series is finite; otherwise (rk+1)/(rk)=r−kk+1\binom{r}{k+1}\big/\binom{r}{k} = \frac{r-k}{k+1} has absolute value that tends to 11, so by the ratio test the series converges for ∣x∣<1|x| < 1 and its derivative is the termwise derivative. From the definition (3), (k+1)(rk+1)=rk+1‾k!=(r−k)(rk)(k+1)\binom{r}{k+1} = \frac{r^{\underline{k+1}}}{k!} = (r-k)\binom{r}{k}, so (k+1)(rk+1)+k(rk)=r(rk)(k+1)\binom{r}{k+1} + k\binom{r}{k} = r\binom{r}{k}. Then (1+x)f′(x)=∑k(k+1)(rk+1)xk+∑kk(rk)xk=∑kr(rk)xk=rf(x).(1+x)f'(x) = \sum_k(k+1)\binom{r}{k+1}x^k + \sum_k k\binom{r}{k}x^k = \sum_k r\binom{r}{k}x^k = r f(x). Let g(x)=f(x)(1+x)−rg(x) = f(x)(1+x)^{-r} for ∣x∣<1|x| < 1. Then g′(x)=(1+x)−r−1((1+x)f′(x)−rf(x))=0g'(x) = (1+x)^{-r-1}\bigl((1+x)f'(x) - rf(x)\bigr) = 0, so gg is constant on the interval, and g(0)=f(0)=1g(0) = f(0) = 1. Hence f(x)=(1+x)rf(x) = (1+x)^r. □\square

Theorem (Abel's form of the binomial theorem, TAOCP eq. 1.2.6(16)). For an integer n≥0n \ge 0 and numbers x≠0x \ne 0, yy and zz, (x+y)n=∑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}.

Node: TAC6E39R6A · status: not stated yet

Explanation. When z=0z = 0 this is the binomial theorem (13), since x xk−1=xkx\,x^{k-1} = x^k. The identity holds for three variables, and the factor x(x−kz)k−1x(x-kz)^{k-1} at k=0k = 0 is read as 11, since x x−1=1x\,x^{-1} = 1. The formula is due to N. H. Abel, 1826. For a negative nn the two sides can differ, as exercise 52 shows, so it is a theorem about polynomials.

Example. With n=3n = 3, x=2x = 2, y=1y = 1, z=1z = 1 the left side is 33=273^3 = 27. The right side has the four terms k=0k = 0: 1⋅13=11 \cdot 1^3 = 1; k=1k = 1: 3⋅2⋅10⋅22=243 \cdot 2 \cdot 1^0 \cdot 2^2 = 24; k=2k = 2: 3⋅2⋅01⋅3=03 \cdot 2 \cdot 0^1 \cdot 3 = 0; k=3k = 3: 1⋅2⋅(−1)2⋅40=21 \cdot 2 \cdot (-1)^2 \cdot 4^0 = 2. The sum is 1+24+0+2=271 + 24 + 0 + 2 = 27. For the rational values x=1/2x = 1/2, y=5/3y = 5/3, z=−2/7z = -2/7 and n=3n = 3 the exact fractions in Python agree on both sides.

Proof. Write w=x+yw = x + y and y+kz=w−(x−kz)y + kz = w - (x - kz). For each kk expand (y+kz)n−k=∑j(n−kj)wj(−(x−kz))n−k−j(y+kz)^{n-k} = \sum_j\binom{n-k}{j}w^j\bigl(-(x-kz)\bigr)^{n-k-j} by (13). Then the right side of (16) is ∑jwj∑k(nk)(n−kj) x (x−kz)k−1(−1)n−k−j(x−kz)n−k−j.\sum_{j}w^j\sum_k\binom{n}{k}\binom{n-k}{j}\,x\,(x-kz)^{k-1}(-1)^{n-k-j}(x-kz)^{n-k-j}. By (20), (nk)(n−kj)=(nj)(n−jk)\binom{n}{k}\binom{n-k}{j} = \binom{n}{j}\binom{n-j}{k}. Put N=n−jN = n - j. The inner sum becomes (nj) x∑k(Nk)(−1)N−k(x−kz)N−1\binom{n}{j}\,x\sum_k\binom{N}{k}(-1)^{N-k}(x-kz)^{N-1}, since (x−kz)k−1(x−kz)N−k=(x−kz)N−1(x-kz)^{k-1}(x-kz)^{N-k} = (x-kz)^{N-1}. If N≥1N \ge 1, the function k↦(x−kz)N−1k \mapsto (x-kz)^{N-1} is a polynomial in kk of degree less than NN, and by (34) below the sum ∑k(Nk)(−1)N−kp(k)\sum_k\binom{N}{k}(-1)^{N-k}p(k) is 00 for a polynomial pp of degree less than NN. If N=0N = 0, that is j=nj = n, the only term is k=0k = 0, and x (x−0)−1=1x\,(x-0)^{-1} = 1. So the whole sum is (nn)wn=(x+y)n\binom{n}{n}w^n = (x+y)^n. □\square

Theorem (negation of the upper index, TAOCP eq. 1.2.6(17)). For every real rr and every integer kk, (rk)=(−1)k(k−r−1k).\binom{r}{k} = (-1)^k\binom{k-r-1}{k}.

Node: TAZZRHBKEZ · Lean: TAOCP.S1_2_6.eq17 · status: proved

Explanation. It turns a negative upper index into a positive one, and the reverse. The project has no statement of (17) for TAOCP.binom yet. Mathlib has Ring.choose_neg in Mathlib/RingTheory/Binomial.lean, which is (17) with rr replaced by −r-r and a natural lower index, and for the alternating sum of a row it has Int.alternating_sum_range_choose.

Example. (−34)=(−3)(−4)(−5)(−6)24=15\binom{-3}{4} = \frac{(-3)(-4)(-5)(-6)}{24} = 15, and (−1)4(4+3−14)=(64)=15(-1)^4\binom{4+3-1}{4} = \binom{6}{4} = 15. Also (−1k)=(−1)k(kk)=(−1)k\binom{-1}{k} = (-1)^k\binom{k}{k} = (-1)^k for all k≥0k \ge 0.

Proof. For k<0k < 0 both sides are 00. For k≥0k \ge 0 negate each of the kk factors in the numerator of (rk)\binom{r}{k}: r(r−1)⋯(r−k+1)=(−1)k(−r)(−r+1)⋯(−r+k−1)r(r-1)\cdots(r-k+1) = (-1)^k(-r)(-r+1)\cdots(-r+k-1). The product (−r)(−r+1)⋯(−r+k−1)(-r)(-r+1)\cdots(-r+k-1) is (k−r−1)(k−r−2)⋯(−r)(k-r-1)(k-r-2)\cdots(-r) in the opposite order, which is the numerator of (k−r−1k)\binom{k-r-1}{k}. The denominators agree. □\square

Theorem (an alternating partial sum of a row, TAOCP eq. 1.2.6(18)). For every real rr and every integer nn, ∑k≤n(rk)(−1)k=(−1)n(r−1n).\sum_{k \le n}\binom{r}{k}(-1)^k = (-1)^n\binom{r-1}{n}.

Node: TAZFT7NKQS · Lean: TAOCP.S1_2_6.eq18 (partial) · status: proved

Explanation. The sum of the whole row with alternating signs has no closed form for general rr, but the partial sum up to nn has one. The Lean lemma states it for natural r−1r - 1 in the form ∑k≤m(−1)k(n+1k)=(−1)m(nm)\sum_{k \le m}(-1)^k\binom{n+1}{k} = (-1)^m\binom{n}{m}. For n<0n < 0 both sides are 00.

Example. For r=7r = 7 and n=3n = 3: 1−7+21−35=−20=(−1)3(63)1 - 7 + 21 - 35 = -20 = (-1)^3\binom{6}{3}. For r=7r = 7 and n=7n = 7 the sum is the full alternating row, 0=(67)0 = \binom{6}{7}. For r=1/2r = 1/2 and n=2n = 2: 1−12−18=38=(−1/22)1 - \frac{1}{2} - \frac{1}{8} = \frac{3}{8} = \binom{-1/2}{2}.

Proof. By (17), (rk)(−1)k=(k−r−1k)\binom{r}{k}(-1)^k = \binom{k-r-1}{k}. Put ρ=−r\rho = -r, so that the sum is ∑k≤n(ρ+k−1k)\sum_{k \le n}\binom{\rho + k - 1}{k}. For n≥0n \ge 0 this is the sum (10) with rr replaced by ρ−1\rho - 1, which has the value (ρ−1+n+1n)=(ρ+nn)\binom{\rho-1+n+1}{n} = \binom{\rho + n}{n}. Now apply (17) once more: (n−rn)=(−1)n(n−(n−r)−1n)=(−1)n(r−1n)\binom{n-r}{n} = (-1)^n\binom{n-(n-r)-1}{n} = (-1)^n\binom{r-1}{n}. For n<0n < 0 every term and the right side are 00. □\square

Theorem (negation of the upper index for an integer upper index, TAOCP eq. 1.2.6(19)). For integers n≥0n \ge 0 and mm, (nm)=(−1)n−m(−(m+1)n−m).\binom{n}{m} = (-1)^{n-m}\binom{-(m+1)}{n-m}.

Node: TA89F6D5F9 · Lean: TAOCP.S1_2_6.eq19 · status: proved

Explanation. The upper index nn becomes a lower index n−mn - m, and the new upper index −(m+1)-(m+1) is negative and fixed when mm is fixed. This lets one sum over nn instead of over mm, as in the proof of (24).

Example. (52)=(−1)3(−33)=−(−10)=10\binom{5}{2} = (-1)^3\binom{-3}{3} = -(-10) = 10, where (−33)=(−3)(−4)(−5)6=−10\binom{-3}{3} = \frac{(-3)(-4)(-5)}{6} = -10. For m=7m = 7 and n=5n = 5 both sides are 00.

Proof. Apply (17) with r=nr = n and k=n−mk = n - m: (nn−m)=(−1)n−m(n−m−n−1n−m)=(−1)n−m(−m−1n−m)\binom{n}{n-m} = (-1)^{n-m}\binom{n-m-n-1}{n-m} = (-1)^{n-m}\binom{-m-1}{n-m}. By the symmetry (6), valid for n≥0n \ge 0 and all integers mm, (nn−m)=(nm)\binom{n}{n-m} = \binom{n}{m}. □\square

Theorem (the product of two coefficients with a shared index, TAOCP eq. 1.2.6(20)). For every real rr and all integers mm and kk, (rm)(mk)=(rk)(r−km−k).\binom{r}{m}\binom{m}{k} = \binom{r}{k}\binom{r-k}{m-k}.

Node: TAJNS2M4G8 · Lean: TAOCP.S1_2_6.eq20 · status: proved

Explanation. The index mm stands in the lower place of the first coefficient and in the upper place of the second. The formula moves it to one place only. Both sides count the ways to choose a set of mm objects out of rr and then a subset of kk objects out of those mm, and the right side first chooses the kk objects and then the m−km - k others. The case k=1k = 1 is (7). In Mathlib, the lemma Nat.choose_mul states it for natural numbers: (nk)(ks)=(ns)(n−sk−s)\binom{n}{k}\binom{k}{s} = \binom{n}{s}\binom{n-s}{k-s}.

Example. (95)(52)=126⋅10=1260\binom{9}{5}\binom{5}{2} = 126 \cdot 10 = 1260 and (92)(73)=36⋅35=1260\binom{9}{2}\binom{7}{3} = 36 \cdot 35 = 1260. For r=7/3r = 7/3, m=3m = 3 and k=2k = 2 the left side is (7/33)(32)=1481⋅3=1427\binom{7/3}{3}\binom{3}{2} = \frac{14}{81}\cdot 3 = \frac{14}{27} and the right side is (7/32)(1/31)=149⋅13=1427\binom{7/3}{2}\binom{1/3}{1} = \frac{14}{9}\cdot\frac{1}{3} = \frac{14}{27}.

Proof. If k<0k < 0 or k>mk > m, with m≥0m \ge 0, both sides are 00: on the left (mk)=0\binom{m}{k} = 0, and on the right (rk)=0\binom{r}{k} = 0 for k<0k < 0 and (r−km−k)=0\binom{r-k}{m-k} = 0 for m−k<0m - k < 0. If m<0m < 0, then (rm)=0\binom{r}{m} = 0 and the right side has (r−km−k)\binom{r-k}{m-k} with m−k<0m - k < 0 for k≥0k \ge 0, and (rk)=0\binom{r}{k} = 0 for k<0k < 0, so it is 00 too. Now take 0≤k≤m0 \le k \le m. For an integer r≥mr \ge m use (5): (rm)(mk)=r!m! (r−m)!⋅m!k! (m−k)!=r!k! (r−m)! (m−k)!=r!k! (r−k)!⋅(r−k)!(m−k)! (r−m)!=(rk)(r−km−k).\binom{r}{m}\binom{m}{k} = \frac{r!}{m!\,(r-m)!}\cdot\frac{m!}{k!\,(m-k)!} = \frac{r!}{k!\,(r-m)!\,(m-k)!} = \frac{r!}{k!\,(r-k)!}\cdot\frac{(r-k)!}{(m-k)!\,(r-m)!} = \binom{r}{k}\binom{r-k}{m-k}. For fixed mm and kk both sides are polynomials in rr of degree mm, and they agree at r=m,m+1,m+2,…r = m, m+1, m+2, \ldots, so they agree for every real rr. □\square

Theorem (Vandermonde's convolution, TAOCP eq. 1.2.6(21)). 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}.

Node: TAK5XM05A4 · Lean: TAOCP.S1_2_6.eq21 (partial) · status: proved

Explanation. It is the identity of the section that is used most often. For natural rr and ss both sides count the nn-element subsets of a set with rr red and ss blue elements, and the term for kk counts the subsets with kk red elements. It is named for A. Vandermonde (1772), but the Chinese treatise of Chu Shih-Chieh (1303) already has it. Mathlib has two versions. Nat.add_choose_eq is for natural numbers, with a sum over the antidiagonal of kk, and Ring.add_choose_eq is for a binomial ring, and so for the integers and the rationals, with a natural lower index. The form with real upper indices is the one proved here. Exercise 17 derives it from (15) by comparing the coefficients of (1+x)r+s=(1+x)r(1+x)s(1+x)^{r+s} = (1+x)^r(1+x)^s, and the proof of (28) uses it with a negative upper index.

Example. For r=3r = 3, s=4s = 4 and n=3n = 3: (30)(43)+(31)(42)+(32)(41)+(33)(40)=4+18+12+1=35=(73)\binom{3}{0}\binom{4}{3} + \binom{3}{1}\binom{4}{2} + \binom{3}{2}\binom{4}{1} + \binom{3}{3}\binom{4}{0} = 4 + 18 + 12 + 1 = 35 = \binom{7}{3}. For the real values r=7/3r = 7/3, s=5/2s = 5/2 and n=4n = 4 the exact fractions give (29/64)=12472931104\binom{29/6}{4} = \frac{124729}{31104} on both sides.

Proof. If n<0n < 0 both sides are 00. For n≥0n \ge 0 the left side has only the terms 0≤k≤n0 \le k \le n. First take natural numbers rr and ss. Take a set of rr red and ss blue elements and its nn-element subsets. Sort them by the number kk of red elements: there are (rk)(sn−k)\binom{r}{k}\binom{s}{n-k} subsets with kk red elements, so the sum over kk is the number (r+sn)\binom{r+s}{n} of all of them. Now fix a natural ss and nn. Both sides are polynomials in rr of degree at most nn, and they agree at r=0,1,2,…r = 0, 1, 2, \ldots, so they are equal for all real rr. Fix a real rr and a natural nn. Both sides are now polynomials in ss of degree at most nn and they agree at s=0,1,2,…s = 0, 1, 2, \ldots, hence for all real ss. □\square

Theorem (a convolution with shifted lower indices, TAOCP eq. 1.2.6(22)). For integers mm, nn and r≥0r \ge 0 and every real ss, ∑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}.

Node: TAP8HSPY9S · status: not stated yet

Explanation. The running index kk now appears in both lower places with a plus sign. Reflect the first coefficient by (6) and the sum becomes the convolution (21). The condition that rr is a non-negative integer is needed for (6).

Example. For r=6r = 6, s=7/5s = 7/5, m=2m = 2 and n=1n = 1 the sum runs over the terms k=−1,…,4k = -1, \ldots, 4 with (62+k)\binom{6}{2+k} and (7/51+k)\binom{7/5}{1+k}. The right side is (37/55)\binom{37/5}{5}, and Python gives 49816815625\frac{498168}{15625} for both. A use of (22) with a loose factor: for an integer r≥0r \ge 0 and real ss, ∑k(rk)(sk)(s−k)=s(r+s−1r)\sum_k\binom{r}{k}\binom{s}{k}(s-k) = s\binom{r+s-1}{r}. Take r=3r = 3 and s=4s = 4. The left side is 1⋅1⋅4+3⋅4⋅3+3⋅6⋅2+1⋅4⋅1=4+36+36+4=801 \cdot 1 \cdot 4 + 3 \cdot 4 \cdot 3 + 3 \cdot 6 \cdot 2 + 1 \cdot 4 \cdot 1 = 4 + 36 + 36 + 4 = 80, and the right side is 4(63)=804\binom{6}{3} = 80.

Proof. By (6), (rm+k)=(rr−m−k)\binom{r}{m+k} = \binom{r}{r-m-k} for r≥0r \ge 0. Put j=r−m−kj = r - m - k. The sum is ∑j(rj)(sn+r−m−j)\sum_j\binom{r}{j}\binom{s}{n+r-m-j} and (21) with nn replaced by r−m+nr - m + n gives (r+sr−m+n)\binom{r+s}{r-m+n}. □\square

Proof of the use. By (8) in the form (s−k)(sk)=s(s−1k)(s-k)\binom{s}{k} = s\binom{s-1}{k}, the sum is s∑k(rk)(s−1k)s\sum_k\binom{r}{k}\binom{s-1}{k}, and (22) with m=n=0m = n = 0 and s−1s - 1 in place of ss gives s(r+s−1r)s\binom{r+s-1}{r}. □\square

Theorem (an alternating convolution with an upper index that moves, TAOCP eq. 1.2.6(23)). For integers nn and r≥0r \ge 0 and every real ss, ∑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}.

Node: TA4BKSTGJG · status: not stated yet

Explanation. This is a difference formula in disguise: the left side is the rrth finite difference of the function k↦(s+kn)k \mapsto \binom{s+k}{n} at k=0k = 0, and each difference lowers nn by one. The book proves it as an exercise by induction (exercise 19). The case s=0s = 0 is the inversion formula (33).

Example. For r=2r = 2, s=5s = 5 and n=3n = 3: (53)−2(63)+(73)=10−40+35=5=(51)\binom{5}{3} - 2\binom{6}{3} + \binom{7}{3} = 10 - 40 + 35 = 5 = \binom{5}{1}. For r=2r = 2, s=3/2s = 3/2 and n=3n = 3: (3/23)−2(5/23)+(7/23)=−116−58+3516=32=(3/21)\binom{3/2}{3} - 2\binom{5/2}{3} + \binom{7/2}{3} = -\frac{1}{16} - \frac{5}{8} + \frac{35}{16} = \frac{3}{2} = \binom{3/2}{1}. For n<rn < r the right side has a negative lower index and is 00.

Proof. Let EE be the shift operator (Ef)(k)=f(k+1)(Ef)(k) = f(k+1), let Δ=E−1\Delta = E - 1, and let f(k)=(s+kn)f(k) = \binom{s+k}{n}. Then Δf(k)=(s+k+1n)−(s+kn)=(s+kn−1)\Delta f(k) = \binom{s+k+1}{n} - \binom{s+k}{n} = \binom{s+k}{n-1} by (9), for every integer nn. By induction Δrf(k)=(s+kn−r)\Delta^rf(k) = \binom{s+k}{n-r}. The operators EE and 11 commute, so the binomial theorem (13) holds for them: Δr=(E−1)r=∑k(rk)(−1)r−kEk\Delta^r = (E-1)^r = \sum_k\binom{r}{k}(-1)^{r-k}E^k. Apply it to ff at k=0k = 0: ∑k(rk)(−1)r−kf(k)=Δrf(0)=(sn−r)\sum_k\binom{r}{k}(-1)^{r-k}f(k) = \Delta^rf(0) = \binom{s}{n-r}. □\square

Theorem (an alternating sum over the upper index, TAOCP eq. 1.2.6(24)). For integers t≥0t \ge 0, r≥0r \ge 0 and m≥0m \ge 0 and 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}.

Node: TA74N9ZXM4 · status: not stated yet

Explanation. Here the running index moves the upper index of one coefficient and the lower index of the other. The sum is cut off at k=rk = r, which is part of the identity. The book proves it with (21) and (19); C1 uses the generating function of the column of Pascal's triangle, which keeps the cut-off visible.

Example. For t=1t = 1, r=5r = 5, m=2m = 2 and s=7/3s = 7/3 the terms are k=1k = 1: (42)⋅1=6\binom{4}{2} \cdot 1 = 6; k=2k = 2: −(32)⋅73=−7-\binom{3}{2}\cdot\frac{7}{3} = -7; k=3k = 3: (22)(7/32)=149\binom{2}{2}\binom{7/3}{2} = \frac{14}{9}; and 00 for k=4,5k = 4, 5. The sum is 6−7+149=596 - 7 + \frac{14}{9} = \frac{5}{9}, and the right side is (5/32)=(5/3)(2/3)2=59\binom{5/3}{2} = \frac{(5/3)(2/3)}{2} = \frac{5}{9}. An integer case: t=0t = 0, r=4r = 4, m=1m = 1, s=2s = 2 gives 4−3⋅2+2⋅1=0=(23)4 - 3\cdot 2 + 2\cdot 1 = 0 = \binom{2}{3}.

Proof. Put j=k−tj = k - t and R=r−tR = r - t. If R<0R < 0 the sum is empty and the right side is 00, since its lower index R−mR - m is negative. For R≥0R \ge 0 the terms have 0≤j≤R0 \le j \le R, and the claim is ∑j=0R(−1)j(sj)(R−jm)=(R−sR−m)\sum_{j=0}^{R}(-1)^j\binom{s}{j}\binom{R-j}{m} = \binom{R-s}{R-m}. Consider the formal power series u(x)=∑j(sj)(−x)ju(x) = \sum_j\binom{s}{j}(-x)^j and v(x)=∑i≥0(im)xiv(x) = \sum_{i \ge 0}\binom{i}{m}x^i. The coefficient of xRx^R in u(x)v(x)u(x)v(x) is the left side. By (17), (m+km)=(−1)k(−m−1k)\binom{m+k}{m} = (-1)^k\binom{-m-1}{k}, so v(x)=xm∑k(−m−1k)(−x)kv(x) = x^m\sum_k\binom{-m-1}{k}(-x)^k. By (21), the formal series bρ(y)=∑k(ρk)ykb_\rho(y) = \sum_k\binom{\rho}{k}y^k satisfy bρbσ=bρ+σb_\rho b_\sigma = b_{\rho+\sigma}, since the coefficient of yny^n in the product is the left side of (21). Hence u(x)v(x)=xmbs−m−1(−x)u(x)v(x) = x^mb_{s-m-1}(-x), and the coefficient of xRx^R is the coefficient of xR−mx^{R-m} in bs−m−1(−x)b_{s-m-1}(-x), which is (−1)R−m(s−m−1R−m)(-1)^{R-m}\binom{s-m-1}{R-m}. By (17) with r=s−m−1r = s - m - 1 and k=R−mk = R - m this is (R−sR−m)\binom{R-s}{R-m}. □\square

Theorem (a convolution over the upper indices, TAOCP eq. 1.2.6(25)). For integers m≥0m \ge 0, r≥0r \ge 0 and n≥s≥0n \ge s \ge 0, ∑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}.

Node: TAP4T67P0P · status: not stated yet

Explanation. Both coefficients have the running index in the upper place, one with a minus sign and one with a plus sign. The sum is cut off at k=rk = r, and the condition n≥sn \ge s makes the terms with k<0k < 0 vanish, so that the cut-off is natural. The book calls (23) and (25) the expansions of (sn+a)\binom{s}{n+a} in terms of (s+kn)\binom{s+k}{n}, (23) for negative aa and (25) for positive aa, and it advises to replace a simple coefficient by such a sum when it helps.

Example. For r=5r = 5, s=2s = 2, m=1m = 1 and n=3n = 3 the terms (5−k)(2+k3)(5-k)\binom{2+k}{3} for k=0,…,5k = 0, \ldots, 5 are 0,4,12,20,20,00, 4, 12, 20, 20, 0. Their sum is 56=(85)56 = \binom{8}{5}. If n<sn < s the identity can fail: for r=3r = 3, s=2s = 2, m=0m = 0, n=0n = 0 the left side is ∑k=03(2+k0)=4\sum_{k=0}^{3}\binom{2+k}{0} = 4 and the right side is (61)=6\binom{6}{1} = 6. The two missing terms are the values j=0,1j = 0, 1 of the full sum, which the condition n≥sn \ge s removes.

Proof. Put N=r+sN = r + s and j=s+kj = s + k. The sum is ∑j=sN(N−jm)(jn)\sum_{j=s}^{N}\binom{N-j}{m}\binom{j}{n}. Since n≥sn \ge s, (jn)=0\binom{j}{n} = 0 for j<sj < s, so the sum can start at j=0j = 0. Now (N+1m+n+1)\binom{N+1}{m+n+1} counts the subsets of {0,1,…,N}\{0, 1, \ldots, N\} of size m+n+1m + n + 1. Sort them by the (n+1)(n+1)st smallest element jj. There are (jn)\binom{j}{n} ways to choose the nn smaller elements from {0,…,j−1}\{0, \ldots, j-1\} and (N−jm)\binom{N-j}{m} ways to choose the mm larger elements from {j+1,…,N}\{j+1, \ldots, N\}. Sum over jj. □\square

Theorem (Rothe's convolution, TAOCP eq. 1.2.6(26)). For an integer n≥0n \ge 0 and real rr, ss, tt, ∑k=0n(r−tkk)(s−t(n−k)n−k)rr−tk=(r+s−tnn).\sum_{k=0}^{n}\binom{r-tk}{k}\binom{s-t(n-k)}{n-k}\frac{r}{r-tk} = \binom{r+s-tn}{n}.

Node: TA60MA975H · status: not stated yet

Explanation. For n<0n < 0 both sides are 00. When r=tkr = tk the quotient (r−tkk)rr−tk\binom{r-tk}{k}\frac{r}{r-tk} is read as the polynomial rk(r−tk−1k−1)\frac{r}{k}\binom{r-tk-1}{k-1} for k≥1k \ge 1 and as 11 for k=0k = 0, so the identity is a polynomial identity in rr, ss and tt. The case t=0t = 0 is Vandermonde's convolution (21), since the factor r/(r−tk)r/(r - tk) is then 11. For general tt the upper indices drift with the running index kk, and the extra factor repairs the drift. The book states the result and leaves the proof to Exercises 22 to 24 and to the generating functions of Exercises 25 to 27. The proof below follows the plan of Exercises 22 to 24, with its own choice of the starting value.

Example. Take r=7/2r = 7/2, s=5/3s = 5/3, t=2t = 2 and n=4n = 4. The five terms, for k=0,…,4k = 0, \ldots, 4, are 36575243\frac{36575}{243}, −691681-\frac{6916}{81}, −24524-\frac{245}{24}, −4916-\frac{49}{16} and −5005128-\frac{5005}{128}, and their sum is 39686531104\frac{396865}{31104}. The right side is (7/2+5/3−84)=(−17/64)=39686531104\binom{7/2 + 5/3 - 8}{4} = \binom{-17/6}{4} = \frac{396865}{31104}. An integer case: r=7r = 7, s=3s = 3, t=3t = 3, n=5n = 5 gives −126-126 on both sides.

Proof. Write Ak(r)=(r−tkk)rr−tkA_k(r) = \binom{r-tk}{k}\frac{r}{r-tk}, so that A0=1A_0 = 1 and AkA_k is a polynomial in rr and tt, and let Ln(s)=∑k=0nAk(r)(s−t(n−k)n−k)L_n(s) = \sum_{k=0}^{n}A_k(r)\binom{s-t(n-k)}{n-k} and Rn(s)=(r+s−tnn)R_n(s) = \binom{r+s-tn}{n}. Fix tt and a real rr such that r≠tkr \ne tk for all k≤nk \le n, and prove Ln=RnL_n = R_n as functions of ss by induction on nn. For n=0n = 0 both sides are 11. Let n≥1n \ge 1 and assume the claim for n−1n - 1 and all ss.

The first step is a recursion in ss. By the addition formula (9), (s+1−t(n−k)n−k)=(s−t(n−k)n−k)+(s−t(n−k)n−k−1)\binom{s+1-t(n-k)}{n-k} = \binom{s-t(n-k)}{n-k} + \binom{s-t(n-k)}{n-k-1}. Summing against Ak(r)A_k(r), the first part gives Ln(s)L_n(s). In the second part the term k=nk = n vanishes, and for k≤n−1k \le n - 1 the coefficient is ((s−t)−t(n−1−k)n−1−k)\binom{(s-t)-t(n-1-k)}{n-1-k}, so the second part is Ln−1(s−t)L_{n-1}(s-t). Thus Ln(s+1)=Ln(s)+Ln−1(s−t)L_n(s+1) = L_n(s) + L_{n-1}(s-t). The same addition formula gives Rn(s+1)=Rn(s)+(r+s−tnn−1)=Rn(s)+Rn−1(s−t)R_n(s+1) = R_n(s) + \binom{r+s-tn}{n-1} = R_n(s) + R_{n-1}(s-t), because r+(s−t)−t(n−1)=r+s−tnr + (s-t) - t(n-1) = r + s - tn. By the induction hypothesis Ln−1(s−t)=Rn−1(s−t)L_{n-1}(s-t) = R_{n-1}(s-t), so the difference D(s)=Ln(s)−Rn(s)D(s) = L_n(s) - R_n(s) satisfies D(s+1)=D(s)D(s+1) = D(s) for every real ss. Since DD is a polynomial in ss and it takes the same value at s0,s0+1,s0+2,…s_0, s_0+1, s_0+2, \ldots for any s0s_0, it is constant. It is enough to find one s0s_0 with D(s0)=0D(s_0) = 0.

Take s0=tn−r+n−1s_0 = tn - r + n - 1. Then Rn(s0)=(n−1n)=0R_n(s_0) = \binom{n-1}{n} = 0. For Ln(s0)L_n(s_0), the lower index of the second factor is n−kn - k and the upper index is s0−t(n−k)=tk−r+n−1s_0 - t(n-k) = tk - r + n - 1. By the negation formula (17), (tk−r+n−1n−k)=(−1)n−k(r−tk−kn−k)\binom{tk-r+n-1}{n-k} = (-1)^{n-k}\binom{r-tk-k}{n-k}. By (20) with the upper index a=r−tka = r - tk, (ak)(a−kn−k)=(an)(nk)\binom{a}{k}\binom{a-k}{n-k} = \binom{a}{n}\binom{n}{k}, and by (7), (an)1a=1n(a−1n−1)\binom{a}{n}\frac{1}{a} = \frac{1}{n}\binom{a-1}{n-1}. Hence Ln(s0)=rn∑k=0n(−1)n−k(nk)(r−1−tkn−1).L_n(s_0) = \frac{r}{n}\sum_{k=0}^{n}(-1)^{n-k}\binom{n}{k}\binom{r-1-tk}{n-1}. The coefficient (r−1−tkn−1)\binom{r-1-tk}{n-1} is a polynomial in kk of degree at most n−1n - 1. By (34) of the next file, or by the fact that the nnth finite difference of a polynomial of degree less than nn is zero, the alternating sum is 00. So D(s0)=0D(s_0) = 0, hence D=0D = 0 for all real ss.

Finally, both sides are polynomials in rr for fixed ss and tt, and they agree for all but finitely many rr, hence for all rr. The same argument in tt shows the identity for all real tt. □\square

Lemma (the first reduction of Example 2, TAOCP eq. 1.2.6(27)). For an integer n≥0n \ge 0, ∑k(n+k2k)(2kk)(−1)kk+1=∑k(n+kk)(n+1k+1)(−1)kn+1.\sum_{k}\binom{n+k}{2k}\binom{2k}{k}\frac{(-1)^k}{k+1} = \sum_{k}\binom{n+k}{k}\binom{n+1}{k+1}\frac{(-1)^k}{n+1}.

Node: TACZ5TWFFJ · status: not stated yet

Explanation. The left sum has the running index kk in six places. Two basic operations remove two of them: the product rule (20) and the factor rule (7). The result is a sum of two coefficients, which the next result evaluates. Both sums have only terms with 0≤k≤n0 \le k \le n, because (n+k2k)=0\binom{n+k}{2k} = 0 for k>nk > n and (nk)=0\binom{n}{k} = 0 for k>nk > n.

Example. For n=4n = 4 the five terms of the left side, k=0,…,4k = 0, \ldots, 4, are 1,−10,30,−35,141, -10, 30, -35, 14, and so are the five terms of the right side. Their sum is 00. For n=3n = 3 the right side has the terms 1,−6,10,−51, -6, 10, -5, with sum 00.

Proof. By (20) with the upper index n+kn + k, the middle index 2k2k and the lower index kk, (n+k2k)(2kk)=(n+kk)(nk)\binom{n+k}{2k}\binom{2k}{k} = \binom{n+k}{k}\binom{n}{k}, since (n+k)−k=n(n+k) - k = n and 2k−k=k2k - k = k. Next, (7) gives (n+1k+1)=n+1k+1(nk)\binom{n+1}{k+1} = \frac{n+1}{k+1}\binom{n}{k}, so (nk)1k+1=1n+1(n+1k+1)\binom{n}{k}\frac{1}{k+1} = \frac{1}{n+1}\binom{n+1}{k+1}. Multiply the two facts. □\square

Theorem (the value of Example 2, TAOCP eq. 1.2.6(28)). For an integer n≥0n \ge 0, ∑k(n+k2k)(2kk)(−1)kk+1=δn0.\sum_{k}\binom{n+k}{2k}\binom{2k}{k}\frac{(-1)^k}{k+1} = \delta_{n0}.

Node: TA530FJH9J · status: not stated yet

Explanation. The sum is 11 for n=0n = 0 and 00 for every other nn. It is the building block of the next example, where it is used as a way to cut a sum down to a single term. The book gives two derivations from (27). One uses (23), the other uses (17) and (22). The proof below is the second, with (22) written out as (6) and (21).

Example. The sums for n=0,1,2,3,4,5n = 0, 1, 2, 3, 4, 5 are 1,0,0,0,0,01, 0, 0, 0, 0, 0. For n=2n = 2, the form of (27) is 13[(20)(31)−(31)(32)+(42)(33)]=13[3−9+6]=0\frac{1}{3}\left[\binom{2}{0}\binom{3}{1} - \binom{3}{1}\binom{3}{2} + \binom{4}{2}\binom{3}{3}\right] = \frac{1}{3}[3 - 9 + 6] = 0.

Proof. By (27) it is enough to show that 1n+1∑k(n+kk)(n+1k+1)(−1)k=δn0\frac{1}{n+1}\sum_k\binom{n+k}{k}\binom{n+1}{k+1}(-1)^k = \delta_{n0}. By (17), (n+kk)=(−1)k(−n−1k)\binom{n+k}{k} = (-1)^k\binom{-n-1}{k}, so the signs cancel and the sum is 1n+1∑k(−n−1k)(n+1k+1)\frac{1}{n+1}\sum_k\binom{-n-1}{k}\binom{n+1}{k+1}. By the symmetry (6), (n+1k+1)=(n+1n−k)\binom{n+1}{k+1} = \binom{n+1}{n-k}. Vandermonde's convolution (21) with the upper indices −n−1-n-1 and n+1n+1 and the total nn gives ∑k(−n−1k)(n+1n−k)=(0n)\sum_k\binom{-n-1}{k}\binom{n+1}{n-k} = \binom{0}{n}. And (0n)\binom{0}{n} is 11 for n=0n = 0 and 00 for n>0n > 0. Dividing by n+1n + 1 keeps δn0\delta_{n0}. □\square

Theorem (the double sum of Example 3 and its value, TAOCP eq. 1.2.6(29)). For integers m≥1m \ge 1 and n≥1n \ge 1, the sum ∑k(n+km+2k)(2kk)(−1)kk+1\sum_{k}\binom{n+k}{m+2k}\binom{2k}{k}\frac{(-1)^k}{k+1} equals the double sum ∑k∑0≤j≤n+k−1(n+k−1−j2k)(2kk)(jm−1)(−1)kk+1=(n−1m−1).\sum_k\sum_{0 \le j \le n+k-1}\binom{n+k-1-j}{2k}\binom{2k}{k}\binom{j}{m-1}\frac{(-1)^k}{k+1} = \binom{n-1}{m-1}.

Node: TA9A3TR0GA · status: not stated yet

Explanation. The double sum (29) is the step that turns the single sum of Example 3 into a sum that (28) can evaluate. The proof below derives it by (25) and evaluates it. When m>0m > 0 the product rule (20) no longer applies to the first coefficient. The remedy is to replace (n+km+2k)\binom{n+k}{m+2k} by a sum of coefficients of the form (x+k2k)\binom{x+k}{2k}, which (28) can handle. This is a step in the wrong direction at first sight, because it adds a summation, and it pays because the new inner sum has the known value δ\delta. The delicate point is the range of jj and kk when the sums are interchanged.

Example. For n=5n = 5 and m=2m = 2 the terms with k=0,1,2,3k = 0, 1, 2, 3 are 1010, −15-15, 1414, −5-5, with sum 4=(41)4 = \binom{4}{1}. The terms with k≥4k \ge 4 vanish, since m+2k>n+km + 2k > n + k.

Proof. Fix k≥0k \ge 0. By (25) with r=n+k−1≥0r = n + k - 1 \ge 0, s=0s = 0, the pair (m,n)(m, n) of that equation replaced by (2k,m−1)(2k, m - 1), and the condition m−1≥s=0m - 1 \ge s = 0 fulfilled, (n+km+2k)=∑j=0n+k−1(n+k−1−j2k)(jm−1)\binom{n+k}{m+2k} = \sum_{j=0}^{n+k-1}\binom{n+k-1-j}{2k}\binom{j}{m-1}. Put this in the sum to get the double sum of (29). Terms with n≤j≤n+k−1n \le j \le n + k - 1 (which occur only for k≥1k \ge 1) have 0≤n+k−1−j≤k−1<2k0 \le n + k - 1 - j \le k - 1 < 2k, hence (n+k−1−j2k)=0\binom{n+k-1-j}{2k} = 0. So the range of jj can be cut to 0≤j<n0 \le j < n without changing the sum, and for these jj every k≥0k \ge 0 is allowed, so the two sums can be interchanged. The inner sum over kk is ∑k((n−1−j)+k2k)(2kk)(−1)kk+1=δn−1−j,0\sum_k\binom{(n-1-j)+k}{2k}\binom{2k}{k}\frac{(-1)^k}{k+1} = \delta_{n-1-j,0} by (28), with n−1−j≥0n - 1 - j \ge 0. Therefore the total is ∑0≤j<n(jm−1)δn−1−j,0\sum_{0 \le j < n}\binom{j}{m-1}\delta_{n-1-j,0}, and only j=n−1j = n - 1 survives, with value (n−1m−1)\binom{n-1}{m-1}. □\square

Theorem (the addition rule for the polynomials AnA_n, TAOCP eq. 1.2.6(30)). Let An(x,t)=(x−ntn)xx−ntA_n(x, t) = \binom{x-nt}{n}\frac{x}{x-nt} for x≠ntx \ne nt, extended to a polynomial in xx and tt. For an 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).

Node: TA7WNB4E05 · status: not stated yet

Explanation. This is a version of (26) with the product rr−ktss−(n−k)t\frac{r}{r-kt}\frac{s}{s-(n-k)t} in place of one factor. The identity says that the polynomials An(x,t)A_n(x,t) add their arguments in the way the coefficients (xn)\binom{x}{n} do by (21), which is the case t=0t = 0. The book reduces (30) to (26) by partial fractions, and Exercise 27 gives a second proof by generating functions. The proof below is the reduction by partial fractions, written with the values of this file.

Example. For r=7/3r = 7/3, s=11/5s = 11/5, t=3t = 3 and n=4n = 4, the five products Ak(r,t)A4−k(s,t)A_k(r,t)A_{4-k}(s,t) are −93456625-\frac{93456}{625}, 22022375\frac{22022}{375}, 215675\frac{2156}{75}, 23023405\frac{23023}{405} and −37240243-\frac{37240}{243}. Their sum is −24066373151875-\frac{24066373}{151875}, and A4(73+115,3)A_4(\frac{7}{3} + \frac{11}{5}, 3) has the same value.

Proof. Both sides are polynomials in rr, ss and tt, so it may be assumed that r≠ktr \ne kt, s≠kts \ne kt for 0≤k≤n0 \le k \le n and r+s≠ntr + s \ne nt. Put a=r−kta = r - kt and b=s−(n−k)tb = s - (n-k)t, so that a+b=r+s−nta + b = r + s - nt. From 1ab=1a+b(1a+1b)\frac{1}{ab} = \frac{1}{a+b}\left(\frac{1}{a} + \frac{1}{b}\right) the product is Ak(r,t)An−k(s,t)=rsr+s−nt(ak)(bn−k)(1a+1b).A_k(r,t)A_{n-k}(s,t) = \frac{rs}{r+s-nt}\binom{a}{k}\binom{b}{n-k}\left(\frac{1}{a} + \frac{1}{b}\right). Sum over kk. The part with 1/a1/a is sr+s−nt\frac{s}{r+s-nt} times ∑k(r−ktk)(s−(n−k)tn−k)rr−kt\sum_k\binom{r-kt}{k}\binom{s-(n-k)t}{n-k}\frac{r}{r-kt}, and this is (r+s−tnn)\binom{r+s-tn}{n} by (26). For the part with 1/b1/b replace kk by n−kn - k: it becomes rr+s−nt\frac{r}{r+s-nt} times ∑k(s−ktk)(r−(n−k)tn−k)ss−kt\sum_k\binom{s-kt}{k}\binom{r-(n-k)t}{n-k}\frac{s}{s-kt}, which is (r+s−tnn)\binom{r+s-tn}{n} by (26) with rr and ss exchanged. The total is r+sr+s−nt(r+s−ntn)=An(r+s,t)\frac{r+s}{r+s-nt}\binom{r+s-nt}{n} = A_n(r+s, t). □\square

Algorithms and programs

The section has no algorithm and no program. Its only procedures are by hand: the building of Pascal's triangle by the addition formula (9), and the reduction of a sum by the chain of operations shown in the model problems of eqs. (27) to (30).

The exercises

The table has the exercises 1 to 30 of Section 1.2.6, which belong to the material of this file. The exercises 31 to 68 are in the second file, together with the equations they use. The kind is the class of spec 06.3 that C1 proposes.

Exercise Rating Markers Kind Lean Solution
1.2.6-1 00 K3 not yet stated X1, 1.2.6-1
1.2.6-2 00 K3 not yet stated X1, 1.2.6-2
1.2.6-3 00 K3 not yet stated X1, 1.2.6-3
1.2.6-4 10 K3 not yet stated X1, 1.2.6-4
1.2.6-5 05 informal not yet stated X1, 1.2.6-5
1.2.6-6 10 K3 not yet stated X1, 1.2.6-6
1.2.6-7 12 K2 not yet stated X1, 1.2.6-7
1.2.6-8 00 informal not yet stated X1, 1.2.6-8
1.2.6-9 01 K3 not yet stated X1, 1.2.6-9
1.2.6-10 25 M K1 not yet stated X1, 1.2.6-10
1.2.6-11 20 M K1 not yet stated X1, 1.2.6-11
1.2.6-12 22 M K2 not yet stated X1, 1.2.6-12
1.2.6-13 13 M K1 not yet stated X1, 1.2.6-13
1.2.6-14 21 M K3 not yet stated X1, 1.2.6-14
1.2.6-15 15 M K1 not yet stated X1, 1.2.6-15
1.2.6-16 15 M K1 not yet stated X1, 1.2.6-16
1.2.6-17 18 M K1 not yet stated X1, 1.2.6-17
1.2.6-18 15 M K1 not yet stated X1, 1.2.6-18
1.2.6-19 18 M K1 not yet stated X1, 1.2.6-19
1.2.6-20 20 M K1 not yet stated X1, 1.2.6-20
1.2.6-21 05 M informal not yet stated X1, 1.2.6-21
1.2.6-22 20 M K1 not yet stated X1, 1.2.6-22
1.2.6-23 13 M K1 not yet stated X1, 1.2.6-23
1.2.6-24 15 M informal not yet stated X1, 1.2.6-24
1.2.6-25 30 HM K1 not yet stated X1, 1.2.6-25
1.2.6-26 25 HM K1 not yet stated X1, 1.2.6-26
1.2.6-27 21 HM K1 not yet stated X1, 1.2.6-27
1.2.6-28 25 M K1 not yet stated X1, 1.2.6-28
1.2.6-29 20 M K1 not yet stated X1, 1.2.6-29
1.2.6-30 24 M K1 not yet stated X1, 1.2.6-30

The order to do them: start with 1.2.6-1 to 4, 6, 8 and 9, which are counts and the edge values of the triangle, and 1.2.6-5 and 7 for its shape. Exercises 1.2.6-10, 11 and 12 are the facts about divisibility by a prime, with Kummer's carry rule in 1.2.6-11. Exercises 1.2.6-13, 14, 15, 16 and 19 are the sums and the binomial theorem of eqs. (10) to (13), (18) and (23). Exercises 1.2.6-17, 18, 20 and 21 belong to Vandermonde's family, eqs. (21) to (25), and 1.2.6-29 links the polynomial rule (34) of the second file to exercise 1.2.3-33. The group 1.2.6-22, 23, 24, 25, 26, 27 and 28 is about Rothe's convolution and its generating functions: 22 to 24 are the proof sketched in the book and written out above, and 25 to 27 are the proof from the series ∑kAk(r,t)zk\sum_kA_k(r,t)z^k. Exercise 1.2.6-30 asks for the better way to solve Example 3, with (26) in place of the (28) route.

Lean

The Lean repository tamnd/taocp-lean at main (commit b48ef97) has the file TAOCP/V1/S1_2_6.lean. It states eqs. (3) to (15) and (17) to (21) as TAOCP.S1_2_6.eq3 to TAOCP.S1_2_6.eq21, over a field of characteristic zero, with natural numbers where the book needs them. Four of them are weaker than the book, and their Node lines say "partial". Eq. (12) states the closed form of the sum of squares only. Eq. (15) is the case of a natural exponent. Eqs. (18) and (21) take a natural nn. It has the definition TAOCP.binom for eq. (3), over a field and with an integer lower index, and the lemmas TAOCP.binom_natCast_right, TAOCP.binom_of_neg, TAOCP.binom_zero_right (the first value of eq. (4)), TAOCP.binom_natCast, TAOCP.binom_eq_ringChoose and TAOCP.binom_eq_fallingPow_div. The Stirling numbers of the second file are there too. Every other Node line of this file that has no Lean name says "not yet stated". The Mathlib names the statements use are listed here, each found in the source of Mathlib.

  • The coefficient: Nat.choose, with Nat.choose_eq_factorial_div_factorial, Nat.choose_symm, Nat.choose_succ_succ and Nat.choose_eq_descFactorial_div_factorial. The set of the combinations is Finset.powersetCard, with Finset.card_powersetCard.
  • The sums: Nat.sum_range_add_choose (eq. (10)) and Nat.sum_Icc_choose (eq. (11)).
  • The binomial theorem: add_pow for natural exponents, and binomialSeries for the generalized series of eq. (15).
  • The extension to a general upper index: Ring.choose, with Ring.choose_neg for eq. (17).
  • The alternating sum of eq. (18): Int.alternating_sum_range_choose_eq_choose.
  • Vandermonde's convolution, eq. (21): Nat.add_choose_eq.

Rothe's convolution (26) and its consequences (27) to (30) have no counterpart in Mathlib. The project will state them for Ring.choose over a field of characteristic zero, and the proof above, an induction on nn with a base value found by the negation formula, is the route to follow.

Notes and history

Pascal's treatise on the arithmetical triangle, written in the 1650s and printed in 1665, made the triangle famous in Europe, but it is much older. The Chinese mathematician Chu Shih-Chieh drew it in 1303 in a book that already presents the triangle as an old tool, and Yang Hui showed it in 1261, quoting an earlier source. In India Halayudha gave the triangle as a commentary on a rule for the number of metres in the tenth century, and Mahavira (about 850) and Bhaskara (1150) have rules for the number of combinations. The symbol (nk)\binom{n}{k} is from Andreas von Ettingshausen (1826).

Newton described the binomial series for an arbitrary exponent in letters of 1676, and Gauss studied the convergence of such series in 1812. Niels Henrik Abel proved his extension of the theorem in 1826, which is eq. (16). The convolution (21) was published by Alexandre Vandermonde in 1772. It is often named after him alone, but the book points out that Chu Shih-Chieh had it in 1303.

Heinrich August Rothe published (26) and (30) in 1793 in the book on the reversion of series. The history of these identities, which are rediscovered often, and their generalizations are collected in the paper of H. W. Gould and J. Kaucky in the Journal of Combinatorial Theory, volume 1 (1966). The identity (28) and the technique of Examples 2 and 3 show the advice of the book: complicate the sum on purpose when this lets a known identity apply.

The project has no errata of Section 1.2.6 to report for the first thirty equations.

Inversion, generalizations and Stirling numbers

Overview

This second file of Section 1.2.6 covers eqs. (31) to (60). It opens with Example 5, in which a sum of binomial coefficients is inverted with the help of eq. (33), and it turns the method into the polynomial rule (34) and its use (35). It then shows a few sums that do and do not have closed forms, (36) to (38), and the generalizations of the coefficient: hypergeometric series (39), the qq-nomial coefficient (40) and the multinomial coefficient (41) to (43). The last part is the Stirling numbers, which are the coefficients that convert between the powers xnx^n and the falling powers xn‾x^{\underline n}, eqs. (44) to (58), with their extension to a real upper index in (57) to (60). The proofs use only the first file, the falling powers of Section 1.2.5 and induction. Three claims lean on analysis that this chapter does not prove: the nonexistence of a closed form in (36), the convergence in (59) and the asymptotic series of the logarithm of the gamma function behind (60). Each of the three is marked where it occurs.

The ideas

Inversion by a sum that vanishes. Eq. (33) says that ∑k(rk)(kn)(−1)r−k\sum_k\binom{r}{k}\binom{k}{n}(-1)^{r-k} is 11 for n=rn = r and 00 otherwise. If a quantity is given as bk=∑j(kj)ajb_k = \sum_j\binom{k}{j}a_j, then multiplying by (rk)(−1)r−k\binom{r}{k}(-1)^{r-k} and summing over kk picks out ara_r. The same idea inverts the relation between the Stirling numbers of the two kinds.

A polynomial is a combination of binomial coefficients. The polynomials (k0),(k1),…,(kr)\binom{k}{0}, \binom{k}{1}, \ldots, \binom{k}{r} have degrees 0,1,…,r0, 1, \ldots, r, so every polynomial of degree at most rr in kk is a unique combination of them, and its coefficient on (kr)\binom{k}{r} is r!r! times the coefficient of krk^r. The same fact is true of 1,x1‾,x2‾,…1, x^{\underline 1}, x^{\underline 2}, \ldots, and it is the reason that the Stirling numbers are well defined.

Two polynomials that agree on the integers agree. A polynomial that vanishes at infinitely many integers is zero. Many identities below are proved for integer values of a parameter and then read as identities of polynomials. The step from a difference rule to a polynomial is the same each time: if p(r+1)−p(r)=q(r)p(r+1) - p(r) = q(r) for two polynomials and p(0)p(0) is given, then pp is determined.

Definitions, results and proofs

Example (the numbers ama_m with n!=∑kaknk‾n! = \sum_k a_k n^{\underline k}, TAOCP eq. 1.2.6(31)). There is exactly one sequence a0,a1,a2,…a_0, a_1, a_2, \ldots of rationals such that for every integer n≥0n \ge 0 n!=a0+a1n+a2n(n−1)+a3n(n−1)(n−2)+⋯ ,n! = a_0 + a_1n + a_2n(n-1) + a_3n(n-1)(n-2) + \cdots, and it is am=∑0≤j≤m(−1)j/j!a_m = \sum_{0 \le j \le m}(-1)^j/j!.

Node: TATGXMVC19 · status: not stated yet

Explanation. The sum on the right ends at k=nk = n, because nk‾=0n^{\underline k} = 0 for k>nk > n. So the equation for nn involves a0,…,ana_0, \ldots, a_n and the coefficient of ana_n is nn‾=n!≠0n^{\underline n} = n! \ne 0. This is a triangular system and it has a unique solution. The point of the example is to find the solution by a method that does not need a guess. The answer was stated without proof as eq. 1.2.5(11), and m! amm!\,a_m is the number of derangements of mm objects.

Example. The first values are a0,…,a5=1,0,12,13,38,1130a_0, \ldots, a_5 = 1, 0, \frac12, \frac13, \frac38, \frac{11}{30}. For n=3n = 3 the right side is a0+3a1+6a2+6a3=1+0+3+2=6=3!a_0 + 3a_1 + 6a_2 + 6a_3 = 1 + 0 + 3 + 2 = 6 = 3!.

Proof. Existence and uniqueness follow from the triangular shape. Since nk‾=k!(nk)n^{\underline k} = k!\binom{n}{k}, the equation reads n!=∑k(nk)k!akn! = \sum_k\binom{n}{k}k!a_k, which is eq. (32). Multiply by (mn)(−1)m−n\binom{m}{n}(-1)^{m-n} and sum over nn from 00 to mm. The right side becomes ∑kk!ak∑n(mn)(nk)(−1)m−n\sum_k k!a_k\sum_n\binom{m}{n}\binom{n}{k}(-1)^{m-n}, and the inner sum is δkm\delta_{km} by (33). So ∑nn!(mn)(−1)m−n=m!am\sum_n n!\binom{m}{n}(-1)^{m-n} = m!a_m. Divide by m!m! and use (mn)n!/m!=1/(m−n)!\binom{m}{n}n!/m! = 1/(m-n)!: am=∑n=0m(−1)m−n/(m−n)!=∑j=0m(−1)j/j!a_m = \sum_{n=0}^{m}(-1)^{m-n}/(m-n)! = \sum_{j=0}^{m}(-1)^j/j!. □\square

Lemma (the binomial form of Example 5, TAOCP eq. 1.2.6(32)). For every integer n≥0n \ge 0, n!=∑k(nk)k! ak.n! = \sum_k\binom{n}{k}k!\,a_k.

Node: TA3X6XPRCT · status: not stated yet

Explanation. It is the same equation as (31), with the falling power written as a binomial coefficient. In this form the unknown bk=k!akb_k = k!a_k appears in a convolution that is of the type of eq. (33), which is the reason for the rewriting. It is an instance of the general relation cn=∑k(nk)bkc_n = \sum_k\binom{n}{k}b_k between a sequence and its binomial transform, and eq. (33) will give the inverse transform.

Example. The numbers k!akk!a_k are 1,0,1,2,9,441, 0, 1, 2, 9, 44, the derangement numbers. For n=4n = 4: (40)⋅1+(42)⋅1+(43)⋅2+(44)⋅9=1+6+8+9=24=4!\binom40 \cdot 1 + \binom42 \cdot 1 + \binom43 \cdot 2 + \binom44 \cdot 9 = 1 + 6 + 8 + 9 = 24 = 4!.

Proof. By eq. 1.2.5(2) and the definition (3), nk‾=n(n−1)⋯(n−k+1)=k!(nk)n^{\underline k} = n(n-1)\cdots(n-k+1) = k!\binom{n}{k} for every integer k≥0k \ge 0. Put this in (31). □\square

Theorem (the inversion sum, TAOCP eq. 1.2.6(33)). For integers r≥0r \ge 0 and nn, ∑k(rk)(kn)(−1)r−k=(0n−r)=δnr.\sum_k\binom{r}{k}\binom{k}{n}(-1)^{r-k} = \binom{0}{n-r} = \delta_{nr}.

Node: TA6WYX552Z · status: not stated yet

Explanation. It is eq. (23) with s=0s = 0. The sum is nonzero only when the two indices match, so it acts as a Kronecker delta in the variable nn. If a sequence is given by br=∑n(rn)anb_r = \sum_n\binom{r}{n}a_n, then ∑r(mr)(−1)m−rbr=am\sum_r\binom{m}{r}(-1)^{m-r}b_r = a_m, which is the inversion of the binomial transform used in Example 5.

Example. For r=4r = 4 and n=2n = 2: (42)(22)−(43)(32)+(44)(42)=6−12+6=0\binom{4}{2}\binom22 - \binom{4}{3}\binom32 + \binom44\binom42 = 6 - 12 + 6 = 0. For r=n=3r = n = 3 the sum is (33)(33)=1\binom33\binom33 = 1, since the terms with k<3k < 3 vanish.

Proof. Put s=0s = 0 in (23): ∑k(rk)(kn)(−1)r−k=(0n−r)\sum_k\binom{r}{k}\binom{k}{n}(-1)^{r-k} = \binom{0}{n-r}. The value of (0j)\binom{0}{j} is 11 for j=0j = 0 and 00 for any other integer jj, by definition (3) for j>0j > 0 and because (0j)=0\binom{0}{j} = 0 for j<0j < 0. □\square

Theorem (the polynomial rule, TAOCP eq. 1.2.6(34)). For an integer r≥0r \ge 0 and any numbers b0,…,brb_0, \ldots, b_r, ∑k(rk)(−1)r−k(b0+b1k+⋯+brkr)=r! br.\sum_k\binom{r}{k}(-1)^{r-k}(b_0 + b_1k + \cdots + b_rk^r) = r!\,b_r.

Node: TARZSHY1GN · status: not stated yet

Explanation. It says that the rrth difference of a polynomial of degree at most rr is the constant r!r! times its leading coefficient. Taking br=0b_r = 0 shows that the rrth difference of a polynomial of lower degree is zero. This is what the proof of Rothe's convolution in the first file uses. Exercise 29 of the book asks for the connection with Exercise 1.2.3-33.

Example. For r=3r = 3 and p(k)=2k3+k2−5p(k) = 2k^3 + k^2 - 5 the sum is −p(0)+3p(1)−3p(2)+p(3)-p(0) + 3p(1) - 3p(2) + p(3). The values of pp at 0,1,2,30, 1, 2, 3 are −5,−2,15,58-5, -2, 15, 58, so the sum is 5−6−45+58=12=3!⋅25 - 6 - 45 + 58 = 12 = 3! \cdot 2.

Proof. The polynomials (kj)\binom{k}{j} for 0≤j≤r0 \le j \le r have degree jj and leading coefficient 1/j!1/j!, so they form a basis of the polynomials of degree at most rr: subtract a multiple of (kr)\binom{k}{r} to remove krk^r, then of (kr−1)\binom{k}{r-1}, and so on. Hence p(k)=∑j=0rcj(kj)p(k) = \sum_{j=0}^{r}c_j\binom{k}{j} and cr=r! brc_r = r!\,b_r since only (kr)\binom{k}{r} has degree rr. By (33), ∑k(rk)(−1)r−k(kj)=δjr\sum_k\binom{r}{k}(-1)^{r-k}\binom{k}{j} = \delta_{jr}, so the sum is crc_r. □\square

Theorem (a sum that equals a power, TAOCP eq. 1.2.6(35)). For an integer r≥0r \ge 0 and real ss, tt, ∑k(rk)(s−ktr)(−1)k=tr.\sum_k\binom{r}{k}\binom{s-kt}{r}(-1)^k = t^r.

Node: TA1K1VBZZA · status: not stated yet

Explanation. Rule (34) settles many sums of this shape in one line. This is the model case. The coefficient (s−ktr)\binom{s-kt}{r} is a polynomial in kk of degree rr, so (34) applies and only the leading coefficient matters.

Example. For r=3r = 3, s=10s = 10, t=2t = 2: the terms (−1)k(3k)(10−2k3)(-1)^k\binom{3}{k}\binom{10-2k}{3} are 120120, −3⋅56=−168-3 \cdot 56 = -168, 3⋅20=603 \cdot 20 = 60, −(43)=−4-\binom{4}{3} = -4, and the sum is 8=238 = 2^3.

Proof. The leading term of (s−ktr)\binom{s-kt}{r} in kk is (−t)rkr/r!(-t)^rk^r/r!, so its leading coefficient is br=(−t)r/r!b_r = (-t)^r/r!. By (34), ∑k(rk)(−1)r−k(s−ktr)=r! br=(−t)r\sum_k\binom{r}{k}(-1)^{r-k}\binom{s-kt}{r} = r!\,b_r = (-t)^r. Multiply by (−1)r(-1)^r to turn the sign (−1)r−k(-1)^{r-k} into (−1)k(-1)^k. □\square

Observation (the partial row sum, TAOCP eq. 1.2.6(36)). For integers 0≤n<m0 \le n < m the sum ∑k=0n(mk)\sum_{k=0}^{n}\binom{m}{k} has no known simple closed form in mm and nn.

Node: TA0Z00TTE3 · status: not stated yet

Explanation. The sum of the whole row is 2m2^m by (13) with x=y=1x = y = 1 and the alternating sum of a row is given by (18), but the partial sum is not a known simple expression. The book does not prove its impossibility either. It points to the algorithm of Gosper and Zeilberger, which decides whether a sum of this type has a closed form in the class of hypergeometric terms and which gives a negative answer here. C1 does not prove that statement. What it proves is the exact recurrence that the sum satisfies, which shows that the sum is simple only in the sense of a recurrence.

Example. For m=6m = 6 the partial sums for n=0,…,6n = 0, \ldots, 6 are 1,7,22,42,57,63,641, 7, 22, 42, 57, 63, 64. The last one is 262^6. The recurrence below gives S(7,2)=2⋅22−15=29S(7, 2) = 2 \cdot 22 - 15 = 29, which is 1+7+211 + 7 + 21.

Proof. Write S(m,n)=∑k=0n(mk)S(m, n) = \sum_{k=0}^{n}\binom{m}{k}. By the addition formula (9), S(m+1,n)=∑k=0n(mk)+∑k=0n(mk−1)=S(m,n)+S(m,n−1)=2S(m,n)−(mn)S(m+1, n) = \sum_{k=0}^{n}\binom{m}{k} + \sum_{k=0}^{n}\binom{m}{k-1} = S(m, n) + S(m, n-1) = 2S(m, n) - \binom{m}{n}. It does not give a closed form, because the term (mn)\binom{m}{n} is added in each step. The nonexistence of a closed form is the theorem of the Gosper and Zeilberger method, which is cited and not proved here. □\square

Theorem (a partial sum for a negative upper index, TAOCP eq. 1.2.6(37)). For an integer n≥0n \ge 0, ∑k=0n(−2k)=(−1)n⌈n+12⌉.\sum_{k=0}^{n}\binom{-2}{k} = (-1)^n\left\lceil\frac{n+1}{2}\right\rceil.

Node: TAWB5TM9W8 · status: proved

Explanation. When the upper index is a negative integer, the coefficients are polynomials in kk with alternating signs and the partial sums are explicit. The simplest case is m=−2m = -2.

Example. For n=4n = 4 the terms are 1,−2,3,−4,51, -2, 3, -4, 5 and the sum is 3=(+1)⌈5/2⌉3 = (+1)\lceil 5/2\rceil. For n=5n = 5 the sum is 3−6=−3=−⌈6/2⌉3 - 6 = -3 = -\lceil 6/2\rceil.

Proof. By (17), (−2k)=(−1)k(k+1k)=(−1)k(k+1)\binom{-2}{k} = (-1)^k\binom{k+1}{k} = (-1)^k(k+1). Let sns_n be the sum. For n=0n = 0, s0=1=⌈1/2⌉s_0 = 1 = \lceil 1/2\rceil. Suppose the formula holds for nn and add the term (−1)n+1(n+2)(-1)^{n+1}(n+2). If nn is even, sn=n2+1s_n = \frac n2 + 1, so sn+1=n2+1−(n+2)=−(n2+1)=−⌈n+22⌉s_{n+1} = \frac n2 + 1 - (n+2) = -(\frac n2 + 1) = -\lceil\frac{n+2}{2}\rceil. If nn is odd, sn=−n+12s_n = -\frac{n+1}{2}, so sn+1=−n+12+n+2=n+32=⌈n+22⌉s_{n+1} = -\frac{n+1}{2} + n + 2 = \frac{n+3}{2} = \lceil\frac{n+2}{2}\rceil. □\square

Theorem (a partial sum with a linear weight, TAOCP eq. 1.2.6(38)). For real mm and an integer n≥0n \ge 0, ∑k=0n(mk)(k−m2)=−m2(m−1n).\sum_{k=0}^{n}\binom{m}{k}\left(k - \frac m2\right) = -\frac m2\binom{m-1}{n}.

Node: TAH8VPQ8EZ · status: proved

Explanation. This partial sum has the same shape as (36), but it has a closed form, because the weight k−m/2k - m/2 is the one that makes the sum telescope. The two partial sums of the row that occur cancel except for a boundary term.

Example. For m=6m = 6 and n=2n = 2 the terms are −3-3, 6⋅(−2)=−126 \cdot (-2) = -12 and 15⋅(−1)=−1515 \cdot (-1) = -15, with sum −30-30. The right side is −3(52)=−30-3\binom{5}{2} = -30.

Proof. Let Aj=∑k=0j(m−1k)A_j = \sum_{k=0}^{j}\binom{m-1}{k}, with A−1=0A_{-1} = 0. By (7), k(mk)=m(m−1k−1)k\binom{m}{k} = m\binom{m-1}{k-1}, so ∑k=0nk(mk)=mAn−1\sum_{k=0}^{n}k\binom{m}{k} = mA_{n-1}. By (9), ∑k=0n(mk)=An+An−1\sum_{k=0}^{n}\binom{m}{k} = A_n + A_{n-1}. Hence the sum is mAn−1−m2(An+An−1)=m2(An−1−An)=−m2(m−1n)mA_{n-1} - \frac m2(A_n + A_{n-1}) = \frac m2(A_{n-1} - A_n) = -\frac m2\binom{m-1}{n}. □\square

Definition (hypergeometric series, TAOCP eq. 1.2.6(39)). For numbers a1,…,ama_1, \ldots, a_m, b1,…,bnb_1, \ldots, b_n and a variable zz, F ⁣(a1,…,amb1,…,bn | z)=∑k≥0a1k‾⋯amk‾b1k‾⋯bnk‾zkk!.F\!\left(\begin{matrix}a_1, \ldots, a_m\\ b_1, \ldots, b_n\end{matrix}\,\middle|\,z\right) = \sum_{k \ge 0}\frac{a_1^{\overline k}\cdots a_m^{\overline k}}{b_1^{\overline k}\cdots b_n^{\overline k}}\frac{z^k}{k!}.

Node: TATAWVWG6A · status: not stated yet

Explanation. This is a definition and it has nothing to prove, but two of its cases show what it does. The numerator and the denominator use the rising powers of eq. 1.2.5(19). With the single upper parameter aa and no lower parameter, the series is (1−z)−a(1-z)^{-a}, and with a=−na = -n it ends after n+1n + 1 terms. The book recommends hypergeometric series as the systematic tool for sums of binomial coefficients: a sum ∑ktk\sum_kt_k with tk+1/tkt_{k+1}/t_k a rational function of kk is a series of this kind.

Example. F(2∣12)=∑k≥02k‾k!2−k=∑k≥0(k+1)2−k=4=(1−12)−2F(2\mid\frac12) = \sum_{k \ge 0}\frac{2^{\overline k}}{k!}2^{-k} = \sum_{k \ge 0}(k+1)2^{-k} = 4 = (1 - \frac12)^{-2}. And F(−3∣z)=1−3z+3z2−z3=(1−z)3F(-3\mid z) = 1 - 3z + 3z^2 - z^3 = (1-z)^3.

Proof. For one upper parameter, ak‾/k!=(a+k−1k)=(−1)k(−ak)a^{\overline k}/k! = \binom{a+k-1}{k} = (-1)^k\binom{-a}{k} by (17) (the rising power ak‾=a(a+1)⋯(a+k−1)a^{\overline k} = a(a+1)\cdots(a+k-1) equals (a+k−1)k‾(a+k-1)^{\underline k}). So F(a∣z)=∑k(−ak)(−z)k=(1−z)−aF(a\mid z) = \sum_k\binom{-a}{k}(-z)^k = (1-z)^{-a} for ∣z∣<1|z| < 1 by the binomial series (15). For a=−na = -n with n≥0n \ge 0 an integer, (−n)k‾=(−1)knk‾(-n)^{\overline k} = (-1)^kn^{\underline k} and it vanishes for k>nk > n, which gives ∑k=0n(nk)(−z)k=(1−z)n\sum_{k=0}^{n}\binom{n}{k}(-z)^k = (1-z)^n. □\square

Definition (the qq-nomial coefficient, TAOCP eq. 1.2.6(40)). For a real number rr, an integer k≥0k \ge 0 and a number q≠1q \ne 1 such that no factor of the denominator is zero, the qq-nomial coefficient is (rk)q=(1−qr)(1−qr−1)⋯(1−qr−k+1)(1−qk)(1−qk−1)⋯(1−q).\binom{r}{k}_q = \frac{(1-q^r)(1-q^{r-1})\cdots(1-q^{r-k+1})}{(1-q^k)(1-q^{k-1})\cdots(1-q)}.

Node: TA79DJC3AM · status: not stated yet

Explanation. The claim of the book is that (rk)q→(rk)\binom{r}{k}_q \to \binom{r}{k} when q→1q \to 1. The qq-nomial coefficient replaces each integer jj of the product of (3) by the quotient (1−qj)/(1−q)(1-q^j)/(1-q). For an integer r=n≥kr = n \ge k the coefficient is a polynomial in qq, and its coefficients count the combinations by a statistic. The book sends the properties, including the qq-nomial theorem ∏j=0n−1(1+qjx)=∑kqk(k−1)/2(nk)qxk\prod_{j=0}^{n-1}(1 + q^jx) = \sum_k q^{k(k-1)/2}\binom{n}{k}_qx^k, to Exercise 58. This chapter proves only what the display claims, the limit.

Example. For r=4r = 4 and k=2k = 2: (42)q=(1−q4)(1−q3)(1−q2)(1−q)=(1+q2)(1+q+q2)=1+q+2q2+q3+q4\binom{4}{2}_q = \frac{(1-q^4)(1-q^3)}{(1-q^2)(1-q)} = (1+q^2)(1+q+q^2) = 1 + q + 2q^2 + q^3 + q^4. At q=1q = 1 this is 6=(42)6 = \binom{4}{2}.

Proof. For a real number aa, lim⁡q→11−qa1−q=a\lim_{q \to 1}\frac{1-q^a}{1-q} = a, because the quotient qa−1q−1\frac{q^a - 1}{q - 1} is a difference quotient of q↦qaq \mapsto q^a at q=1q = 1 and the derivative of qaq^a at 11 is aa. Divide the top and the bottom of each of the kk factors by 1−q1 - q, as 1−qr−i1−qk−i=(1−qr−i)/(1−q)(1−qk−i)/(1−q)\frac{1-q^{r-i}}{1-q^{k-i}} = \frac{(1-q^{r-i})/(1-q)}{(1-q^{k-i})/(1-q)} for 0≤i<k0 \le i < k. The limit is ∏i=0k−1r−ik−i=rk‾k!=(rk)\prod_{i=0}^{k-1}\frac{r-i}{k-i} = \frac{r^{\underline k}}{k!} = \binom{r}{k}. □\square

Definition (the multinomial coefficient, TAOCP eq. 1.2.6(41)). For integers k1,…,km≥0k_1, \ldots, k_m \ge 0, (k1+k2+⋯+kmk1,k2,…,km)=(k1+k2+⋯+km)!k1! k2!⋯km!.\binom{k_1 + k_2 + \cdots + k_m}{k_1, k_2, \ldots, k_m} = \frac{(k_1 + k_2 + \cdots + k_m)!}{k_1!\,k_2!\cdots k_m!}.

Node: TAEWGC3KRA · Lean: Nat.multinomial, from Mathlib · status: proved

Explanation. For m=2m = 2 it is the binomial coefficient (k1+k2k1)\binom{k_1+k_2}{k_1}. The meaning is the number of words of length n=k1+⋯+kmn = k_1 + \cdots + k_m that have exactly kik_i letters of the iith kind. Mathlib has the same quantity as Nat.multinomial s f, and its defining property is Nat.multinomial_spec.

Example. The letters of the word ABCCABCC can be arranged in 4!1! 1! 2!=12\frac{4!}{1!\,1!\,2!} = 12 ways. For (k1,k2,k3)=(2,2,1)(k_1, k_2, k_3) = (2, 2, 1) the coefficient is 5!2! 2! 1!=30\frac{5!}{2!\,2!\,1!} = 30.

Proof. Take the n!n! orderings of nn distinct letters, with kik_i of them marked with the color ii. Two orderings give the same word of colors exactly when one is got from the other by permuting the letters inside each color class. Each word of colors comes from k1!⋯km!k_1!\cdots k_m! orderings, so the number of words is the quotient. □\square

Theorem (the multinomial theorem, TAOCP eq. 1.2.6(42)). For an integer n≥0n \ge 0 and elements x1,…,xmx_1, \ldots, x_m of a commutative ring, (x1+x2+⋯+xm)n=∑k1+⋯+km=n(nk1,k2,…,km)x1k1x2k2⋯xmkm.(x_1 + x_2 + \cdots + x_m)^n = \sum_{k_1 + \cdots + k_m = n}\binom{n}{k_1, k_2, \ldots, k_m}x_1^{k_1}x_2^{k_2}\cdots x_m^{k_m}.

Node: TAB75G84QN · Lean: Finset.sum_pow_eq_sum_piAntidiag, from Mathlib · status: proved

Explanation. It extends the binomial theorem (13) to mm terms, and the sum is over the mm-tuples of nonnegative integers with sum nn. The coefficient counts the ways to choose from which factors of the product each xix_i is taken.

Example. For m=3m = 3 and n=3n = 3 the coefficients are 11 (for xi3x_i^3, three terms), 33 (for xi2xjx_i^2x_j, six terms) and 66 (for x1x2x3x_1x_2x_3), and 3⋅1+6⋅3+6=27=333 \cdot 1 + 6 \cdot 3 + 6 = 27 = 3^3, the value at x1=x2=x3=1x_1 = x_2 = x_3 = 1.

Proof. Induction on mm. For m=1m = 1 both sides are x1nx_1^n. For m≥2m \ge 2 apply (13) to (x1+⋯+xm−1)+xm(x_1 + \cdots + x_{m-1}) + x_m: the power is ∑j=0n(nj)(x1+⋯+xm−1)jxmn−j\sum_{j=0}^{n}\binom{n}{j}(x_1 + \cdots + x_{m-1})^jx_m^{n-j}. By the case m−1m - 1, (x1+⋯+xm−1)j=∑k1+⋯+km−1=jj!k1!⋯km−1!x1k1⋯xm−1km−1(x_1 + \cdots + x_{m-1})^j = \sum_{k_1 + \cdots + k_{m-1} = j}\frac{j!}{k_1!\cdots k_{m-1}!}x_1^{k_1}\cdots x_{m-1}^{k_{m-1}}. Put km=n−jk_m = n - j. Then (nj)j!k1!⋯km−1!=n!j! (n−j)!j!k1!⋯km−1!=n!k1!⋯km!\binom{n}{j}\frac{j!}{k_1!\cdots k_{m-1}!} = \frac{n!}{j!\,(n-j)!}\frac{j!}{k_1!\cdots k_{m-1}!} = \frac{n!}{k_1!\cdots k_m!}, and the pairs (j,(k1,…,km−1))(j, (k_1, \ldots, k_{m-1})) correspond to the tuples (k1,…,km)(k_1, \ldots, k_m) with sum nn. □\square

Theorem (the multinomial coefficient as a product of binomial coefficients, TAOCP eq. 1.2.6(43)). For integers k1,…,km≥0k_1, \ldots, k_m \ge 0, (k1+⋯+kmk1,…,km)=(k1+k2k1)(k1+k2+k3k1+k2)⋯(k1+⋯+kmk1+⋯+km−1).\binom{k_1 + \cdots + k_m}{k_1, \ldots, k_m} = \binom{k_1+k_2}{k_1}\binom{k_1+k_2+k_3}{k_1+k_2}\cdots\binom{k_1+\cdots+k_m}{k_1+\cdots+k_{m-1}}.

Node: TA2EH1FR0F · status: proved

Explanation. It shows that every multinomial coefficient is an integer and that the methods for binomial coefficients apply. The book notes that both sides of the product rule (20) are the trinomial coefficient (rk, m−k, r−m)\binom{r}{k,\,m-k,\,r-m}.

Example. For (k1,k2,k3)=(1,1,2)(k_1, k_2, k_3) = (1, 1, 2) the right side is (21)(42)=2⋅6=12\binom{2}{1}\binom{4}{2} = 2 \cdot 6 = 12, which is the value of 4!1! 1! 2!\frac{4!}{1!\,1!\,2!}.

Proof. Let Sj=k1+⋯+kjS_j = k_1 + \cdots + k_j with S0=0S_0 = 0. The jjth factor of the product is (SjSj−1)=Sj!Sj−1! kj!\binom{S_j}{S_{j-1}} = \frac{S_j!}{S_{j-1}!\,k_j!}. The factor Sj−1!S_{j-1}! of the jjth term cancels the factor Sj−1!S_{j-1}! in the numerator of the (j−1)(j-1)st, and the product is Sm!S0! k1!⋯km!=Sm!k1!⋯km!\frac{S_m!}{S_0!\,k_1!\cdots k_m!} = \frac{S_m!}{k_1!\cdots k_m!}. □\square

Definition (the Stirling numbers of the first kind, TAOCP eq. 1.2.6(44)). The numbers [nk]\left[{n \atop k}\right], which are nonnegative integers with [nk]=0\left[{n \atop k}\right] = 0 unless 0≤k≤n0 \le k \le n and with [nn]=1\left[{n \atop n}\right] = 1, are defined by xn‾=x(x−1)⋯(x−n+1)=∑k(−1)n−k[nk]xk.x^{\underline n} = x(x-1)\cdots(x-n+1) = \sum_k(-1)^{n-k}\left[{n \atop k}\right]x^k.

Node: TAM0WWAGGJ · Lean: TAOCP.stirling1 · status: proved

Explanation. The numbers are the absolute values of the coefficients of the polynomial xn‾x^{\underline n} in the powers of xx, so that the sign (−1)n−k(-1)^{n-k} is taken out. They count the permutations of nn objects that have kk cycles (Exercise 64 for the second kind has the analogous meaning). The table of the book has them for n≤8n \le 8, with [5k]=0,24,50,35,10,1\left[{5 \atop k}\right] = 0, 24, 50, 35, 10, 1 for k=0,…,5k = 0, \ldots, 5. In Lean, TAOCP.stirling1 is an alias of the unsigned Nat.stirlingFirst of Mathlib.

Example. From the row n=4n = 4 of the table, (x4)=x4‾4!=124(x4−6x3+11x2−6x)\binom{x}{4} = \frac{x^{\underline 4}}{4!} = \frac{1}{24}(x^4 - 6x^3 + 11x^2 - 6x). The numbers for n=3n = 3 are 0,2,3,10, 2, 3, 1 and x(x−1)(x−2)=x3−3x2+2xx(x-1)(x-2) = x^3 - 3x^2 + 2x.

Proof. The product xn‾x^{\underline n} is a monic polynomial of degree nn with integer coefficients, so the numbers exist, are integers, and [nn]=1\left[{n \atop n}\right] = 1. The coefficient of x0x^0 is 00 for n≥1n \ge 1, as xx is a factor. The sign (−1)n−k(-1)^{n-k} and the nonnegativity follow from the recurrence [n+1m]=n[nm]+[nm−1]\left[{n+1 \atop m}\right] = n\left[{n \atop m}\right] + \left[{n \atop m-1}\right], which is derived in the proof of (46) from the identity xn+1‾=xn‾(x−n)x^{\underline{n+1}} = x^{\underline n}(x-n) alone and which gives the claim by induction on nn. □\square

Theorem (the Stirling numbers of the second kind, TAOCP eq. 1.2.6(45)). For every integer n≥0n \ge 0 there are unique numbers {nk}\left\{{n \atop k}\right\}, nonnegative integers that are zero unless 0≤k≤n0 \le k \le n and with {nn}=1\left\{{n \atop n}\right\} = 1, such that xn=∑k{nk}xk‾.x^n = \sum_k\left\{{n \atop k}\right\}x^{\underline k}.

Node: TA8J6AGPPG · Lean: TAOCP.stirling2 · status: proved

Explanation. The numbers convert the ordinary powers into the falling powers. Stirling introduced them in 1730 for this use. They count the partitions of an nn-element set into kk nonempty blocks (Exercise 64), and TAOCP.stirling2 is an alias of Nat.stirlingSecond, with the statement of (45) in Mathlib as Nat.pow_eq_sum_stirlingSecond_mul_descFactorial for natural xx.

Example. x4=x4‾+6x3‾+7x2‾+x1‾x^4 = x^{\underline 4} + 6x^{\underline 3} + 7x^{\underline 2} + x^{\underline 1}, from the row {4k}=0,1,7,6,1\left\{{4 \atop k}\right\} = 0, 1, 7, 6, 1. In the binomial basis, x4=24(x4)+36(x3)+14(x2)+(x1)x^4 = 24\binom{x}{4} + 36\binom{x}{3} + 14\binom{x}{2} + \binom{x}{1}, as xk‾=k!(xk)x^{\underline k} = k!\binom{x}{k}. At x=3x = 3 the term x4‾x^{\underline 4} is 00, and 6⋅6+7⋅6+3=81=346 \cdot 6 + 7 \cdot 6 + 3 = 81 = 3^4.

Proof. The polynomials x0‾,x1‾,…,xn‾x^{\underline 0}, x^{\underline 1}, \ldots, x^{\underline n} are monic of degrees 0,…,n0, \ldots, n, so they are a basis of the polynomials of degree at most nn, over the integers, by the same reduction as in (34). The monic xnx^n has unique coefficients, and the coefficient of xn‾x^{\underline n} is 11. Nonnegativity is proved with the recurrence of (46). □\square

Theorem (the addition formulas, TAOCP eq. 1.2.6(46)). For integers n,m≥0n, m \ge 0, with [0m]={0m}=δm0\left[{0 \atop m}\right] = \left\{{0 \atop m}\right\} = \delta_{m0} and the value 00 for a negative lower index, [n+1m]=n[nm]+[nm−1],{n+1m}=m{nm}+{nm−1}.\left[{n+1 \atop m}\right] = n\left[{n \atop m}\right] + \left[{n \atop m-1}\right],\qquad\left\{{n+1 \atop m}\right\} = m\left\{{n \atop m}\right\} + \left\{{n \atop m-1}\right\}.

Node: TAW9C17PC7 · Lean: TAOCP.stirling1_succ_succ, TAOCP.stirling2_succ_succ · status: proved

Explanation. They are the Stirling analogues of Pascal's rule (9), and they build the two triangles of the book row by row. The Lean statements are the same recurrences with m=k+1m = k + 1.

Example. From [4k]=0,6,11,6,1\left[{4 \atop k}\right] = 0, 6, 11, 6, 1: [53]=4⋅6+11=35\left[{5 \atop 3}\right] = 4 \cdot 6 + 11 = 35. From {4k}=0,1,7,6,1\left\{{4 \atop k}\right\} = 0, 1, 7, 6, 1: {53}=3⋅6+7=25\left\{{5 \atop 3}\right\} = 3 \cdot 6 + 7 = 25.

Proof. First kind: xn+1‾=xn‾(x−n)x^{\underline{n+1}} = x^{\underline n}(x - n). Write cn,k=(−1)n−k[nk]c_{n,k} = (-1)^{n-k}\left[{n \atop k}\right] for the coefficient of xkx^k in xn‾x^{\underline n}. Comparing the coefficients of xmx^m in xn+1‾=x⋅xn‾−n xn‾x^{\underline{n+1}} = x\cdot x^{\underline n} - n\,x^{\underline n} gives cn+1,m=cn,m−1−ncn,mc_{n+1,m} = c_{n,m-1} - nc_{n,m}, that is, (−1)n+1−m[n+1m]=(−1)n+1−m[nm−1]+(−1)n+1−mn[nm](-1)^{n+1-m}\left[{n+1 \atop m}\right] = (-1)^{n+1-m}\left[{n \atop m-1}\right] + (-1)^{n+1-m}n\left[{n \atop m}\right]. This is the first formula. For n=0n = 0, x1‾=xx^{\underline 1} = x gives [1m]=δm1\left[{1 \atop m}\right] = \delta_{m1}, and the formula for n=0n = 0 reads [1m]=0+[0m−1]=δm1\left[{1 \atop m}\right] = 0 + \left[{0 \atop m-1}\right] = \delta_{m1}. Since [0m]=δm0\left[{0 \atop m}\right] = \delta_{m0}, induction on nn shows that all the numbers are nonnegative integers, which also completes the proof of (44).

Second kind: for each kk, x⋅xk‾=xk+1‾+kxk‾x\cdot x^{\underline k} = x^{\underline{k+1}} + kx^{\underline k}, because x=(x−k)+kx = (x - k) + k. Then xn+1=x∑k{nk}xk‾=∑k{nk}(xk+1‾+kxk‾)x^{n+1} = x\sum_k\left\{{n \atop k}\right\}x^{\underline k} = \sum_k\left\{{n \atop k}\right\}(x^{\underline{k+1}} + kx^{\underline k}). The coefficient of xm‾x^{\underline m} is {nm−1}+m{nm}\left\{{n \atop m-1}\right\} + m\left\{{n \atop m}\right\}. By the uniqueness of the expansion (45) it is {n+1m}\left\{{n+1 \atop m}\right\}. Induction on nn from x0=x0‾x^0 = x^{\underline 0} gives the nonnegativity and the integrality. □\square

Theorem (the two inversion formulas, TAOCP eq. 1.2.6(47)). For integers m,n≥0m, n \ge 0, ∑k[nk]{km}(−1)n−k=δmn,∑k{nk}[km](−1)n−k=δmn.\sum_k\left[{n \atop k}\right]\left\{{k \atop m}\right\}(-1)^{n-k} = \delta_{mn},\qquad\sum_k\left\{{n \atop k}\right\}\left[{k \atop m}\right](-1)^{n-k} = \delta_{mn}.

Node: TAT1JHV93G · status: not stated yet

Explanation. It says that the two triangles, with the signs of (44) attached to the first, are inverse matrices. It is the Stirling counterpart of (33), which says the same of Pascal's triangle with alternating signs. The sign in the second sum can be (−1)n−k(-1)^{n-k} or (−1)k−m(-1)^{k-m}, as the two differ by the constant (−1)n−m(-1)^{n-m}, which is 11 when m=nm = n.

Example. For n=5n = 5, m=2m = 2: ∑k[5k]{k2}(−1)5−k\sum_k\left[{5 \atop k}\right]\left\{{k \atop 2}\right\}(-1)^{5-k} has the terms k=2k = 2: −50⋅1-50 \cdot 1; k=3k = 3: +35⋅3+35 \cdot 3; k=4k = 4: −10⋅7-10 \cdot 7; k=5k = 5: +1⋅15+1 \cdot 15, and −50+105−70+15=0-50 + 105 - 70 + 15 = 0. For m=n=5m = n = 5 the sum is 11.

Proof. Put the expansion (45) into (44): xn‾=∑k(−1)n−k[nk]xk=∑k(−1)n−k[nk]∑m{km}xm‾x^{\underline n} = \sum_k(-1)^{n-k}\left[{n \atop k}\right]x^k = \sum_k(-1)^{n-k}\left[{n \atop k}\right]\sum_m\left\{{k \atop m}\right\}x^{\underline m}. Since the expansion of xn‾x^{\underline n} in the falling powers is unique, the coefficient of xm‾x^{\underline m} is δmn\delta_{mn}, which is the first formula. In the same way, put (44) into (45): xn=∑k{nk}∑m(−1)k−m[km]xmx^n = \sum_k\left\{{n \atop k}\right\}\sum_m(-1)^{k-m}\left[{k \atop m}\right]x^m, and the uniqueness of the expansion in powers gives ∑k{nk}(−1)k−m[km]=δmn\sum_k\left\{{n \atop k}\right\}(-1)^{k-m}\left[{k \atop m}\right] = \delta_{mn}. When m=nm = n the signs (−1)k−m(-1)^{k-m} and (−1)n−k(-1)^{n-k} agree, and when m≠nm \ne n both sides vanish. □\square

Theorem (the special values at the edge of the triangles, TAOCP eq. 1.2.6(48)). For every integer n≥0n \ge 0, (0n)=[0n]={0n}=δn0,(nn)=[nn]={nn}=1.\binom{0}{n} = \left[{0 \atop n}\right] = \left\{{0 \atop n}\right\} = \delta_{n0},\qquad\binom{n}{n} = \left[{n \atop n}\right] = \left\{{n \atop n}\right\} = 1.

Node: TAZZEGMXBK · status: proved

Explanation. The first row of each triangle is the unit row, as for Pascal's triangle, and the diagonal is 11.

Example. (03)=0\binom{0}{3} = 0, [00]=1\left[{0 \atop 0}\right] = 1, {44}=1\left\{{4 \atop 4}\right\} = 1, and for n=4n = 4 the coefficient of x4x^4 in both expansions is 11.

Proof. For n=0n = 0, x0‾=1=x0x^{\underline 0} = 1 = x^0, so [0k]\left[{0 \atop k}\right] and {0k}\left\{{0 \atop k}\right\} are 11 for k=0k = 0 and 00 otherwise. The value of (0n)\binom{0}{n} is the same by (3). The numbers [nn]\left[{n \atop n}\right] and {nn}\left\{{n \atop n}\right\} are the leading coefficients of two monic polynomials, hence 11. (nn)=1\binom{n}{n} = 1 by (6). □\square

Theorem (the next diagonal, TAOCP eq. 1.2.6(49)). For every integer n≥0n \ge 0, [nn−1]={nn−1}=(n2).\left[{n \atop n-1}\right] = \left\{{n \atop n-1}\right\} = \binom{n}{2}.

Node: TAZ34427QM · status: proved

Explanation. It is the first instance of the polynomial behavior of [nn−m]\left[{n \atop n-m}\right] in nn that the book describes after (56). Mathlib has the first kind as Nat.stirlingFirst_succ_self_left, which states that [n+1n]=(n+12)\left[{n+1 \atop n}\right] = \binom{n+1}{2}.

Example. From Table 2, [65]=15={65}=(62)\left[{6 \atop 5}\right] = 15 = \left\{{6 \atop 5}\right\} = \binom{6}{2}.

Proof. The coefficient of xn−1x^{n-1} in x(x−1)⋯(x−n+1)x(x-1)\cdots(x-n+1) is the negative of the sum of the numbers 0,1,…,n−10, 1, \ldots, n-1, which is −(n2)-\binom{n}{2}. By (44) it is (−1)1[nn−1](-1)^1\left[{n \atop n-1}\right]. For the second kind, xn=xn‾+{nn−1}xn−1‾+(terms of degree<n−1)x^n = x^{\underline n} + \left\{{n \atop n-1}\right\}x^{\underline{n-1}} + (\text{terms of degree} < n-1). The coefficient of xn−1x^{n-1} on the left is 00, so 0=−(n2)+{nn−1}0 = -\binom{n}{2} + \left\{{n \atop n-1}\right\}. □\square

Theorem (the first columns, TAOCP eq. 1.2.6(50)). For every integer n≥0n \ge 0, [n+10]={n+10}=0,[n+11]=n!,{n+11}=1,{n+12}=2n−1.\left[{n+1 \atop 0}\right] = \left\{{n+1 \atop 0}\right\} = 0,\quad\left[{n+1 \atop 1}\right] = n!,\quad\left\{{n+1 \atop 1}\right\} = 1,\quad\left\{{n+1 \atop 2}\right\} = 2^n - 1.

Node: TAC9T6MG0Q · status: proved

Explanation. The first column of the first triangle counts the cyclic arrangements of n+1n + 1 objects. The second column of the second triangle is the number of ways to split a set of n+1n + 1 elements into two nonempty parts. In Mathlib, Nat.stirlingFirst_one_right and Nat.stirlingSecond_one_right give two of the four values.

Example. For n=4n = 4: [51]=24=4!\left[{5 \atop 1}\right] = 24 = 4!, {51}=1\left\{{5 \atop 1}\right\} = 1 and {52}=15=24−1\left\{{5 \atop 2}\right\} = 15 = 2^4 - 1.

Proof. Put x=0x = 0 in xn+1‾x^{\underline{n+1}} and in xn+1x^{n+1}: the first has the factor xx and the second vanishes, so the constant coefficient of (44) and the coefficient of x0‾x^{\underline 0} in (45) are both 00. The coefficient of xx in x(x−1)⋯(x−n)x(x-1)\cdots(x-n) is (−1)(−2)⋯(−n)=(−1)nn!(-1)(-2)\cdots(-n) = (-1)^nn!, which is (−1)n[n+11](-1)^{n}\left[{n+1 \atop 1}\right] by (44). Put x=1x = 1 in (45): 1k‾=01^{\underline k} = 0 for k≥2k \ge 2, 11‾=11^{\underline 1} = 1, so 1={n+10}+{n+11}={n+11}1 = \left\{{n+1 \atop 0}\right\} + \left\{{n+1 \atop 1}\right\} = \left\{{n+1 \atop 1}\right\}. Put x=2x = 2: 21‾=22^{\underline 1} = 2, 22‾=22^{\underline 2} = 2 and 2k‾=02^{\underline k} = 0 for k≥3k \ge 3, so 2n+1=2{n+11}+2{n+12}=2+2{n+12}2^{n+1} = 2\left\{{n+1 \atop 1}\right\} + 2\left\{{n+1 \atop 2}\right\} = 2 + 2\left\{{n+1 \atop 2}\right\} and {n+12}=2n−1\left\{{n+1 \atop 2}\right\} = 2^n - 1. □\square

Theorem (the first expansion formulas, TAOCP eq. 1.2.6(51)). For integers m,n≥0m, n \ge 0, ∑k[nk](km)=[n+1m+1],∑k[n+1k+1](km)(−1)k−m=[nm].\sum_k\left[{n \atop k}\right]\binom{k}{m} = \left[{n+1 \atop m+1}\right],\qquad\sum_k\left[{n+1 \atop k+1}\right]\binom{k}{m}(-1)^{k-m} = \left[{n \atop m}\right].

Node: TACGT944TN · status: not stated yet

Explanation. The first formula expands a Stirling number of one step further in nn and in mm by the binomial coefficients, and the second is its inverse by the rule of (33). They are the analogue of (10) and (11) for the first kind.

Example. For n=5n = 5, m=2m = 2: ∑k[5k](k2)=50⋅1+35⋅3+10⋅6+1⋅10=50+105+60+10=225=[63]\sum_k\left[{5 \atop k}\right]\binom{k}{2} = 50 \cdot 1 + 35 \cdot 3 + 10 \cdot 6 + 1 \cdot 10 = 50 + 105 + 60 + 10 = 225 = \left[{6 \atop 3}\right]. The inverse: ∑k[6k+1](k2)(−1)k\sum_k\left[{6 \atop k+1}\right]\binom{k}{2}(-1)^{k} for k=2,…,5k = 2, \ldots, 5 is [63]−3[64]+6[65]−10[66]=225−255+90−10=50=[52]\left[{6 \atop 3}\right] - 3\left[{6 \atop 4}\right] + 6\left[{6 \atop 5}\right] - 10\left[{6 \atop 6}\right] = 225 - 255 + 90 - 10 = 50 = \left[{5 \atop 2}\right].

Proof. Let T(n,m)=∑k[nk](km)T(n, m) = \sum_k\left[{n \atop k}\right]\binom{k}{m} with (k−1)=0\binom{k}{-1} = 0. For n=0n = 0, T(0,m)=(0m)=δm0=[1m+1]T(0, m) = \binom{0}{m} = \delta_{m0} = \left[{1 \atop m+1}\right]. For the step, (46) gives T(n+1,m)=∑k(n[nk]+[nk−1])(km)=nT(n,m)+∑k[nk](k+1m)T(n+1, m) = \sum_k\left(n\left[{n \atop k}\right] + \left[{n \atop k-1}\right]\right)\binom{k}{m} = nT(n, m) + \sum_k\left[{n \atop k}\right]\binom{k+1}{m}, and by (9) the last sum is T(n,m)+T(n,m−1)T(n, m) + T(n, m-1). So T(n+1,m)=(n+1)T(n,m)+T(n,m−1)T(n+1, m) = (n+1)T(n, m) + T(n, m-1). By the induction hypothesis this is (n+1)[n+1m+1]+[n+1m]=[n+2m+1](n+1)\left[{n+1 \atop m+1}\right] + \left[{n+1 \atop m}\right] = \left[{n+2 \atop m+1}\right], by (46), and for m=0m = 0 the second term is 0=[n+10]0 = \left[{n+1 \atop 0}\right] by (50). For the second formula, let uk=[nk]u_k = \left[{n \atop k}\right] and vm=[n+1m+1]=∑kuk(km)v_m = \left[{n+1 \atop m+1}\right] = \sum_ku_k\binom{k}{m}. Then ∑mvm(mj)(−1)m−j=∑kuk∑m(km)(mj)(−1)m−j\sum_mv_m\binom{m}{j}(-1)^{m-j} = \sum_ku_k\sum_m\binom{k}{m}\binom{m}{j}(-1)^{m-j}. The inner sum is δkj\delta_{kj} by (33), since (−1)m−j(-1)^{m-j} and (−1)k−m(-1)^{k-m} agree when k=jk = j. So the sum is uj=[nj]u_j = \left[{n \atop j}\right]. □\square

Theorem (the second expansion formulas, TAOCP eq. 1.2.6(52)). For integers m,n≥0m, n \ge 0, ∑k{km}(nk)={n+1m+1},∑k{k+1m+1}(nk)(−1)n−k={nm}.\sum_k\left\{{k \atop m}\right\}\binom{n}{k} = \left\{{n+1 \atop m+1}\right\},\qquad\sum_k\left\{{k+1 \atop m+1}\right\}\binom{n}{k}(-1)^{n-k} = \left\{{n \atop m}\right\}.

Node: TAHMGM6CV1 · status: not stated yet

Explanation. Same as (51) for the second kind. The first formula says that a partition of n+1n + 1 elements into m+1m + 1 blocks is built by choosing the block of the last element and partitioning what is left, which is the combinatorial meaning that Exercise 64 proves.

Example. For n=5n = 5, m=2m = 2: ∑k{k2}(5k)=1⋅10+3⋅10+7⋅5+15⋅1=90={63}\sum_k\left\{{k \atop 2}\right\}\binom{5}{k} = 1 \cdot 10 + 3 \cdot 10 + 7 \cdot 5 + 15 \cdot 1 = 90 = \left\{{6 \atop 3}\right\}. And ∑k{k+13}(5k)(−1)5−k\sum_k\left\{{k+1 \atop 3}\right\}\binom{5}{k}(-1)^{5-k} over k=2,…,5k = 2, \ldots, 5 is −1⋅10+6⋅10−25⋅5+90⋅1=15={52}-1 \cdot 10 + 6 \cdot 10 - 25 \cdot 5 + 90 \cdot 1 = 15 = \left\{{5 \atop 2}\right\}.

Proof. Let U(n,m)=∑k{km}(nk)U(n, m) = \sum_k\left\{{k \atop m}\right\}\binom{n}{k}. By (9), U(n+1,m)=U(n,m)+∑k{k+1m}(nk)U(n+1, m) = U(n, m) + \sum_k\left\{{k+1 \atop m}\right\}\binom{n}{k}, and by (46), {k+1m}=m{km}+{km−1}\left\{{k+1 \atop m}\right\} = m\left\{{k \atop m}\right\} + \left\{{k \atop m-1}\right\}, so U(n+1,m)=(m+1)U(n,m)+U(n,m−1)U(n+1, m) = (m+1)U(n, m) + U(n, m-1). Since U(0,m)=δm0={1m+1}U(0, m) = \delta_{m0} = \left\{{1 \atop m+1}\right\}, induction on nn gives U(n,m)={n+1m+1}U(n, m) = \left\{{n+1 \atop m+1}\right\}, because {n+2m+1}=(m+1){n+1m+1}+{n+1m}\left\{{n+2 \atop m+1}\right\} = (m+1)\left\{{n+1 \atop m+1}\right\} + \left\{{n+1 \atop m}\right\}. For the second formula put ak={km}a_k = \left\{{k \atop m}\right\} and bn={n+1m+1}=∑k(nk)akb_n = \left\{{n+1 \atop m+1}\right\} = \sum_k\binom{n}{k}a_k. By (33), ∑n(rn)(−1)r−nbn=∑kak∑n(rn)(nk)(−1)r−n=ar\sum_n\binom{r}{n}(-1)^{r-n}b_n = \sum_ka_k\sum_n\binom{r}{n}\binom{n}{k}(-1)^{r-n} = a_r. □\square

Theorem (powers as an alternating sum, TAOCP eq. 1.2.6(53)). For integers m,n≥0m, n \ge 0, ∑k(mk)(−1)m−kkn=m!{nm}.\sum_k\binom{m}{k}(-1)^{m-k}k^n = m!\left\{{n \atop m}\right\}.

Node: TAQHYWMM64 · status: not stated yet

Explanation. The left side is the mmth finite difference of the power knk^n at 00. It is 00 for m>nm > n, it is n!n! for m=nm = n, and in general it is the number of surjections of an nn-element set onto an mm-element set, since m!{nm}m!\left\{{n \atop m}\right\} counts the ways to partition into mm blocks and label them.

Example. For m=3m = 3, n=4n = 4: ∑k(3k)(−1)3−kk4=3⋅1−3⋅16+81=36=3!⋅{43}=6⋅6\sum_k\binom{3}{k}(-1)^{3-k}k^4 = 3 \cdot 1 - 3 \cdot 16 + 81 = 36 = 3!\cdot\left\{{4 \atop 3}\right\} = 6 \cdot 6.

Proof. By (45), kn=∑j{nj}kj‾=∑j{nj}j!(kj)k^n = \sum_j\left\{{n \atop j}\right\}k^{\underline j} = \sum_j\left\{{n \atop j}\right\}j!\binom{k}{j}. Multiply by (mk)(−1)m−k\binom{m}{k}(-1)^{m-k} and sum over kk. By (33), ∑k(mk)(kj)(−1)m−k=δjm\sum_k\binom{m}{k}\binom{k}{j}(-1)^{m-k} = \delta_{jm}, so only j=mj = m remains and the sum is m!{nm}m!\left\{{n \atop m}\right\}. □\square

Theorem (the Stirling numbers as sums of binomial coefficients, TAOCP eq. 1.2.6(54)). For integers m,n≥0m, n \ge 0, ∑k(m−nm+k)(m+nn+k){m+kk}=[nn−m],∑k(m−nm+k)(m+nn+k)[m+kk]={nn−m}.\sum_k\binom{m-n}{m+k}\binom{m+n}{n+k}\left\{{m+k \atop k}\right\} = \left[{n \atop n-m}\right],\qquad\sum_k\binom{m-n}{m+k}\binom{m+n}{n+k}\left[{m+k \atop k}\right] = \left\{{n \atop n-m}\right\}.

Node: TASJDZVAFP · status: not stated yet

Explanation. The Stirling numbers of the diagonal [nn−m]\left[{n \atop n-m}\right], as functions of nn, are polynomials of degree at most 2m2m (see (57)). Each formula expresses such a polynomial in a basis built from the two binomial coefficients, with the numbers of the other kind as the coefficients. The sum has the terms k=0,…,mk = 0, \ldots, m only. The proof here uses the duality (58), proved below, and does not depend on this equation.

Example. For m=2m = 2, n=5n = 5 the terms (−32+k)(75+k){2+kk}\binom{-3}{2+k}\binom{7}{5+k}\left\{{2+k \atop k}\right\} are 00, (−10)(7)(1)=−70(-10)(7)(1) = -70 and (15)(1)(7)=105(15)(1)(7) = 105 for k=0,1,2k = 0, 1, 2, and the sum is 35=[53]35 = \left[{5 \atop 3}\right]. With [2+kk]=1,2,11\left[{2+k \atop k}\right] = 1, 2, 11 in place of {2+kk}\left\{{2+k \atop k}\right\} the terms are 00, −140-140, 165165 and the sum is 25={53}25 = \left\{{5 \atop 3}\right\}.

Proof. Fix m≥0m \ge 0. By (57) and (58) below there are polynomials PmP_m and QmQ_m of degree at most 2m2m with Pm(n)=[nn−m]P_m(n) = \left[{n \atop n-m}\right] and Qm(n)={nn−m}Q_m(n) = \left\{{n \atop n-m}\right\} for integers n≥0n \ge 0 and with Pm(−i)={m+ii}P_m(-i) = \left\{{m+i \atop i}\right\} and Qm(−i)=[m+ii]Q_m(-i) = \left[{m+i \atop i}\right] for integers i≥0i \ge 0. Put u=n+mu = n + m. By the symmetry (6), (m+nn+k)=(m+nm−k)\binom{m+n}{n+k} = \binom{m+n}{m-k}, and with j=m−kj = m - k the first sum is G(u)=∑j=0mBj(u){2m−jm−j}G(u) = \sum_{j=0}^{m}B_j(u)\left\{{2m-j \atop m-j}\right\}, where Bj(u)=(uj)(2m−u2m−j)B_j(u) = \binom{u}{j}\binom{2m-u}{2m-j} is a polynomial of degree 2m2m in uu. For integers u,ju, j with 0≤u,j≤2m0 \le u, j \le 2m Bj(u)=δujB_j(u) = \delta_{uj} holds: the first factor needs j≤uj \le u and the second needs 2m−j≤2m−u2m - j \le 2m - u. Hence GG has degree at most 2m2m and takes the value {2m−um−u}\left\{{2m-u \atop m-u}\right\} at u=0,…,mu = 0, \ldots, m and 00 at u=m+1,…,2mu = m+1, \ldots, 2m. The polynomial Pm(u−m)P_m(u - m) has the same degree bound and the same values: at u≤mu \le m, with i=m−ui = m - u, it is Pm(−i)={m+ii}={2m−um−u}P_m(-i) = \left\{{m+i \atop i}\right\} = \left\{{2m-u \atop m-u}\right\}, and at u=m+n′u = m + n' with 1≤n′≤m1 \le n' \le m it is [n′n′−m]=0\left[{n' \atop n'-m}\right] = 0 because the lower index is negative or, for n′=m≥1n' = m \ge 1, is 00 and [m0]=0\left[{m \atop 0}\right] = 0. Two polynomials of degree at most 2m2m that agree at 2m+12m + 1 points are equal, so G(u)=Pm(u−m)G(u) = P_m(u - m), which is the first formula for n≥0n \ge 0 (and for every nn as a polynomial identity). The second formula is the same argument with the roles of PmP_m and QmQ_m exchanged, using Qm(−i)=[m+ii]Q_m(-i) = \left[{m+i \atop i}\right]. □\square

Theorem (a sum with Stirling numbers of the first kind, TAOCP eq. 1.2.6(55)). For integers m,n≥0m, n \ge 0, ∑k{n+1k+1}[km](−1)k−m=(nm).\sum_k\left\{{n+1 \atop k+1}\right\}\left[{k \atop m}\right](-1)^{k-m} = \binom{n}{m}.

Node: TAQSW9YHMT · status: not stated yet

Explanation. The binomial coefficient on the right is the entry of Pascal's triangle that is obtained by passing through both Stirling triangles. It complements (52).

Example. For n=5n = 5, m=2m = 2: {63}[22]−{64}[32]+{65}[42]−{66}[52]=90−195+165−50=10=(52)\left\{{6 \atop 3}\right\}\left[{2 \atop 2}\right] - \left\{{6 \atop 4}\right\}\left[{3 \atop 2}\right] + \left\{{6 \atop 5}\right\}\left[{4 \atop 2}\right] - \left\{{6 \atop 6}\right\}\left[{5 \atop 2}\right] = 90 - 195 + 165 - 50 = 10 = \binom{5}{2}. The middle terms use {64}=65\left\{{6 \atop 4}\right\} = 65 and {65}=15\left\{{6 \atop 5}\right\} = 15 with [32]=3\left[{3 \atop 2}\right] = 3 and [42]=11\left[{4 \atop 2}\right] = 11.

Proof. By the first formula of (52), {n+1k+1}=∑j(nj){jk}\left\{{n+1 \atop k+1}\right\} = \sum_j\binom{n}{j}\left\{{j \atop k}\right\}. Then the sum is ∑j(nj)∑k{jk}[km](−1)k−m\sum_j\binom{n}{j}\sum_k\left\{{j \atop k}\right\}\left[{k \atop m}\right](-1)^{k-m}. By the second formula of (47), the inner sum is δjm\delta_{jm} (the sign (−1)k−m(-1)^{k-m} differs from (−1)j−k(-1)^{j-k} by the constant (−1)j−m(-1)^{j-m}, which is 11 at j=mj = m). So the result is (nm)\binom{n}{m}. □\square

Theorem (two sums over a growing index, TAOCP eq. 1.2.6(56)). For integers m,n≥0m, n \ge 0, ∑k≤n[km]n!k!=[n+1m+1],∑k≤n{km}(m+1)n−k={n+1m+1}.\sum_{k \le n}\left[{k \atop m}\right]\frac{n!}{k!} = \left[{n+1 \atop m+1}\right],\qquad\sum_{k \le n}\left\{{k \atop m}\right\}(m+1)^{n-k} = \left\{{n+1 \atop m+1}\right\}.

Node: TADTW32S6W · status: not stated yet

Explanation. Both are obtained by unrolling one of the recurrences (46) in nn with the other index fixed. Each step multiplies the previous total by a factor, n+1n+1 in the first sum and m+1m+1 in the second.

Example. For n=4n = 4, m=2m = 2: ∑k≤4[k2]4!k!=1⋅12+3⋅4+11⋅1=35=[53]\sum_{k \le 4}\left[{k \atop 2}\right]\frac{4!}{k!} = 1 \cdot 12 + 3 \cdot 4 + 11 \cdot 1 = 35 = \left[{5 \atop 3}\right]. And ∑k≤4{k2}34−k=1⋅9+3⋅3+7=25={53}\sum_{k \le 4}\left\{{k \atop 2}\right\}3^{4-k} = 1 \cdot 9 + 3 \cdot 3 + 7 = 25 = \left\{{5 \atop 3}\right\}.

Proof. Let f(n)f(n) be the first sum. For n=0n = 0 it is [0m]=δm0=[1m+1]\left[{0 \atop m}\right] = \delta_{m0} = \left[{1 \atop m+1}\right]. For the step, f(n+1)=(n+1)f(n)+[n+1m]f(n+1) = (n+1)f(n) + \left[{n+1 \atop m}\right], because the term k=n+1k = n + 1 has the factor (n+1)!(n+1)!=1\frac{(n+1)!}{(n+1)!} = 1 and the terms k≤nk \le n have the factor (n+1)!k!=(n+1)n!k!\frac{(n+1)!}{k!} = (n+1)\frac{n!}{k!}. By the hypothesis and (46), f(n+1)=(n+1)[n+1m+1]+[n+1m]=[n+2m+1]f(n+1) = (n+1)\left[{n+1 \atop m+1}\right] + \left[{n+1 \atop m}\right] = \left[{n+2 \atop m+1}\right]. For the second sum, call it g(n)g(n). Then g(0)={0m}={1m+1}g(0) = \left\{{0 \atop m}\right\} = \left\{{1 \atop m+1}\right\} and g(n+1)=(m+1)g(n)+{n+1m}=(m+1){n+1m+1}+{n+1m}={n+2m+1}g(n+1) = (m+1)g(n) + \left\{{n+1 \atop m}\right\} = (m+1)\left\{{n+1 \atop m+1}\right\} + \left\{{n+1 \atop m}\right\} = \left\{{n+2 \atop m+1}\right\} by (46). □\square

Theorem (the diagonals as polynomials, TAOCP eq. 1.2.6(57)). For every integer k≥0k \ge 0 there are polynomials PkP_k and QkQ_k of degree at most 2k2k with Pk(n)=[nn−k]P_k(n) = \left[{n \atop n-k}\right] and Qk(n)={nn−k}Q_k(n) = \left\{{n \atop n-k}\right\} for all integers n≥0n \ge 0. For k=2k = 2 and k=3k = 3, [nn−2]=(n4)+2(n+14),{nn−2}=(n+14)+2(n4),\left[{n \atop n-2}\right] = \binom{n}{4} + 2\binom{n+1}{4},\quad\left\{{n \atop n-2}\right\} = \binom{n+1}{4} + 2\binom{n}{4}, [nn−3]=(n6)+8(n+16)+6(n+26),{nn−3}=(n+26)+8(n+16)+6(n6).\left[{n \atop n-3}\right] = \binom{n}{6} + 8\binom{n+1}{6} + 6\binom{n+2}{6},\quad\left\{{n \atop n-3}\right\} = \binom{n+2}{6} + 8\binom{n+1}{6} + 6\binom{n}{6}.

Node: TAPNCH8JNK · status: not stated yet

Explanation. The proof builds PkP_k and QkQ_k from the recurrences (46) written as difference equations in nn. The degree is at most 2k2k, and the book states that it is exactly 2k2k. The leading coefficient is positive, but C1 does not need or prove this. These polynomials define [rr−k]\left[{r \atop r-k}\right] and {rr−k}\left\{{r \atop r-k}\right\} for real rr, which the next three results use.

Example. For n=6n = 6: [64]=85=(64)+2(74)=15+70\left[{6 \atop 4}\right] = 85 = \binom{6}{4} + 2\binom{7}{4} = 15 + 70, {64}=65=(74)+2(64)=35+30\left\{{6 \atop 4}\right\} = 65 = \binom{7}{4} + 2\binom{6}{4} = 35 + 30, [63]=225=(66)+8(76)+6(86)=1+56+168\left[{6 \atop 3}\right] = 225 = \binom{6}{6} + 8\binom{7}{6} + 6\binom{8}{6} = 1 + 56 + 168 and {63}=90=(86)+8(76)+6(66)=28+56+6\left\{{6 \atop 3}\right\} = 90 = \binom{8}{6} + 8\binom{7}{6} + 6\binom{6}{6} = 28 + 56 + 6.

Proof. The first fact: for a polynomial pp there is exactly one polynomial qq with q(0)=0q(0) = 0 and q(r+1)−q(r)=p(r)q(r+1) - q(r) = p(r), of degree deg⁡p+1\deg p + 1 (and q=0q = 0 for p=0p = 0). Write p(r)=∑jcj(rj)p(r) = \sum_jc_j\binom{r}{j} as in the proof of (34) and put q(r)=∑jcj(rj+1)q(r) = \sum_jc_j\binom{r}{j+1}, using (r+1j+1)−(rj+1)=(rj)\binom{r+1}{j+1} - \binom{r}{j+1} = \binom{r}{j} from (9). If q′q' is another solution then q−q′q - q' vanishes at every integer r≥0r \ge 0, so it is zero.

Put P0=Q0=1P_0 = Q_0 = 1. For k≥1k \ge 1 let PkP_k be the solution for p(r)=rPk−1(r)p(r) = rP_{k-1}(r) and QkQ_k the solution for p(r)=(r+1−k)Qk−1(r)p(r) = (r+1-k)Q_{k-1}(r). By induction the degrees are at most 2k2k. The values at integers: Pk(0)=0=[0−k]P_k(0) = 0 = \left[{0 \atop -k}\right] for k≥1k \ge 1, and P0(n)=1=[nn]P_0(n) = 1 = \left[{n \atop n}\right]. If Pk(n)=[nn−k]P_k(n) = \left[{n \atop n-k}\right] and Pk−1(n)=[nn−k+1]P_{k-1}(n) = \left[{n \atop n-k+1}\right], then Pk(n+1)=Pk(n)+nPk−1(n)=[nn−k]+n[nn+1−k]=[n+1n+1−k]P_k(n+1) = P_k(n) + nP_{k-1}(n) = \left[{n \atop n-k}\right] + n\left[{n \atop n+1-k}\right] = \left[{n+1 \atop n+1-k}\right] by (46) with m=n+1−km = n + 1 - k. This also holds when m≤0m \le 0, where all the numbers are 00 except for n=0n = 0, m=0m = 0. For the second kind Qk(n+1)=Qk(n)+(n+1−k)Qk−1(n)={nn−k}+m{nm}={n+1m}Q_k(n+1) = Q_k(n) + (n+1-k)Q_{k-1}(n) = \left\{{n \atop n-k}\right\} + m\left\{{n \atop m}\right\} = \left\{{n+1 \atop m}\right\} with m=n+1−km = n + 1 - k, in the same way.

The explicit cases. P1(r)=(r2)P_1(r) = \binom{r}{2} since (r+12)−(r2)=r=r⋅P0\binom{r+1}{2} - \binom{r}{2} = r = r\cdot P_0. Let f(r)=(r4)+2(r+14)f(r) = \binom{r}{4} + 2\binom{r+1}{4}. Then f(r+1)−f(r)=(r3)+2(r+13)=r(r−1)6[(r−2)+2(r+1)]=r2(r−1)2=rP1(r)f(r+1) - f(r) = \binom{r}{3} + 2\binom{r+1}{3} = \frac{r(r-1)}{6}\left[(r-2) + 2(r+1)\right] = \frac{r^2(r-1)}{2} = rP_1(r) and f(0)=0f(0) = 0, so f=P2f = P_2. For g(r)=(r+14)+2(r4)g(r) = \binom{r+1}{4} + 2\binom{r}{4}, one gets g(r+1)−g(r)=(r+13)+2(r3)=r(r−1)6[(r+1)+2(r−2)]=r(r−1)22=(r−1)Q1(r)g(r+1) - g(r) = \binom{r+1}{3} + 2\binom{r}{3} = \frac{r(r-1)}{6}[(r+1) + 2(r-2)] = \frac{r(r-1)^2}{2} = (r-1)Q_1(r), with Q1=P1Q_1 = P_1 by the same computation, and g(0)=0g(0) = 0, so g=Q2g = Q_2. For k=3k = 3 let F3(r)=(r6)+8(r+16)+6(r+26)F_3(r) = \binom{r}{6} + 8\binom{r+1}{6} + 6\binom{r+2}{6}. Then F3(0)=0F_3(0) = 0 and F3(r+1)−F3(r)=(r5)+8(r+15)+6(r+25)F_3(r+1) - F_3(r) = \binom{r}{5} + 8\binom{r+1}{5} + 6\binom{r+2}{5}, which has degree 55. The polynomial rP2(r)rP_2(r) also has degree at most 55, and at r=0,1,2,3,4,5r = 0, 1, 2, 3, 4, 5 both take the values 0,0,0,6,44,1750, 0, 0, 6, 44, 175. So they are equal, and F3=P3F_3 = P_3. In the same way G3(r)=(r+26)+8(r+16)+6(r6)G_3(r) = \binom{r+2}{6} + 8\binom{r+1}{6} + 6\binom{r}{6} has G3(0)=0G_3(0) = 0 and G3(r+1)−G3(r)=(r+25)+8(r+15)+6(r5)G_3(r+1) - G_3(r) = \binom{r+2}{5} + 8\binom{r+1}{5} + 6\binom{r}{5}, and this agrees with (r−2)Q2(r)(r-2)Q_2(r) at r=0,…,5r = 0, \ldots, 5 (values 0,0,0,1,14,750, 0, 0, 1, 14, 75), so G3=Q3G_3 = Q_3. □\square

Theorem (the duality of the two kinds, TAOCP eq. 1.2.6(58)). With [rr−k]=Pk(r)\left[{r \atop r-k}\right] = P_k(r) and {rr−k}=Qk(r)\left\{{r \atop r-k}\right\} = Q_k(r) for real rr, for all integers n≥m≥0n \ge m \ge 0 {nm}=[−m−n].\left\{{n \atop m}\right\} = \left[{-m \atop -n}\right].

Node: TA2CK985V6 · status: not stated yet

Explanation. With k=n−mk = n - m the claim is Qk(n)=Pk(−m)=Pk(k−n)Q_k(n) = P_k(-m) = P_k(k - n). It says that the two triangles are the same function after the reflection r↦k−rr \mapsto k - r of the upper index. In the book this is described as implicit in Stirling's original work. The proof works for each polynomial and is valid for all real arguments, so it also gives [nm]={−m−n}\left[{n \atop m}\right] = \left\{{-m \atop -n}\right\}.

Example. With k=3k = 3 and n=5n = 5: Q3(5)={52}=15Q_3(5) = \left\{{5 \atop 2}\right\} = 15 and P3(3−5)=P3(−2)=(−26)+8(−16)+6(06)=7+8+0=15P_3(3 - 5) = P_3(-2) = \binom{-2}{6} + 8\binom{-1}{6} + 6\binom{0}{6} = 7 + 8 + 0 = 15. Here (−26)=7\binom{-2}{6} = 7 and (−16)=1\binom{-1}{6} = 1 by (17).

Proof. The claim is Qk(r)=Pk(k−r)Q_k(r) = P_k(k - r) for all k≥0k \ge 0 as polynomials, by induction on kk. For k=0k = 0 both are 11. Let k≥1k \ge 1 and assume Qk−1(r)=Pk−1(k−1−r)Q_{k-1}(r) = P_{k-1}(k - 1 - r). Put H(r)=Pk(k−r)H(r) = P_k(k - r). By the difference rule of PkP_k, H(r+1)−H(r)=Pk(k−r−1)−Pk(k−r)=−(k−r−1)Pk−1(k−r−1)=(r+1−k)Pk−1(k−1−r)=(r+1−k)Qk−1(r)H(r+1) - H(r) = P_k(k-r-1) - P_k(k-r) = -(k-r-1)P_{k-1}(k-r-1) = (r+1-k)P_{k-1}(k-1-r) = (r+1-k)Q_{k-1}(r). This is the difference rule of QkQ_k. Also H(0)=Pk(k)=[k0]=0=Qk(0)H(0) = P_k(k) = \left[{k \atop 0}\right] = 0 = Q_k(0). So HH and QkQ_k agree at all integers r≥0r \ge 0, and they are equal. The claim follows with r=nr = n and k=n−mk = n - m. □\square

Theorem (the generalized Stirling expansion of a power, TAOCP eq. 1.2.6(59)). For real rr and complex zz with Re z>0\mathrm{Re}\,z > 0, with the falling power zs‾=Γ(z+1)/Γ(z−s+1)z^{\underline s} = \Gamma(z+1)/\Gamma(z-s+1) of Section 1.2.5, the series in the following display converges and its sum is zrz^r: zr=∑k{rr−k}zr−k‾.z^r = \sum_k\left\{{r \atop r-k}\right\}z^{\underline{r-k}}.

Node: TANT3EY8C6 · status: not stated yet

Explanation. The identity (45) is a finite sum for r=nr = n an integer. For other rr it becomes an infinite series. C1 proves the part that can be proved from the polynomial facts above, that the series is an asymptotic expansion of zrz^r as z→∞z \to \infty, in the sense of the statement at the end of the proof. The convergence for Re z>0\mathrm{Re}\,z > 0 is not proved here. It is Exercise 65 of the book, rated HM35, and it uses analysis of the gamma function that this chapter does not develop.

Example. For r=12r = \frac12 and z=100z = 100 the terms {1/21/2−k}\left\{{1/2 \atop 1/2-k}\right\} are Qk(12)=1,−18,−7128,−751024Q_k(\frac12) = 1, -\frac18, -\frac{7}{128}, -\frac{75}{1024}. The partial sums ∑k≤MQk(12)z1/2−k‾\sum_{k \le M}Q_k(\frac12)z^{\underline{1/2-k}} for M=0,1,2,3M = 0, 1, 2, 3 are 10.012507810.0125078, 10.000054410.0000544, 10.000000710.0000007 and 10.0000000210.00000002, which approach z1/2=10z^{1/2} = 10.

Proof. Put pj(r)=(−1)jPj(r)p_j(r) = (-1)^jP_j(r). By (60) below, for each fixed MM, zs‾=zs∑j≤Mpj(s)z−j+O(zs−M−1)z^{\underline{s}} = z^s\sum_{j \le M}p_j(s)z^{-j} + O(z^{s-M-1}) for real ss. The claim to prove is that for every N≥0N \ge 0, ∑k+j=NQk(r)pj(r−k)=δN0\sum_{k+j=N}Q_k(r)p_j(r-k) = \delta_{N0}, as a polynomial in rr. For an integer n≥Nn \ge N, expand xnx^n by (45) as ∑k=0n{nn−k}xn−k‾\sum_{k=0}^{n}\left\{{n \atop n-k}\right\}x^{\underline{n-k}} and each xn−k‾x^{\underline{n-k}} by (44) as ∑j(−1)j[n−kn−k−j]xn−k−j\sum_j(-1)^j\left[{n-k \atop n-k-j}\right]x^{n-k-j}. The coefficient of xn−Nx^{n-N} is δN0\delta_{N0} on the left and ∑k+j=NQk(n)pj(n−k)\sum_{k+j=N}Q_k(n)p_j(n-k) on the right, by (57). So the polynomial vanishes (for N>0N > 0) or equals 11 (for N=0N = 0) at every integer n≥Nn \ge N, hence it does so identically. Now take any real rr and a fixed MM. Using the expansion of each zr−k‾z^{\underline{r-k}} with k≤Mk \le M, ∑k≤MQk(r)zr−k‾=∑k≤MQk(r)zr−k∑j≤M−kpj(r−k)z−j+O(zr−M−1)=zr∑N≤Mz−N∑k+j=NQk(r)pj(r−k)+O(zr−M−1)=zr+O(zr−M−1)\sum_{k \le M}Q_k(r)z^{\underline{r-k}} = \sum_{k \le M}Q_k(r)z^{r-k}\sum_{j \le M-k}p_j(r-k)z^{-j} + O(z^{r-M-1}) = z^r\sum_{N \le M}z^{-N}\sum_{k+j=N}Q_k(r)p_j(r-k) + O(z^{r-M-1}) = z^r + O(z^{r-M-1}). This proves that the series is an asymptotic expansion of zrz^r. □\square

Theorem (the generalized Stirling expansion of a falling power, TAOCP eq. 1.2.6(60)). For a real number rr and an integer m≥0m \ge 0, as z→+∞z \to +\infty, zr‾=∑k=0m[rr−k](−1)kzr−k+O(zr−m−1).z^{\underline r} = \sum_{k=0}^{m}\left[{r \atop r-k}\right](-1)^kz^{r-k} + O(z^{r-m-1}).

Node: TA7NQT3SKN · status: not stated yet

Explanation. It is (44) for a real exponent, with the sum cut at mm, and the series does not converge in general. The proof takes as an input the asymptotic series of the logarithm of the gamma function with a shift. That series is a standard result of analysis (Stirling's series with Bernoulli polynomials) and it is cited here and not proved. For a=1a = 1 the asymptotic input is the series behind Stirling's approximation, eq. 1.2.5(7). Mathlib has the Bernoulli polynomials as Polynomial.bernoulli, but not this expansion.

Example. For r=12r = \frac12 and z=100z = 100 the coefficients (−1)k[1/21/2−k](-1)^k\left[{1/2 \atop 1/2-k}\right] are 1,18,1128,−510241, \frac18, \frac{1}{128}, -\frac{5}{1024}, and the sums ∑k≤m\sum_{k \le m} for m=0,1,2,3m = 0, 1, 2, 3 are 1010, 10.012510.0125, 10.012507812510.0125078125 and 10.0125077636710.01250776367. The exact value Γ(101)/Γ(100.5)\Gamma(101)/\Gamma(100.5) is 10.0125077636110.01250776361.

Proof. The input is: for fixed real aa, as z→+∞z \to +\infty, ln⁡Γ(z+a)=(z+a−12)ln⁡z−z+12ln⁡2π+∑j=2J(−1)jBj(a)j(j−1)zj−1+O(z−J)\ln\Gamma(z+a) = (z + a - \frac12)\ln z - z + \frac12\ln 2\pi + \sum_{j=2}^{J}\frac{(-1)^jB_j(a)}{j(j-1)z^{j-1}} + O(z^{-J}), where Bj(a)B_j(a) is the Bernoulli polynomial. Take a=1a = 1 and a=1−ra = 1 - r and subtract: ln⁡Γ(z+1)Γ(z+1−r)=rln⁡z+∑i=1Jci(r)z−i+O(z−J)\ln\frac{\Gamma(z+1)}{\Gamma(z+1-r)} = r\ln z + \sum_{i=1}^{J}c_i(r)z^{-i} + O(z^{-J}), where ci(r)=(−1)i+1(Bi+1(1)−Bi+1(1−r))(i+1)ic_i(r) = \frac{(-1)^{i+1}\left(B_{i+1}(1) - B_{i+1}(1-r)\right)}{(i+1)i} is a polynomial in rr of degree at most i+1i + 1. Exponentiating a series of this kind, zr‾=zrexp⁡(∑ici(r)z−i)z^{\underline r} = z^r\exp\left(\sum_ic_i(r)z^{-i}\right) has the form zr∑k=0mpk(r)z−k+O(zr−m−1)z^r\sum_{k=0}^{m}p_k(r)z^{-k} + O(z^{r-m-1}), where pk(r)p_k(r) is a finite sum of products ci1⋯cisc_{i_1}\cdots c_{i_s} with i1+⋯+is=ki_1 + \cdots + i_s = k and rational coefficients. Its degree is at most ∑(it+1)=k+s≤2k\sum(i_t + 1) = k + s \le 2k. So each pkp_k is a polynomial of degree at most 2k2k in rr. For an integer r=n≥0r = n \ge 0 the left side is the finite sum (44), zn‾=∑k(−1)k[nn−k]zn−kz^{\underline n} = \sum_k(-1)^k\left[{n \atop n-k}\right]z^{n-k}, so by the uniqueness of the asymptotic coefficients pk(n)=(−1)k[nn−k]=(−1)kPk(n)p_k(n) = (-1)^k\left[{n \atop n-k}\right] = (-1)^kP_k(n) for all integers n≥0n \ge 0. Two polynomials that agree at infinitely many points are equal, so pk=(−1)kPkp_k = (-1)^kP_k and the expansion is the claim. □\square

Algorithms and programs

The section has no algorithm and no program. The only procedure in this part of the text is the method of inversion of Example 5. The Gosper and Zeilberger procedure that the book cites for the sums with closed forms is outside the section and is not described here.

The exercises

The table has the exercises 31 to 68 of Section 1.2.6. The exercises 1 to 30 are in the first file. The kind is the class of spec 06.3 that C1 proposes.

Exercise Rating Markers Kind Lean Solution
1.2.6-31 20 M K3 not yet stated X1, 1.2.6-31
1.2.6-32 20 M K1 not yet stated X1, 1.2.6-32
1.2.6-33 20 M K1 not yet stated X1, 1.2.6-33
1.2.6-34 23 M K1 not yet stated X1, 1.2.6-34
1.2.6-35 23 M K1 not yet stated X1, 1.2.6-35
1.2.6-36 10 M K3 not yet stated X1, 1.2.6-36
1.2.6-37 10 M K3 not yet stated X1, 1.2.6-37
1.2.6-38 30 HM K1 not yet stated X1, 1.2.6-38
1.2.6-39 10 M K3 not yet stated X1, 1.2.6-39
1.2.6-40 17 HM K1 not yet stated X1, 1.2.6-40
1.2.6-41 22 HM K1 not yet stated X1, 1.2.6-41
1.2.6-42 10 HM K2 not yet stated X1, 1.2.6-42
1.2.6-43 20 HM K1 not yet stated X1, 1.2.6-43
1.2.6-44 20 HM K1 not yet stated X1, 1.2.6-44
1.2.6-45 21 HM K2 not yet stated X1, 1.2.6-45
1.2.6-46 21 M K2 not yet stated X1, 1.2.6-46
1.2.6-47 21 M K1 not yet stated X1, 1.2.6-47
1.2.6-48 25 M K1 not yet stated X1, 1.2.6-48
1.2.6-49 20 M K2 not yet stated X1, 1.2.6-49
1.2.6-50 20 M K1 not yet stated X1, 1.2.6-50
1.2.6-51 21 M K1 not yet stated X1, 1.2.6-51
1.2.6-52 11 HM K1 not yet stated X1, 1.2.6-52
1.2.6-53 25 M K1 not yet stated X1, 1.2.6-53
1.2.6-54 21 M K2 not yet stated X1, 1.2.6-54
1.2.6-55 21 M K2 not yet stated X1, 1.2.6-55
1.2.6-56 20 K3 not yet stated X1, 1.2.6-56
1.2.6-57 22 M K1 not yet stated X1, 1.2.6-57
1.2.6-58 23 M K1 not yet stated X1, 1.2.6-58
1.2.6-59 25 M K1 not yet stated X1, 1.2.6-59
1.2.6-60 23 M K2 not yet stated X1, 1.2.6-60
1.2.6-61 25 M K2 not yet stated X1, 1.2.6-61
1.2.6-62 23 M K1 not yet stated X1, 1.2.6-62
1.2.6-63 30 M K1 not yet stated X1, 1.2.6-63
1.2.6-64 20 M K1 not yet stated X1, 1.2.6-64
1.2.6-65 35 HM K1 not yet stated X1, 1.2.6-65
1.2.6-66 30 HM K1 not yet stated X1, 1.2.6-66
1.2.6-67 20 M K1 not yet stated X1, 1.2.6-67
1.2.6-68 25 M K1 not yet stated X1, 1.2.6-68

The order to do them: start with 1.2.6-36, 37 and 39, which are the sums of a row of each triangle. Exercise 1.2.6-31 is a triple sum of binomial coefficients, and 1.2.6-32 and 33 carry the binomial theorem to the rising and the falling powers. Exercise 1.2.6-34 does the same for Abel's formula, and 1.2.6-35 proves the addition formulas (46) from the definitions. Exercises 1.2.6-38 and 1.2.6-47 to 52 are extensions of the binomial theorem and of the sums of this file. The group 1.2.6-40 to 45 defines the beta function and uses it to give the binomial coefficient a real lower index. Exercise 1.2.6-46 is the large-argument estimate by Stirling's formula, 1.2.6-67 is an upper bound of (nk)\binom{n}{k}, and 1.2.6-68 is de Moivre's mean absolute deviation of the binomial distribution. Exercise 1.2.6-53 is a sum proved by induction, 1.2.6-54 inverts Pascal's triangle as a matrix and 1.2.6-55 inverts the two Stirling triangles. Exercise 1.2.6-61 is a sum of Stirling numbers in the spirit of (55), 1.2.6-62 and 63 are sums of products of binomial coefficients, 1.2.6-64 is the proof that {nm}\left\{{n \atop m}\right\} counts partitions, 1.2.6-56 is the combinatorial number system, 1.2.6-57 the original generalization of the factorial by Stirling and 1.2.6-58 the qq-nomial theorem of eq. (40). Exercise 1.2.6-59 is about the sequences with a binomial recurrence, 1.2.6-60 counts the combinations with repetition, and 1.2.6-65 is the proof of (59) and (60) that is left open in this chapter. Exercise 1.2.6-66 is an inequality on real numbers. Do 1.2.6-65 last.

Lean

The Lean repository tamnd/taocp-lean at main has these declarations for this file: TAOCP.stirling1 and TAOCP.stirling2, which are aliases of the Mathlib functions Nat.stirlingFirst and Nat.stirlingSecond, and the two recurrences TAOCP.stirling1_succ_succ and TAOCP.stirling2_succ_succ of eq. (46). Every other Node line of this file that has no Mathlib name says "not yet stated". The names of Mathlib that the statements will use were found in its source.

  • The Stirling numbers: Nat.stirlingFirst and Nat.stirlingSecond, with Nat.stirlingFirst_succ_succ, Nat.stirlingSecond_succ_succ, Nat.stirlingFirst_self, Nat.stirlingSecond_self, Nat.stirlingFirst_succ_self_left, Nat.stirlingFirst_one_right and Nat.stirlingSecond_one_right. The expansion of a power in the falling powers, eq. (45), is Nat.pow_eq_sum_stirlingSecond_mul_descFactorial.
  • The multinomial coefficient: Nat.multinomial with Nat.multinomial_spec, and the multinomial theorem Finset.sum_pow_eq_sum_piAntidiag.
  • The falling power: Nat.descFactorial, descPochhammer and descPochhammer_eval_eq_descFactorial.
  • Bernoulli polynomials, for the input of the proof of (60): Polynomial.bernoulli. The gamma function: Real.Gamma, Real.Gamma_add_one and Complex.Gamma_nat_eq_factorial.

Mathlib has no theorem for the inversion formulas (47), the polynomial behavior (57) or the duality (58), and no qq-nomial coefficient. Its hypergeometric function ordinaryHypergeometric covers only the case of (39) with two upper and one lower parameter. The project will state them for the Mathlib functions, and (59) and (60) will wait until the expansion of ln⁡Γ\ln\Gamma is in Mathlib.

Notes and history

The inversion of Example 5 is an instance of what later literature calls binomial inversion: the relations bn=∑k(nk)akb_n = \sum_k\binom{n}{k}a_k and an=∑k(nk)(−1)n−kbka_n = \sum_k\binom{n}{k}(-1)^{n-k}b_k are equivalent, and eq. (33) is the identity behind it. The Stirling inversion (47) is its analogue for the two triangles.

The multinomial theorem (42) was found by Abraham de Moivre in a paper of 1697. The name qq-nomial coefficient in (40) is the book's, and the same numbers are called Gaussian binomial coefficients, after Gauss. Hypergeometric series (39) go back to Euler and to Gauss, who gave them the notation FF in 1812. The method of Gosper (1978) and of Zeilberger (1990) for sums of hypergeometric terms is explained in the book of Petkovsek, Wilf and Zeilberger, A = B, of 1996.

The two kinds of Stirling numbers are named after James Stirling, who introduced the second kind in the Methodus Differentialis of 1730 for the expansion (45). The notation with brackets and braces is that of Jovan Karamata (1935). The asymptotic behavior of the numbers for large nn was studied by L. Moser and M. Wyman (1958) and later by N. M. Temme, H. S. Wilf and H.-K. Hwang. The duality (58) is hidden in Stirling's own treatment.

The project has no errata of Section 1.2.6 to report.

Section 1.2.6 of TAOCP defines the binomial coefficient (rk)\binom{r}{k} for a real number rr and an integer kk, and it gathers the identities that the analysis of algorithms uses every day: symmetry, the addition formula, the sums over a row, a column and a diagonal of Pascal's triangle, the binomial theorem, the negation of the upper index, the products of two coefficients and Vandermonde's convolution. It then solves five model problems, shows the inversion method that turns one sum into its inverse, and ends with the multinomial, qq-binomial and hypergeometric generalizations and with the Stirling numbers of both kinds. This chapter of C1 explains each of the 60 numbered equations and proves each, except for three inputs from analysis that the second file marks. It is cut in two files. The first file, up to eq. (30), has the coefficients themselves and the first four model problems, up to the convolution of Rothe. The second file, from eq. (31), has the fifth model problem, the inversion formulas, the partial sums, the generalizations and the Stirling numbers.

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