taocp

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

Volume P2 · Concrete mathematics

Binomial 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.

Contents
  1. Permutations and factorials
  2. Combinations and the definition of the binomial coefficient
  3. The basic identities
  4. Binomial coefficients with real arguments

Permutations and factorials

Statement

This section counts the ways to put objects in a row. The count leads to the factorial n!n! and to the falling power nk‾n^{\underline{k}} of Section 3.1. The results are eqs. 1.2.5(1) to 1.2.5(6) of TAOCP. The section ends with bounds on n!n! that use only products and inequalities. The sharp estimate of n!n!, Stirling's approximation (eq. 1.2.5(7)), is in P5.

Definition P2.6.1 (permutation). A permutation of nn distinct objects is an arrangement of all of them in a row. Two permutations are equal when they have the same object in each place.

Example P2.6.2. The permutations of the three letters aa, bb, cc are abc,acb,bac,bca,cab,cba.abc, \quad acb, \quad bac, \quad bca, \quad cab, \quad cba. There are six of them. TAOCP lists them as eq. 1.2.5(1).

Example P2.6.3. A permutation of {1,2,…,n}\{1, 2, \dots, n\} can be written as the list of its entries, for example 3 1 4 23\,1\,4\,2 for n=4n = 4. Such a list is the same thing as a one to one map π\pi of {1,…,n}\{1, \dots, n\} onto itself: π(i)\pi(i) is the entry in place ii. Here π(1)=3\pi(1) = 3, π(2)=1\pi(2) = 1, π(3)=4\pi(3) = 4 and π(4)=2\pi(4) = 2. Both views are used in TAOCP. The second one makes it possible to compose two permutations.

Definition P2.6.4 (k-arrangement). Let 0≤k≤n0 \le k \le n. A kk-arrangement of nn distinct objects is a row of kk of them, all different. A permutation is an nn-arrangement. TAOCP writes pnkp_{nk} for the number of kk-arrangements.

Example P2.6.5. The 22-arrangements of aa, bb, cc, dd are abab, acac, adad, baba, bcbc, bdbd, caca, cbcb, cdcd, dada, dbdb, dcdc. There are 12=4⋅312 = 4 \cdot 3 of them. The order counts: abab and baba are different arrangements.

Example P2.6.6. There is exactly one 00-arrangement of nn objects: the empty row. So pn0=1p_{n0} = 1 for each n≥0n \ge 0, also for n=0n = 0.

Theorem P2.6.7 (the number of k-arrangements). For 0≤k≤n0 \le k \le n, pnk=n(n−1)⋯(n−k+1)=nk‾.p_{nk} = n(n - 1) \cdots (n - k + 1) = n^{\underline{k}}. This is eq. 1.2.5(2). The product has kk factors; for k=0k = 0 it is the empty product 11.

Lean: Fintype.card_embedding_eq in Mathlib, which counts the one to one maps from a set of size kk to a set of size nn as n.descFactorial k.

Proof. Induction on kk. For k=0k = 0 both sides are 11. Let k≥1k \ge 1. A kk-arrangement is a (k−1)(k - 1)-arrangement followed by one more object. For each of the pn,k−1p_{n,k-1} rows of length k−1k - 1, the last object can be any of the n−(k−1)n - (k - 1) objects that are not yet in the row. So pnk=pn,k−1(n−k+1)p_{nk} = p_{n,k-1}(n - k + 1), and the induction hypothesis gives the product. □\square

Definition P2.6.8 (factorial). For n≥0n \ge 0, the factorial of nn is n!=1⋅2⋅3⋯n=∏k=1nk.n! = 1 \cdot 2 \cdot 3 \cdots n = \prod_{k=1}^{n} k. For n=0n = 0 the product is empty, so 0!=10! = 1. These are eqs. 1.2.5(4) and 1.2.5(5).

Example P2.6.9. The first values are 0!=1,  1!=1,  2!=2,  3!=6,  4!=24,  5!=120,  6!=720,  7!=5040,  8!=40320,  9!=362880,  10!=3628800.0! = 1, \; 1! = 1, \; 2! = 2, \; 3! = 6, \; 4! = 24, \; 5! = 120, \; 6! = 720, \; 7! = 5040, \; 8! = 40320, \; 9! = 362880, \; 10! = 3628800. They grow fast. The value 20!=243290200817664000020! = 2432902008176640000 has 1919 digits, and 25!25! has 2626 digits.

Example P2.6.10. The rule 0!=10! = 1 is not a special choice. It is the value of the empty product, and it is the only value that keeps the rule n!=n⋅(n−1)!n! = n \cdot (n - 1)! true for n=1n = 1: 1!=1⋅0!1! = 1 \cdot 0!. It also agrees with the count of arrangements: there is one way to arrange zero objects.

Corollary P2.6.11 (the number of permutations). There are n!n! permutations of nn distinct objects, and n!=n⋅(n−1)!(n≥1),nk‾=n!(n−k)!(0≤k≤n).n! = n \cdot (n - 1)! \quad (n \ge 1), \qquad n^{\underline{k}} = \frac{n!}{(n - k)!} \quad (0 \le k \le n). These are eqs. 1.2.5(3) and 1.2.5(6), with the second form of the count.

Lean: Fintype.card_perm, Nat.factorial_succ and Nat.factorial_mul_descFactorial in Mathlib.

Proof. Put k=nk = n in the theorem: pnn=n(n−1)⋯1=n!p_{nn} = n(n - 1) \cdots 1 = n!. The recurrence is the product with its last factor nn split off. For the quotient, n!=n(n−1)⋯(n−k+1)⋅(n−k)!n! = n(n - 1) \cdots (n - k + 1) \cdot (n - k)!, since the first kk factors of n!n! from the top are nk‾n^{\underline{k}} and the rest is (n−k)!(n - k)!. □\square

Theorem P2.6.12 (bounds on n!). For each n≥1n \ge 1, nn/2≤n!≤(n+12)n,2n−1≤n!≤nn.n^{n/2} \le n! \le \left( \frac{n + 1}{2} \right)^n, \qquad 2^{n-1} \le n! \le n^n.

Lean: Nat.factorial_le_pow (the bound n!≤nnn! \le n^n) in Mathlib; the other three are not yet stated as named theorems.

Proof. See the Proof part. □\square

Proof

Two ways to build all permutations. The proof of the count above builds a permutation from left to right: choose the first entry, then the second, and so on. A second way is useful in later volumes. Take a permutation of 1,…,n−11, \dots, n - 1, and insert the number nn into one of the nn gaps: before the first entry, between two entries, or after the last. Each permutation of 1,…,n1, \dots, n arises exactly once: remove nn from it, and the rest is the permutation of 1,…,n−11, \dots, n - 1 that it came from, while the place of nn tells which gap was used. So the number PnP_n of permutations satisfies Pn=nPn−1P_n = n P_{n-1} with P1=1P_1 = 1, and Pn=n!P_n = n! again. For n=3n = 3, the permutation 1 21\,2 gives 3 1 23\,1\,2, 1 3 21\,3\,2, 1 2 31\,2\,3, and 2 12\,1 gives 3 2 13\,2\,1, 2 3 12\,3\,1, 2 1 32\,1\,3.

The bounds. Pair the factors of n!n! from the two ends. Write (n!)2=∏k=1nk⋅∏k=1n(n+1−k)=∏k=1nk(n+1−k).(n!)^2 = \prod_{k=1}^{n} k \cdot \prod_{k=1}^{n} (n + 1 - k) = \prod_{k=1}^{n} k(n + 1 - k). Each factor k(n+1−k)k(n + 1 - k) lies between nn and ((n+1)/2)2((n + 1)/2)^2. For the lower end, k(n+1−k)−n=(k−1)(n−k)≥0,1≤k≤n.k(n + 1 - k) - n = (k - 1)(n - k) \ge 0, \qquad 1 \le k \le n. For the upper end, the product of two numbers with sum n+1n + 1 is largest when they are equal: (n+12)2−k(n+1−k)=(k−n+12)2≥0.\left( \frac{n + 1}{2} \right)^2 - k(n + 1 - k) = \left( k - \frac{n + 1}{2} \right)^2 \ge 0. So nn≤(n!)2≤((n+1)/2)2nn^n \le (n!)^2 \le ((n + 1)/2)^{2n}. Take square roots to get the first pair of bounds.

The second pair is cruder. For the lower bound, n!=1⋅2⋅3⋯nn! = 1 \cdot 2 \cdot 3 \cdots n has n−1n - 1 factors ≥2\ge 2, after the factor 11. For the upper bound, each of the nn factors is at most nn.

The upper bound ((n+1)/2)n((n + 1)/2)^n is better than nnn^n for n≥2n \ge 2, and the lower bound nn/2n^{n/2} is better than 2n−12^{n-1} for n≥3n \ge 3. But neither pair is close to n!n! for large nn. The true size is about 2πn (n/e)n\sqrt{2\pi n}\,(n/e)^n, which lies between the two bounds of the first pair. P5 proves it.

Examples

Example P2.6.13. Prizes. A club gives a first, a second and a third prize to three different members out of 1010. An award is a 33-arrangement of the 1010 members, so there are 103‾=10⋅9⋅8=72010^{\underline{3}} = 10 \cdot 9 \cdot 8 = 720 awards. The formula 10!/7!=3628800/5040=72010!/7! = 3628800/5040 = 720 gives the same number.

Example P2.6.14. A deck of 5252 cards can be shuffled into 52!52! orders. That number has 6868 digits; it is about 8.07⋅10678.07 \cdot 10^{67}. No shuffle that has ever been done is likely to repeat an earlier one. This is the reason why the analysis of sorting in TAOCP Volume 3 averages over the n!n! permutations and does not list them.

Example P2.6.15. The bounds for n=10n = 10. The theorem gives 105=100000≤10!=3628800≤5.510≈25329516.10^5 = 100000 \le 10! = 3628800 \le 5.5^{10} \approx 25329516. The two bounds differ by a factor of about 250250, and 10!10! is about 2.32.3 times their geometric mean 15915251591525. The crude pair gives 29=512≤10!≤10102^9 = 512 \le 10! \le 10^{10}.

Example P2.6.16. Digits of n!n!. From the bounds, the number of decimal digits of n!n! lies between ⌊n2log⁡10n⌋+1\lfloor \tfrac{n}{2} \log_{10} n \rfloor + 1 and ⌊nlog⁡10n+12⌋+1\lfloor n \log_{10} \tfrac{n+1}{2} \rfloor + 1. For n=20n = 20 the range is 1414 to 2121, and the true count is 1919.

Example P2.6.17. The adjacent pair. How many permutations of 1,…,n1, \dots, n have 11 and 22 next to each other, for n≥2n \ge 2? Glue 11 and 22 into one block. The block and the other n−2n - 2 numbers form n−1n - 1 objects, with (n−1)!(n - 1)! arrangements. Inside the block the order is 1 21\,2 or 2 12\,1. So the answer is 2(n−1)!2(n - 1)!. For n=3n = 3 it is 44: 1 2 31\,2\,3, 2 1 32\,1\,3, 3 1 23\,1\,2, 3 2 13\,2\,1.

Exercises

  1. [10] In how many ways can three different prizes go to 1010 people, if nobody gets two prizes? In how many ways if a person may get several prizes?
  2. [12] How many words of four letters, all different, can be formed from an alphabet of 2626 letters?
  3. [M15] Prove that (n+1)!−n!=n⋅n!(n + 1)! - n! = n \cdot n!, and deduce that ∑k=0n−1k⋅k!=n!−1\sum_{k=0}^{n-1} k \cdot k! = n! - 1 for n≥1n \ge 1.
  4. [M18] Find the least nn with n!>2nn! > 2^n and the least nn with n!>3nn! > 3^n, and prove that the inequalities hold for all larger nn.
  5. [M20] Prove that (2n)!/n!(2n)!/n! is a multiple of 2n2^n, and that (2n)!/(2nn!)(2n)!/(2^n n!) is the product 1⋅3⋅5⋯(2n−1)1 \cdot 3 \cdot 5 \cdots (2n - 1) of the first nn odd numbers.
  6. [M20] Prove that the number of permutations of 1,…,n1, \dots, n in which 11 comes before 22 (in any place) is n!/2n!/2 for n≥2n \ge 2.
  7. [M22] Use the bounds of the theorem to show that lg⁡n!≥n2lg⁡n\lg n! \ge \tfrac{n}{2} \lg n, and find the least nn with n!>10100n! > 10^{100}.

Lean

Mathlib has the factorial as Nat.factorial, with the notation n !, and the falling power as Nat.descFactorial n k, the product n(n−1)⋯(n−k+1)n(n - 1) \cdots (n - k + 1). The facts of this section are Nat.factorial_succ (the recurrence), Nat.factorial_mul_descFactorial (the quotient form, as (n−k)!⋅nk‾=n!(n - k)! \cdot n^{\underline{k}} = n!), Nat.factorial_le_pow (n!≤nnn! \le n^n) and Nat.self_le_factorial. The counts are Fintype.card_perm, which says that the permutations of a finite type α\alpha number ∣α∣!|\alpha|!, and Fintype.card_embedding_eq, which says that the one to one maps α→β\alpha \to \beta number ∣β∣∣α∣‾|\beta|^{\underline{|\alpha|}}.

For a real or polynomial argument the falling power is descPochhammer, and the rising power xk‾x^{\overline{k}} is ascPochhammer. The bridge for natural numbers is descPochhammer_eval_eq_descFactorial. TAOCP's (rk)\binom{r}{k} in TAOCP/Notation is built on descPochhammer (Section 6.2).

Notes and history

The counting of arrangements is very old. Rules equal to n!=n⋅(n−1)!n! = n \cdot (n - 1)! appear in Indian and Hebrew texts that are many centuries older than modern algebra, and the notes of TAOCP Section 1.2.5 give the details. The sign n!n! is due to Christian Kramp, in 1808. TAOCP calls the product n(n−1)⋯(n−k+1)n(n - 1) \cdots (n - k + 1) the falling factorial power and writes it nk‾n^{\underline{k}}, the notation of GKP94 that Section 3.1 uses.

The insertion method of the Proof part is the basis of several algorithms in TAOCP that list or generate permutations, in Section 7.2.1.2 of Volume 4A. The bound lg⁡n!≥n2lg⁡n\lg n! \ge \tfrac{n}{2}\lg n of exercise 6.1-7 shows that sorting by comparisons needs at least n2lg⁡n\tfrac{n}{2}\lg n comparisons in the worst case, a number of the order of nlg⁡nn \lg n (Section 5.3.1 of TAOCP).

Combinations and the definition of the binomial coefficient

Statement

Section 6.1 counted rows, where the order of the objects counts. This section counts sets, where the order does not count. The count is the binomial coefficient (nk)\binom{n}{k}. TAOCP then extends the symbol to every real upper index rr and every integer lower index kk. The results are eqs. 1.2.6(1) to 1.2.6(6) of TAOCP.

Definition P2.6.18 (k-combination). Let SS be a set with nn elements and let k≥0k \ge 0. A kk-combination of SS is a subset of SS with exactly kk elements.

Example P2.6.19. The 22-combinations of {a,b,c,d}\{a, b, c, d\} are {a,b},  {a,c},  {a,d},  {b,c},  {b,d},  {c,d}.\{a, b\}, \; \{a, c\}, \; \{a, d\}, \; \{b, c\}, \; \{b, d\}, \; \{c, d\}. There are 66. Section 6.1 found 1212 22-arrangements of the same four letters. Each subset {x,y}\{x, y\} gives the two rows xyxy and yxyx, so 12=6⋅212 = 6 \cdot 2.

Example P2.6.20. For each nn, the set SS has one 00-combination (the empty set) and one nn-combination (SS itself). If k>nk > n, there is no kk-combination at all.

Theorem P2.6.21 (the number of combinations). Let 0≤k≤n0 \le k \le n. A set of nn elements has exactly n(n−1)⋯(n−k+1)k!=nk‾k!\frac{n(n - 1) \cdots (n - k + 1)}{k!} = \frac{n^{\underline{k}}}{k!} kk-combinations. This is eq. 1.2.6(2). The number is written (nk)\binom{n}{k}, read "nn choose kk".

Lean: Finset.card_powersetCard in Mathlib, which gives the number of subsets of size kk of a finite set ss as s.card.choose k.

Proof. Count the kk-arrangements of SS in two ways. By Section 6.1 there are nk‾n^{\underline{k}} of them. Each one is a row of kk different elements, so it determines the set AA of its elements, a kk-combination. Conversely, each kk-combination AA comes from exactly k!k! rows, the permutations of AA. So nk‾=k!⋅cn^{\underline{k}} = k! \cdot c, where cc is the number of kk-combinations. Divide by k!k!. □\square

The quotient nk‾/k!n^{\underline{k}}/k! is an integer, because it counts something. That is not clear from the formula. The Proof part gives a second reason, by the addition formula of Section 6.3.

Definition P2.6.22 (binomial coefficient). Let rr be a real number and let kk be an integer. The binomial coefficient is (rk)=r(r−1)⋯(r−k+1)k!=rk‾k!(k≥0),(rk)=0(k<0).\binom{r}{k} = \frac{r(r - 1) \cdots (r - k + 1)}{k!} = \frac{r^{\underline{k}}}{k!} \quad (k \ge 0), \qquad \binom{r}{k} = 0 \quad (k < 0). This is eq. 1.2.6(3). The upper index rr can be any real (or complex) number. The lower index kk is always an integer.

Example P2.6.23. The first cases are eq. 1.2.6(4): (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}. They hold for every rr. For k=0k = 0 the numerator is the empty product and 0!=10! = 1, so (r0)=1\binom{r}{0} = 1 also when r=0r = 0 or when rr is negative.

Example P2.6.24. Upper indices that are not natural numbers: (−32)=(−3)(−4)2=6,(1/22)=12⋅(−12)2=−18,(5/23)=52⋅32⋅126=516.\binom{-3}{2} = \frac{(-3)(-4)}{2} = 6, \qquad \binom{1/2}{2} = \frac{\tfrac12 \cdot (-\tfrac12)}{2} = -\frac{1}{8}, \qquad \binom{5/2}{3} = \frac{\tfrac52 \cdot \tfrac32 \cdot \tfrac12}{6} = \frac{5}{16}. Such values do not count subsets. They make many identities hold with no side conditions, and they are the coefficients of the binomial series of Section 6.4.

Theorem P2.6.25 (agreement with the count). If nn and kk are integers with 0≤k≤n0 \le k \le n, the value of the definition is the number of kk-combinations of an nn-set. If n≥0n \ge 0 and k>nk > n, then (nk)=0\binom{n}{k} = 0.

Lean: TAOCP.binom_natCast in TAOCP/Notation (tamnd/taocp-lean main), the bridge binom (n : R) k = n.choose k, with Nat.choose_eq_zero_of_lt in Mathlib.

Proof. For 0≤k≤n0 \le k \le n the definition is the formula of the theorem above. For k>n≥0k > n \ge 0 the product n(n−1)⋯(n−k+1)n(n - 1) \cdots (n - k + 1) has the factor n−n=0n - n = 0, since n−k+1≤0≤nn - k + 1 \le 0 \le n. □\square

So for natural nn and kk, the value (nk)\binom{n}{k} is the number of kk-combinations, also for k>nk > n, where both are 00.

Theorem P2.6.26 (factorial form). For integers n≥0n \ge 0 and 0≤k≤n0 \le k \le n, (nk)=n!k! (n−k)!.\binom{n}{k} = \frac{n!}{k!\,(n - k)!}. This is eq. 1.2.6(5).

Lean: Nat.choose_eq_factorial_div_factorial and Nat.choose_mul_factorial_mul_factorial in Mathlib.

Proof. By Section 6.1, nk‾=n!/(n−k)!n^{\underline{k}} = n!/(n - k)!. Divide both sides by k!k!. □\square

Theorem P2.6.27 (symmetry). For every integer n≥0n \ge 0 and every integer kk, (nk)=(nn−k).\binom{n}{k} = \binom{n}{n - k}. This is eq. 1.2.6(6).

Lean: Nat.choose_symm (for k≤nk \le n) in Mathlib.

Proof. If 0≤k≤n0 \le k \le n, then 0≤n−k≤n0 \le n - k \le n too, and the factorial form gives the same value n!/(k!(n−k)!)n!/(k!(n - k)!) for both sides. If k<0k < 0, then n−k>nn - k > n, so both sides are 00, the left by definition and the right by the theorem of agreement. If k>nk > n, the same holds with the roles of kk and n−kn - k swapped. □\square

Remark P2.6.28. Symmetry needs n≥0n \ge 0. For n=−1n = -1 and k=0k = 0 the left side is (−10)=1\binom{-1}{0} = 1, but the right side is (−1−1)=0\binom{-1}{-1} = 0, since the lower index is negative. Symmetry also fails for rr that is not an integer: then r−kr - k is not an integer, and the right side has no meaning. The Proof part shows a bijective reason for symmetry that also explains why it needs a finite set.

Proof

The bijection behind symmetry. Let SS be a set of nn elements. Map each kk-subset AA of SS to its complement S∖AS \setminus A. The complement has n−kn - k elements, and taking the complement twice gives AA back. So the map is a bijection between the kk-subsets and the (n−k)(n - k)-subsets, and the two counts are equal. This proof needs a finite set SS, so it does not apply to a negative or fractional upper index. The remark of the Statement part shows that the identity is false there.

A second proof of the count. Section 6.3 proves the addition formula (nk)=(n−1k)+(n−1k−1)\binom{n}{k} = \binom{n-1}{k} + \binom{n-1}{k-1} from the definition. The same formula holds for the numbers cnkc_{nk} of kk-subsets of {1,…,n}\{1, \dots, n\}: such a subset either omits nn, and then it is a kk-subset of {1,…,n−1}\{1, \dots, n - 1\}, or it contains nn, and then the rest is a (k−1)(k - 1)-subset of {1,…,n−1}\{1, \dots, n - 1\}. Both families also agree for n=0n = 0: (0k)\binom{0}{k} and c0kc_{0k} are 11 for k=0k = 0 and 00 otherwise. So induction on nn shows cnk=(nk)c_{nk} = \binom{n}{k} for all n≥0n \ge 0 and all integers kk. This proof also shows that each (nk)\binom{n}{k} is an integer.

The definition is a polynomial in r. For fixed k≥0k \ge 0, the value (rk)\binom{r}{k} is a polynomial in rr of degree kk, with leading coefficient 1/k!1/k!. Its roots are r=0,1,…,k−1r = 0, 1, \dots, k - 1. For example, (r3)=r(r−1)(r−2)6=r3−3r2+2r6.\binom{r}{3} = \frac{r(r - 1)(r - 2)}{6} = \frac{r^3 - 3r^2 + 2r}{6}. This fact is the basis of Section 6.4. Two polynomials in rr that agree at every natural number are equal, so many identities proved by counting for n∈ℕn \in \mathbb{N} hold for every real rr.

Examples

Example P2.6.29. Pascal's triangle. Row nn lists (n0),(n1),…,(nn)\binom{n}{0}, \binom{n}{1}, \dots, \binom{n}{n}. The rows 00 to 1010 are below. Each entry inside a row is the sum of the entry above it and the entry above and to the left (the addition formula of Section 6.3). Each row reads the same from both ends (symmetry).

nn k=0k=0 11 22 33 44 55 66 77 88 99 1010
00 1
11 1 1
22 1 2 1
33 1 3 3 1
44 1 4 6 4 1
55 1 5 10 10 5 1
66 1 6 15 20 15 6 1
77 1 7 21 35 35 21 7 1
88 1 8 28 56 70 56 28 8 1
99 1 9 36 84 126 126 84 36 9 1
1010 1 10 45 120 210 252 210 120 45 10 1

Example P2.6.30. Card hands. A hand of 55 cards from a deck of 5252 is a 55-combination, so there are (525)=52⋅51⋅50⋅49⋅48/120=2598960\binom{52}{5} = 52 \cdot 51 \cdot 50 \cdot 49 \cdot 48/120 = 2598960 hands. The order in which the cards arrive does not count. If it did count, there would be 525‾=31187520052^{\underline{5}} = 311875200 rows, which is 5!=1205! = 120 times as many.

Example P2.6.31. Lattice paths. A path from (0,0)(0, 0) to (6,4)(6, 4) that uses unit steps to the right and up has 1010 steps, and 44 of them go up. The path is fixed by the choice of which 44 of the 1010 steps go up. So there are (104)=210\binom{10}{4} = 210 paths. Symmetry says that this is also (106)\binom{10}{6}, the number of ways to choose the 66 steps to the right.

Example P2.6.32. The value of (rk)\binom{r}{k} for negative kk is 00 by definition, also when rr is negative. For example (−21)=−2\binom{-2}{1} = -2, but (−2−3)=0\binom{-2}{-3} = 0. Since −2−1=−3-2 - 1 = -3, symmetry would claim that these two are equal. This is one more case where symmetry fails for a negative upper index.

Exercises

  1. [10] Compute (103)\binom{10}{3}, (107)\binom{10}{7}, (−32)\binom{-3}{2} and (5/23)\binom{5/2}{3} from the definition.
  2. [12] How many hands of 55 cards from a deck of 5252 have all five cards in the same suit?
  3. [M18] Let n≥1n \ge 1. Prove that (nk+1)/(nk)=(n−k)/(k+1)\binom{n}{k+1} / \binom{n}{k} = (n - k)/(k + 1) for 0≤k<n0 \le k < n. Use this to show that the entries of row nn of Pascal's triangle increase up to the middle and then decrease, and find the largest entry.
  4. [M15] How many lattice paths from (0,0)(0, 0) to (6,4)(6, 4) with unit steps right and up pass through the point (3,2)(3, 2)?
  5. [M12] Write (r4)\binom{r}{4} as a polynomial in rr with rational coefficients, and check it at r=4r = 4, r=5r = 5 and r=−1r = -1.
  6. [M15] Prove that (rk)=0\binom{r}{k} = 0 for an integer k≥0k \ge 0 and a real rr if and only if r∈{0,1,…,k−1}r \in \{0, 1, \dots, k - 1\}.
  7. [M22] Prove that the number of kk-subsets of {1,2,…,n}\{1, 2, \dots, n\} that contain no two consecutive numbers is (n−k+1k)\binom{n - k + 1}{k}. How many 44-subsets of {1,…,12}\{1, \dots, 12\} have this property?

Lean

TAOCP/Notation (tamnd/taocp-lean main) has the book's symbol as TAOCP.binom (r : R) : ℤ → R, for rr in a field RR and an integer lower index. It is defined from descPochhammer, the falling power as a polynomial, divided by k!k!, and it is 00 for k<0k < 0. The basic facts are TAOCP.binom_natCast_right (the definition for k≥0k \ge 0, which holds by rfl), TAOCP.binom_of_neg (the value 00 for k<0k < 0) and TAOCP.binom_zero_right ((r0)=1\binom{r}{0} = 1). The bridge to Mathlib is TAOCP.binom_natCast, which says that binom (n : R) k = n.choose k for natural nn and kk when RR has characteristic zero.

Mathlib has two related functions. Nat.choose n k takes natural numbers only, and it is 00 for k>nk > n. Ring.choose r k takes an element rr of a binomial ring, such as ℤ\mathbb{Z} or a field of characteristic zero, and a natural number kk; Ring.choose_natCast is its bridge to Nat.choose. Neither function allows a negative lower index. The facts of this section in Mathlib are Finset.card_powersetCard, Nat.choose_eq_factorial_div_factorial, Nat.choose_mul_factorial_mul_factorial, Nat.choose_symm, Nat.choose_symm_add, Nat.choose_eq_zero_of_lt, Nat.choose_zero_right, Nat.choose_self and Nat.choose_two_right.

Notes and history

Pascal's triangle is much older than Pascal. It is in Chinese texts of the thirteenth century and in Persian and Indian works before that. Blaise Pascal wrote a full treatise on its properties in 1654, published in 1665, and the name comes from that treatise. The notation (nk)\binom{n}{k} is due to Andreas von Ettingshausen (1826).

The extension to every real rr and to negative kk is the convention of TAOCP and of GKP94. Older books often define (nk)\binom{n}{k} only for 0≤k≤n0 \le k \le n, and they need side conditions in each identity. Section 6.3 shows the gain: the addition formula and several summation formulas hold for every real rr and every integer kk. The price is that symmetry, which is the most familiar identity, needs an extra hypothesis.

The basic identities

Statement

This section proves the identities that TAOCP lists as eqs. 1.2.6(7) to 1.2.6(14) and 1.2.6(17) to 1.2.6(20). Most of them hold for every real upper index rr and every integer lower index kk. The proofs work with the definition of Section 6.2, (rk)=rk‾k!(k≥0),(rk)=0(k<0),\binom{r}{k} = \frac{r^{\underline{k}}}{k!} \quad (k \ge 0), \qquad \binom{r}{k} = 0 \quad (k < 0), and with the rule rk+1‾=rk‾(r−k)=r (r−1)k‾r^{\underline{k+1}} = r^{\underline{k}}(r - k) = r\,(r - 1)^{\underline{k}} of Section 3.1. Each theorem states the range of its variables. A reader who applies an identity outside that range can get a false result.

Theorem P2.6.33 (absorption). 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}. This is eq. 1.2.6(7). The form k(rk)=r(r−1k−1)k \binom{r}{k} = r \binom{r - 1}{k - 1} holds for all integers kk, also for k=0k = 0.

Lean: Nat.add_one_mul_choose_eq in Mathlib, the case of natural numbers in the form (n+1)(nk)=(n+1k+1)(k+1)(n + 1)\binom{n}{k} = \binom{n+1}{k+1}(k + 1).

Proof. If k<0k < 0, both sides are 00. If k≥1k \ge 1, then rk‾=r (r−1)k−1‾r^{\underline{k}} = r\,(r - 1)^{\underline{k-1}} and k!=k (k−1)!k! = k\,(k - 1)!, so (rk)=r (r−1)k−1‾/(k (k−1)!)=(r/k)(r−1k−1)\binom{r}{k} = r\,(r - 1)^{\underline{k-1}}/(k\,(k - 1)!) = (r/k)\binom{r-1}{k-1}. For the second form and k=0k = 0, both sides are 00. □\square

Corollary P2.6.34 (absorption at the other end). For every real rr and every integer kk with k≠rk \ne r, (rk)=rr−k(r−1k).\binom{r}{k} = \frac{r}{r - k} \binom{r - 1}{k}. This is eq. 1.2.6(8). The form (r−k)(rk)=r(r−1k)(r - k)\binom{r}{k} = r\binom{r - 1}{k} holds for all integers kk.

Lean: Nat.choose_mul_succ_eq in Mathlib, in the form (nk)(n+1)=(n+1k)(n+1−k)\binom{n}{k}(n + 1) = \binom{n+1}{k}(n + 1 - k) for natural numbers.

Proof. If k<0k < 0, both sides of the second form are 00. If k≥0k \ge 0, then (r−k) rk‾=rk+1‾=r (r−1)k‾(r - k)\,r^{\underline{k}} = r^{\underline{k+1}} = r\,(r - 1)^{\underline{k}}. Divide by k!k!. If k≠rk \ne r, divide by r−kr - k. □\square

Theorem P2.6.35 (addition formula). 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}. This is eq. 1.2.6(9).

Lean: Nat.choose_succ_succ' (natural numbers) and Ring.choose_succ_succ (a binomial ring, natural kk) in Mathlib.

Proof. If k<0k < 0, all three terms are 00. If k=0k = 0, the equation is 1=1+01 = 1 + 0. Let k≥1k \ge 1 and put P=(r−1)k−1‾P = (r - 1)^{\underline{k-1}}. Then (r−1)k‾=P (r−k)(r - 1)^{\underline{k}} = P\,(r - k) and k!=k (k−1)!k! = k\,(k - 1)!, so (r−1k)+(r−1k−1)=P (r−k)k!+P kk!=r Pk!=rk‾k!=(rk).  □\binom{r - 1}{k} + \binom{r - 1}{k - 1} = \frac{P\,(r - k)}{k!} + \frac{P\,k}{k!} = \frac{r\,P}{k!} = \frac{r^{\underline{k}}}{k!} = \binom{r}{k}. \;\square

Theorem P2.6.36 (parallel summation). For every real rr and every integer n≥0n \ge 0, ∑k=0n(r+kk)=(r+n+1n).\sum_{k=0}^{n} \binom{r + k}{k} = \binom{r + n + 1}{n}. This is eq. 1.2.6(10).

Lean: Nat.sum_range_add_choose in Mathlib, for natural rr, in the form ∑i=0n(i+kk)=(n+k+1k+1)\sum_{i=0}^{n}\binom{i+k}{k} = \binom{n+k+1}{k+1}, which is the same identity after symmetry.

Proof. See the Proof part. □\square

Theorem P2.6.37 (upper summation). For all integers m≥0m \ge 0 and n≥0n \ge 0, ∑k=0n(km)=(n+1m+1).\sum_{k=0}^{n} \binom{k}{m} = \binom{n + 1}{m + 1}. This is eq. 1.2.6(11).

Lean: Nat.sum_Icc_choose in Mathlib, where the sum starts at k=mk = m; the terms with k<mk < m are 00.

Proof. See the Proof part. □\square

Corollary P2.6.38 (sum of squares). For every integer n≥0n \ge 0, ∑k=0nk2=2(n+13)+(n+12).\sum_{k=0}^{n} k^2 = 2\binom{n + 1}{3} + \binom{n + 1}{2}. This is eq. 1.2.6(12). Section 2.2 finds the same sum by other means.

Lean: not yet stated in this form; Mathlib has Finset.sum_range_id_mul_two for the sum of kk, and the square case follows from Nat.sum_Icc_choose.

Proof. For every integer kk, k2=2(k2)+(k1)k^2 = 2\binom{k}{2} + \binom{k}{1}, since 2⋅k(k−1)/2+k=k22 \cdot k(k - 1)/2 + k = k^2. Sum over 0≤k≤n0 \le k \le n and use upper summation with m=2m = 2 and m=1m = 1. □\square

Theorem P2.6.39 (binomial theorem). For every integer n≥0n \ge 0 and all xx and yy in a commutative ring, (x+y)n=∑k=0n(nk)xkyn−k.(x + y)^n = \sum_{k=0}^{n} \binom{n}{k} x^k y^{n-k}. This is eq. 1.2.6(13). The sum can run over all integers kk, since the other terms are 00. The rule x0=1x^0 = 1 holds for every xx, also for x=0x = 0; this is eq. 1.2.6(14), and it is needed for x=0x = 0 or y=0y = 0.

Lean: add_pow (commutative semiring) and Commute.add_pow (two elements that commute) in Mathlib.

Proof. See the Proof part. □\square

Corollary P2.6.40 (row sums). For every integer n≥0n \ge 0, ∑k=0n(nk)=2n,∑k=0n(−1)k(nk)=[n=0].\sum_{k=0}^{n} \binom{n}{k} = 2^n, \qquad \sum_{k=0}^{n} (-1)^k \binom{n}{k} = [n = 0].

Lean: Nat.sum_range_choose and Int.alternating_sum_range_choose in Mathlib.

Proof. Put x=y=1x = y = 1 in the binomial theorem, and then x=−1x = -1, y=1y = 1. For n=0n = 0 the second sum is (−1+1)0=00=1(-1 + 1)^0 = 0^0 = 1, by eq. 1.2.6(14). □\square

Theorem P2.6.41 (negating the upper index). For every real rr and every integer kk, (rk)=(−1)k(k−r−1k).\binom{r}{k} = (-1)^k \binom{k - r - 1}{k}. This is eq. 1.2.6(17).

Lean: Ring.choose_neg in Mathlib, in the form (−rn)=(−1)n(r+n−1n)\binom{-r}{n} = (-1)^n \binom{r + n - 1}{n} for natural nn.

Proof. If k<0k < 0, both sides are 00. If k≥0k \ge 0, change the sign of each of the kk factors of the falling power: r(r−1)⋯(r−k+1)=(−1)k(−r)(1−r)⋯(k−1−r).r(r - 1) \cdots (r - k + 1) = (-1)^k (-r)(1 - r) \cdots (k - 1 - r). The product on the right has the factors k−r−1k - r - 1 down to −r-r, so it is (k−r−1)k‾(k - r - 1)^{\underline{k}}. Divide by k!k!. □\square

Corollary P2.6.42 (the form for integers). For every integer n≥0n \ge 0 and every integer mm, (nm)=(−1)n−m(−(m+1)n−m).\binom{n}{m} = (-1)^{n-m} \binom{-(m + 1)}{n - m}. This is eq. 1.2.6(19).

Lean: not yet stated; it follows from TAOCP.binom and the theorem above with k=n−mk = n - m.

Proof. By symmetry, (nm)=(nn−m)\binom{n}{m} = \binom{n}{n - m}. Apply the negation theorem with k=n−mk = n - m: the new upper index is (n−m)−n−1=−(m+1)(n - m) - n - 1 = -(m + 1). □\square

Theorem P2.6.43 (alternating partial sums). For every real rr and every integer nn, ∑k≤n(−1)k(rk)=(−1)n(r−1n).\sum_{k \le n} (-1)^k \binom{r}{k} = (-1)^n \binom{r - 1}{n}. This is eq. 1.2.6(18). The sum is finite, since the terms with k<0k < 0 are 00.

Lean: Int.alternating_sum_range_choose_eq_choose in Mathlib, for r=n′+1r = n' + 1 with natural n′n'.

Proof. If n<0n < 0, both sides are 00. For n≥0n \ge 0, use induction. For n=0n = 0, both sides are 11. The step from n−1n - 1 to nn adds (−1)n(rn)(-1)^n \binom{r}{n} to the left side. On the right, by the addition formula, (−1)n−1(r−1n−1)+(−1)n(rn)=(−1)n((rn)−(r−1n−1))=(−1)n(r−1n).  □(-1)^{n-1}\binom{r - 1}{n - 1} + (-1)^n \binom{r}{n} = (-1)^n \left( \binom{r}{n} - \binom{r - 1}{n - 1} \right) = (-1)^n \binom{r - 1}{n}. \;\square

Theorem P2.6.44 (trinomial revision). 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}. This is eq. 1.2.6(20).

Lean: Nat.choose_mul in Mathlib, for natural numbers s≤ks \le k in the form (nk)(ks)=(ns)(n−sk−s)\binom{n}{k}\binom{k}{s} = \binom{n}{s}\binom{n-s}{k-s}.

Proof. See the Proof part. □\square

Proof

Parallel summation. Use induction on nn. For n=0n = 0, both sides are (r0)=1\binom{r}{0} = 1. Assume the identity for n−1n - 1. Then ∑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}, by the addition formula with upper index r+n+1r + n + 1. The identity is true for every real rr, because the addition formula is. A second way to read it: the sum on the left adds the entries of a diagonal of Pascal's triangle, and the result is the entry just below the last one.

Upper summation. Use induction on nn. For n=0n = 0 the left side is (0m)\binom{0}{m}, which is 11 for m=0m = 0 and 00 for m≥1m \ge 1, and so is (1m+1)\binom{1}{m+1}. Assume the identity for n−1n - 1. Then ∑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}. A counting proof: a (m+1)(m + 1)-subset of {0,1,…,n}\{0, 1, \dots, n\} has a largest element kk, and the other mm elements form an mm-subset of {0,…,k−1}\{0, \dots, k - 1\}. There are (km)\binom{k}{m} such subsets for each kk. The hypothesis m≥0m \ge 0 is needed: for m=−1m = -1 the left side is 00 and the right side is (n+10)=1\binom{n+1}{0} = 1.

Upper summation also follows from parallel summation. Put r=mr = m and sum (m+jj)=(m+jm)\binom{m + j}{j} = \binom{m + j}{m} for 0≤j≤n−m0 \le j \le n - m; by symmetry, this is the sum of (km)\binom{k}{m} for m≤k≤nm \le k \le n.

The binomial theorem. Use induction on nn. For n=0n = 0 both sides are 11, by the rule x0=y0=1x^0 = y^0 = 1. Assume the theorem for n−1n - 1. Then (x+y)n=(x+y)∑k(n−1k)xkyn−1−k=∑k(n−1k−1)xkyn−k+∑k(n−1k)xkyn−k.(x + y)^n = (x + y)\sum_{k} \binom{n - 1}{k} x^k y^{n-1-k} = \sum_{k} \binom{n - 1}{k - 1} x^k y^{n-k} + \sum_{k} \binom{n - 1}{k} x^k y^{n-k}. In the first sum the index was shifted from kk to k−1k - 1. By the addition formula, the two coefficients of xkyn−kx^k y^{n-k} add up to (nk)\binom{n}{k}. The sums run over all integers kk; only 0≤k≤n0 \le k \le n give nonzero terms, so no term y−1y^{-1} occurs. The proof uses xy=yxxy = yx. That is why Mathlib has the separate form Commute.add_pow for rings that are not commutative.

A counting proof: expand the product of nn factors (x+y)(x + y). Each term picks xx from some of the factors and yy from the others. The terms with xx from exactly kk factors give xkyn−kx^k y^{n-k}, and there are (nk)\binom{n}{k} ways to choose those kk factors.

Trinomial revision. If k<0k < 0, both sides are 00, since (mk)=(rk)=0\binom{m}{k} = \binom{r}{k} = 0. If m<km < k, then m−k<0m - k < 0, so the right side is 00. The left side is 00 too: if m<0m < 0, then (rm)=0\binom{r}{m} = 0; if 0≤m<k0 \le m < k, then (mk)=0\binom{m}{k} = 0. Now let 0≤k≤m0 \le k \le m. The factors mk‾m^{\underline{k}} and k!k! give (mk)=m!/(k!(m−k)!)\binom{m}{k} = m!/(k!(m - k)!). Also rm‾=rk‾ (r−k)m−k‾r^{\underline{m}} = r^{\underline{k}}\,(r - k)^{\underline{m-k}}, since the first kk factors of rm‾r^{\underline{m}} form rk‾r^{\underline{k}} and the next m−km - k factors start at r−kr - k. So (rm)(mk)=rm‾m!⋅m!k! (m−k)!=rk‾k!⋅(r−k)m−k‾(m−k)!=(rk)(r−km−k).\binom{r}{m}\binom{m}{k} = \frac{r^{\underline{m}}}{m!}\cdot\frac{m!}{k!\,(m - k)!} = \frac{r^{\underline{k}}}{k!}\cdot\frac{(r - k)^{\underline{m-k}}}{(m - k)!} = \binom{r}{k}\binom{r - k}{m - k}. For natural rr there is a counting proof. Both sides count pairs (A,B)(A, B) with B⊆A⊆SB \subseteq A \subseteq S, ∣S∣=r|S| = r, ∣A∣=m|A| = m and ∣B∣=k|B| = k. The left side chooses AA first and then BB inside AA. The right side chooses BB first and then the m−km - k other elements of AA outside BB.

Examples

Example P2.6.45. A sum with absorption. Since k(5k)=5(4k−1)k\binom{5}{k} = 5\binom{4}{k-1}, ∑kk(5k)=5∑k(4k−1)=5⋅24=80.\sum_{k} k \binom{5}{k} = 5 \sum_{k} \binom{4}{k - 1} = 5 \cdot 2^4 = 80. Directly: 0+5+20+30+20+5=800 + 5 + 20 + 30 + 20 + 5 = 80.

Example P2.6.46. Upper summation with m=2m = 2 and n=6n = 6 gives (22)+(32)+⋯+(62)=1+3+6+10+15=35=(73)\binom{2}{2} + \binom{3}{2} + \dots + \binom{6}{2} = 1 + 3 + 6 + 10 + 15 = 35 = \binom{7}{3}. Parallel summation with r=3r = 3 and n=4n = 4 gives (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}.

Example P2.6.47. The sum of squares for n=10n = 10 is 2(113)+(112)=2⋅165+55=3852\binom{11}{3} + \binom{11}{2} = 2 \cdot 165 + 55 = 385, which agrees with 1+4+9+⋯+100=3851 + 4 + 9 + \dots + 100 = 385.

Example P2.6.48. Negation. With r=−2r = -2 and k=3k = 3, the theorem gives (−23)=(−1)3(43)=−4\binom{-2}{3} = (-1)^3\binom{4}{3} = -4. Directly: (−2)(−3)(−4)/6=−4(-2)(-3)(-4)/6 = -4. With eq. 1.2.6(19), (52)=(−1)3(−33)=−(−3)(−4)(−5)/6=10\binom{5}{2} = (-1)^3\binom{-3}{3} = -(-3)(-4)(-5)/6 = 10.

Example P2.6.49. Alternating partial sums. With r=5r = 5 and n=2n = 2, the left side is 1−5+10=61 - 5 + 10 = 6, and the right side is (42)=6\binom{4}{2} = 6. For n≥rn \ge r with natural r≥1r \ge 1 the right side is 00; this is the second row sum of the corollary.

Example P2.6.50. Trinomial revision with r=6r = 6, m=3m = 3 and k=1k = 1: (63)(31)=20⋅3=60\binom{6}{3}\binom{3}{1} = 20 \cdot 3 = 60, and (61)(52)=6⋅10=60\binom{6}{1}\binom{5}{2} = 6 \cdot 10 = 60. The left side counts the committees of 33 out of 66 people with a chair; the right side chooses the chair first.

Exercises

  1. [M12] Evaluate ∑kk(8k)\sum_{k} k\binom{8}{k} by absorption, and check the result against the direct sum.
  2. [M10] Evaluate ∑k=010(k3)\sum_{k=0}^{10} \binom{k}{3} in closed form.
  3. [10] Expand (2x−3)4(2x - 3)^4 with the binomial theorem.
  4. [M20] Find integers aa, bb, cc with k3=a(k3)+b(k2)+c(k1)k^3 = a\binom{k}{3} + b\binom{k}{2} + c\binom{k}{1} for all integers kk, and deduce a closed form of ∑k=0nk3\sum_{k=0}^{n} k^3 in terms of binomial coefficients.
  5. [M18] Prove that ∑k(−1)kk(nk)=0\sum_{k} (-1)^k k \binom{n}{k} = 0 for every integer n≥2n \ge 2. What is the value for n=1n = 1?
  6. [M12] Evaluate ∑k=05(−1)k(7k)\sum_{k=0}^{5} (-1)^k \binom{7}{k} with eq. 1.2.6(18), and check it directly.
  7. [M22] A group of nn people chooses a committee, and the committee chooses a subcommittee of kk members. Prove that ∑m(nm)(mk)=(nk)2n−k\sum_{m} \binom{n}{m}\binom{m}{k} = \binom{n}{k} 2^{n-k} for integers n,k≥0n, k \ge 0, once with trinomial revision and once by counting.
  8. [M15] Compute (−34)\binom{-3}{4} from the definition and with the negation theorem.

Lean

The natural number versions of all identities of this section are in Mathlib: Nat.add_one_mul_choose_eq and Nat.choose_mul_succ_eq (absorption), Nat.choose_succ_succ' (addition formula), Nat.sum_range_add_choose (parallel summation), Nat.sum_Icc_choose (upper summation), add_pow and Commute.add_pow (binomial theorem), Nat.sum_range_choose and Int.alternating_sum_range_choose (row sums), Int.alternating_sum_range_choose_eq_choose (alternating partial sums for a natural upper index) and Nat.choose_mul (trinomial revision). For a general upper index, Ring.choose_succ_succ and Ring.choose_neg cover the addition formula and the negation of the upper index, with a natural lower index.

For TAOCP's symbol TAOCP.binom in TAOCP/Notation (tamnd/taocp-lean main), with an integer lower index, the identities of this section are not yet stated. The plan is to prove each one for k≥0k \ge 0 by the same algebra as above, with descPochhammer and its rule descPochhammer_succ_right, and to dispose of k<0k < 0 with TAOCP.binom_of_neg.

Notes and history

Upper summation and parallel summation are old: special cases, such as sums of triangular numbers, appear in Greek and Indian arithmetic. Pascal's treatise of 1654 proves several of them by induction, and it is one of the first texts to state induction as a method of proof. The name trinomial revision is from GKP94. The binomial theorem for natural exponents was known in the Islamic world and in China long before Isaac Newton, who extended it to fractional exponents around 1665; Section 6.4 treats that extension.

The table of identities in Section 1.2.6 of TAOCP is meant to be used as a toolbox. GKP94 Section 5.2 gives guidance on which tool to try first. A good rule is to bring the lower index to a simple form with symmetry or negation, to move factors out with absorption, and only then to sum.

Binomial coefficients with real arguments

Statement

Section 6.2 defined (rk)\binom{r}{k} for every real rr. This section explains why that is useful. First, an identity that is proved by counting for natural rr often holds for all real rr, by the polynomial argument. Second, the values for negative and half-integer rr have simple closed forms. Third, the numbers (rk)\binom{r}{k} are the coefficients of the power series of (1+x)r(1 + x)^r, which is eq. 1.2.6(15). The proof of convergence for a general real rr is in P5. This section proves the case of a negative integer rr, which needs only the identities of Section 6.3.

Theorem P2.6.51 (polynomial argument). Let pp and qq be polynomials with real coefficients. If p(n)=q(n)p(n) = q(n) for infinitely many integers nn, then p=qp = q, and so p(r)=q(r)p(r) = q(r) for every real rr.

Lean: Polynomial.eq_of_infinite_eval_eq in Mathlib, and Polynomial.funext for an infinite ring of coefficients.

Proof. The difference p−qp - q has infinitely many roots. A nonzero polynomial of degree dd has at most dd roots, since each root aa splits off a factor x−ax - a and lowers the degree by one. So p−qp - q is the zero polynomial. □\square

The argument applies to an identity in rr when, for fixed integer indices, both sides are polynomials in rr. That is true for (rk)\binom{r}{k}, for (r+ak)\binom{r + a}{k} with a fixed aa, and for finite sums and products of such terms. It is false when rr appears in a lower index, or in the number of terms of a sum.

Theorem P2.6.52 (negative integer upper index). For every integer n≥1n \ge 1 and every integer k≥0k \ge 0, (−nk)=(−1)k(n+k−1k).\binom{-n}{k} = (-1)^k \binom{n + k - 1}{k}. In particular (−1k)=(−1)k\binom{-1}{k} = (-1)^k, and (−2k)=(−1)k(k+1)\binom{-2}{k} = (-1)^k (k + 1).

Lean: Ring.choose_neg in Mathlib, with Ring.choose_natCast for the bridge to Nat.choose.

Proof. This is the negation theorem of Section 6.3 with r=−nr = -n: the new upper index is k+n−1k + n - 1. For n=1n = 1, (kk)=1\binom{k}{k} = 1; for n=2n = 2, (k+1k)=k+1\binom{k + 1}{k} = k + 1. □\square

So (−1)k(−nk)(-1)^k\binom{-n}{k} is a natural number. It counts the multisets of size kk with elements from a set of nn (exercise 6.4-7 treats the integer values in general).

Theorem P2.6.53 (half-integer upper index). For every integer k≥0k \ge 0, (−1/2k)=(−14)k(2kk),(1/2k)=(−1)k−14k(2k−1)(2kk).\binom{-1/2}{k} = \left( -\frac{1}{4} \right)^{k} \binom{2k}{k}, \qquad \binom{1/2}{k} = \frac{(-1)^{k-1}}{4^k (2k - 1)} \binom{2k}{k}.

Lean: not yet stated; Mathlib has the values of Ring.choose at natural numbers only.

Proof. See the Proof part. □\square

Theorem P2.6.54 (series for a negative integer exponent). For every integer n≥1n \ge 1 and every real xx with ∣x∣<1|x| < 1, 1(1−x)n=∑k≥0(n+k−1k)xk,(1+x)−n=∑k≥0(−nk)xk.\frac{1}{(1 - x)^n} = \sum_{k \ge 0} \binom{n + k - 1}{k} x^k, \qquad (1 + x)^{-n} = \sum_{k \ge 0} \binom{-n}{k} x^k.

Lean: Real.one_div_one_sub_rpow_hasFPowerSeriesOnBall_zero in Mathlib, for every real exponent, with coefficients Ring.choose (a + k - 1) k.

Proof. See the Proof part. □\square

Theorem P2.6.55 (binomial series). For every real rr and every real xx with ∣x∣<1|x| < 1, (1+x)r=∑k≥0(rk)xk.(1 + x)^r = \sum_{k \ge 0} \binom{r}{k} x^k. This is eq. 1.2.6(15). If rr is a natural number, the sum is finite and the identity holds for every xx; that case is the binomial theorem of Section 6.3.

Lean: Real.one_add_rpow_hasFPowerSeriesOnBall_zero in Mathlib, which says that binomialSeries ℝ a is the power series of (1+x)a(1 + x)^a on the ball of radius 11 about 00.

Proof. For natural rr it is the binomial theorem with y=1y = 1. For a negative integer rr it is the theorem above. For other real rr, see P5, which proves that the series converges and that its sum is (1+x)r(1 + x)^r. □\square

Proof

The half-integer values. For k≥0k \ge 0, the numerator of (−1/2k)\binom{-1/2}{k} is (−12)(−32)⋯(−2k−12)=(−12)k⋅1⋅3⋯(2k−1).\left( -\frac12 \right)\left( -\frac32 \right) \cdots \left( -\frac{2k - 1}{2} \right) = \left( -\frac12 \right)^{k} \cdot 1 \cdot 3 \cdots (2k - 1). The product of the odd numbers is (2k)!/(2kk!)(2k)!/(2^k k!), since (2k)!(2k)! is the product of the odd numbers up to 2k−12k - 1 and the even numbers 2⋅4⋯2k=2kk!2 \cdot 4 \cdots 2k = 2^k k!. Divide by k!k!: (−1/2k)=(−12)k(2k)!2k k! k!=(−14)k(2kk).\binom{-1/2}{k} = \left( -\frac12 \right)^{k} \frac{(2k)!}{2^k\,k!\,k!} = \left( -\frac14 \right)^{k} \binom{2k}{k}. For (1/2k)\binom{1/2}{k} with k≥1k \ge 1, use absorption at the other end (eq. 1.2.6(8)) with r=1/2r = 1/2: (1/2k)=1/21/2−k(−1/2k)=11−2k(−1/2k)\binom{1/2}{k} = \frac{1/2}{1/2 - k}\binom{-1/2}{k} = \frac{1}{1 - 2k}\binom{-1/2}{k}. Then (1/2k)=−12k−1⋅(−1)k4k(2kk)=(−1)k−14k(2k−1)(2kk).\binom{1/2}{k} = \frac{-1}{2k - 1} \cdot \frac{(-1)^k}{4^k}\binom{2k}{k} = \frac{(-1)^{k-1}}{4^k (2k - 1)}\binom{2k}{k}. For k=0k = 0 the formula gives −1−1⋅1=1=(1/20)\frac{-1}{-1} \cdot 1 = 1 = \binom{1/2}{0}, so it holds for k=0k = 0 too.

The series for a negative integer exponent. Put an,k=(n+k−1k)a_{n,k} = \binom{n + k - 1}{k} for n≥1n \ge 1 and k≥0k \ge 0, and an,−1=0a_{n,-1} = 0. For fixed nn, an,ka_{n,k} is a polynomial in kk of degree n−1n - 1, so the series Sn(x)=∑k≥0an,kxkS_n(x) = \sum_{k \ge 0} a_{n,k} x^k converges for ∣x∣<1|x| < 1 by the ratio test (the ratio of two terms tends to ∣x∣|x|). Use induction on nn. For n=1n = 1, a1,k=1a_{1,k} = 1, and S1(x)=1/(1−x)S_1(x) = 1/(1 - x) is the geometric series. For the step, the addition formula gives an+1,k−an+1,k−1=(n+kk)−(n+k−1k−1)=(n+k−1k)=an,ka_{n+1,k} - a_{n+1,k-1} = \binom{n+k}{k} - \binom{n+k-1}{k-1} = \binom{n+k-1}{k} = a_{n,k} for all k≥0k \ge 0. Two convergent series can be subtracted term by term, so (1−x) Sn+1(x)=∑k≥0an+1,kxk−∑k≥0an+1,k−1xk=∑k≥0an,kxk=Sn(x)=1(1−x)n.(1 - x)\,S_{n+1}(x) = \sum_{k \ge 0} a_{n+1,k} x^k - \sum_{k \ge 0} a_{n+1,k-1} x^k = \sum_{k \ge 0} a_{n,k} x^k = S_n(x) = \frac{1}{(1 - x)^n}. Divide by 1−x1 - x. The second form follows from the first by putting −x-x for xx and using the theorem on a negative integer upper index: (n+k−1k)(−x)k=(−nk)xk\binom{n+k-1}{k}(-x)^k = \binom{-n}{k}x^k.

The polynomial argument at work. Section 6.3 gave a counting proof of trinomial revision for natural rr only. For fixed integers mm and kk, both sides (rm)(mk)\binom{r}{m}\binom{m}{k} and (rk)(r−km−k)\binom{r}{k}\binom{r-k}{m-k} are polynomials in rr. They agree at each natural number rr, so they agree for every real rr. The same argument turns the counting proof of the addition formula into a proof for every real rr. It does not apply to symmetry, (nk)=(nn−k)\binom{n}{k} = \binom{n}{n - k}, since nn occurs in the lower index on the right. That is why symmetry fails for negative nn.

Examples

Example P2.6.56. Values at r=±1/2r = \pm 1/2. The theorem gives the table below. The values of (−1/2k)\binom{-1/2}{k} alternate in sign, and their sizes decrease slowly, like 1/πk1/\sqrt{\pi k} (P5). The values of (1/2k)\binom{1/2}{k} decrease faster, like k−3/2k^{-3/2}.

kk 00 11 22 33 44 55
(1/2k)\binom{1/2}{k} 11 1/21/2 −1/8-1/8 1/161/16 −5/128-5/128 7/2567/256
(−1/2k)\binom{-1/2}{k} 11 −1/2-1/2 3/83/8 −5/16-5/16 35/12835/128 −63/256-63/256

Example P2.6.57. The series 1/(1−x)2=∑k≥0(k+1)xk=1+2x+3x2+⋯1/(1 - x)^2 = \sum_{k \ge 0} (k + 1)x^k = 1 + 2x + 3x^2 + \cdots is the case n=2n = 2 of the theorem. TAOCP uses it in many average case analyses, for example to sum ∑kk pk\sum_k k\,p^k for a geometric distribution.

Example P2.6.58. The square root. With r=1/2r = 1/2, the binomial series is 1+x=1+x2−x28+x316−5x4128+⋯(∣x∣<1).\sqrt{1 + x} = 1 + \frac{x}{2} - \frac{x^2}{8} + \frac{x^3}{16} - \frac{5x^4}{128} + \cdots \qquad (|x| < 1). For x=0.21x = 0.21 the first six terms give 1.10000151.1000015, against 1.21=1.1\sqrt{1.21} = 1.1.

Example P2.6.59. Central binomial coefficients. Put −4x-4x for xx in the series for r=−1/2r = -1/2. Since (−1/2k)(−4)k=(2kk)\binom{-1/2}{k}(-4)^k = \binom{2k}{k}, 11−4x=∑k≥0(2kk)xk=1+2x+6x2+20x3+70x4+252x5+⋯(∣x∣<1/4).\frac{1}{\sqrt{1 - 4x}} = \sum_{k \ge 0} \binom{2k}{k} x^k = 1 + 2x + 6x^2 + 20x^3 + 70x^4 + 252x^5 + \cdots \qquad (|x| < 1/4). For x=1/16x = 1/16 the series gives ∑k(2kk)/16k=1/3/4=2/3≈1.1547\sum_k \binom{2k}{k}/16^k = 1/\sqrt{3/4} = 2/\sqrt{3} \approx 1.1547.

Example P2.6.60. A negative integer index. The theorem gives (−43)=(−1)3(63)=−20\binom{-4}{3} = (-1)^3\binom{6}{3} = -20. Directly: (−4)(−5)(−6)/6=−20(-4)(-5)(-6)/6 = -20.

Exercises

  1. [M10] Compute (1/23)\binom{1/2}{3} and (−1/23)\binom{-1/2}{3} from the definition, and check them against the theorem on a half-integer upper index.
  2. [M15] Find closed forms of (−2k)\binom{-2}{k} and (−3k)\binom{-3}{k} for integers k≥0k \ge 0, and write the first five terms of (1+x)−3(1 + x)^{-3}.
  3. [M15] Find the first five coefficients of the series of (1+x)1/3(1 + x)^{1/3}.
  4. [M20] Estimate 1.1\sqrt{1.1} with the first four terms of the binomial series for r=1/2r = 1/2. Show that the error is less than the size of the fifth term.
  5. [M25] Prove that ∑k=0n(1/2k)(1/2n−k)=(1n)\sum_{k=0}^{n} \binom{1/2}{k}\binom{1/2}{n - k} = \binom{1}{n} for every integer n≥0n \ge 0, with the binomial series for r=1/2r = 1/2.
  6. [M20] Prove that (−1)k−1 22k−1(1/2k)=1k(2k−2k−1)(-1)^{k-1}\,2^{2k-1}\binom{1/2}{k} = \frac{1}{k}\binom{2k - 2}{k - 1} for every integer k≥1k \ge 1. These are the Catalan numbers 1,1,2,5,14,…1, 1, 2, 5, 14, \dots
  7. [M22] Prove that (rk)\binom{r}{k} is an integer for every integer rr (of any sign) and every integer kk.

Lean

Mathlib has the binomial series in two forms. The formal form is PowerSeries.binomialSeries A r, the power series with coefficients Ring.choose r k, with PowerSeries.binomialSeries_add, the rule (1+x)r+s=(1+x)r(1+x)s(1 + x)^{r+s} = (1 + x)^r(1 + x)^s for formal series, and PowerSeries.binomialSeries_nat for natural rr. The analytic form is binomialSeries 𝔸 a, a series of multilinear maps, with binomialSeries_radius_eq_one (radius 11 for aa not natural), Real.one_add_rpow_hasFPowerSeriesOnBall_zero (the sum is (1+x)a(1 + x)^a for real aa), and Real.one_div_one_sub_rpow_hasFPowerSeriesOnBall_zero (the series of 1/(1−x)a1/(1 - x)^a). The polynomial argument is Polynomial.eq_of_infinite_eval_eq and Polynomial.funext.

TAOCP's symbol TAOCP.binom in TAOCP/Notation (tamnd/taocp-lean main) is defined through descPochhammer, a polynomial. So the polynomial argument applies to it directly: an identity between polynomials in rr that holds for natural rr, where TAOCP.binom_natCast reduces it to Nat.choose, holds for every rr. The half-integer values and the series of this section are not yet stated for TAOCP.binom.

Notes and history

Isaac Newton found the binomial series for fractional exponents around 1665, by interpolation in tables of coefficients, and he described it in two letters to Leibniz in 1676. He did not prove convergence. Niels Henrik Abel gave the first complete proof for all real and complex exponents in 1826. The polynomial argument is a standard device in TAOCP. The book introduces it in the proof of eq. 1.2.6(8), and it uses it again in many later places to pass from the natural numbers to all real numbers. Section 6.3 proves eq. 1.2.6(8) by direct algebra instead, so it does not need the argument there.

The table below lists the results of Sections 1.2.5 and 1.2.6 of TAOCP that this chapter proves. The results of Section 1.2.6 from eq. 1.2.6(21) on, and eq. 1.2.6(16), are in Chapter 7. Eq. 1.2.5(7) is in P5.

TAOCP 1.2 Result of P2
1.2.5 eqs. 1 and 2 Definition P2.6.1, Definition P2.6.4, Theorem P2.6.7
1.2.5 eqs. 3 to 6 Definition P2.6.8, Corollary P2.6.11
1.2.6 eqs. 1 and 2 Definition P2.6.18, Theorem P2.6.21
1.2.6 eqs. 3 and 4 Definition P2.6.22, Theorem P2.6.25, Example P2.6.23
1.2.6 eq. 5 Theorem P2.6.26
1.2.6 eq. 6 Theorem P2.6.27
1.2.6 eqs. 7 and 8 Theorem P2.6.33, Corollary P2.6.34
1.2.6 eq. 9 Theorem P2.6.35
1.2.6 eqs. 10 and 11 Theorem P2.6.36, Theorem P2.6.37
1.2.6 eq. 12 Corollary P2.6.38
1.2.6 eqs. 13 and 14 Theorem P2.6.39, Corollary P2.6.40
1.2.6 eq. 15 Theorem P2.6.54, Theorem P2.6.55
1.2.6 eqs. 17 and 19 Theorem P2.6.41, Corollary P2.6.42
1.2.6 eq. 18 Theorem P2.6.43
1.2.6 eq. 20 Theorem P2.6.44

The binomial coefficients are the numbers that TAOCP uses most. They count the ways to choose kk things from nn, they are the coefficients of (x+y)n(x + y)^n, and they appear in almost every analysis of an algorithm in the later volumes. Section 1.2.6 of TAOCP collects their main identities in a long list. This chapter and the next one prove each identity of that list. This chapter gives the definition and the basic identities. Chapter 7 gives the convolutions, the inversion formulas and the multinomial coefficients.

Section 6.1 counts arrangements and defines the factorial, as Section 1.2.5 does. It proves simple bounds on n!n! that need no calculus. Section 6.2 counts combinations, defines (rk)\binom{r}{k} for each real rr and each integer kk, and proves the factorial form and the symmetry. Section 6.3 proves the identities that TAOCP lists as eqs. 1.2.6(7) to 1.2.6(14) and 1.2.6(17) to 1.2.6(20): absorption, the addition formula, the two summation formulas, the binomial theorem, the negation of the upper index, the alternating partial sums and trinomial revision. Section 6.4 treats an upper index that is not an integer. It explains the polynomial argument, which carries an identity from the integers to all real numbers, and it computes (−1/2k)\binom{-1/2}{k} and (1/2k)\binom{1/2}{k}.

A reader of TAOCP should note one convention early. The book defines (rk)\binom{r}{k} for every real rr and every integer kk, and the value is 00 when k<0k < 0. Many identities hold for all such rr and kk with no side conditions, and this saves many separate cases. Other books, and the function Nat.choose of Lean, allow only natural numbers. The chapter keeps the book's convention, and it marks each identity with the range of rr and kk where it holds.

The chapter uses the sums of Chapter 1, the falling factorial powers xk‾x^{\underline{k}} of Chapter 3, and induction. It reads with Sections 5.1 and 5.2 of Concrete Mathematics (GKP94). The analysis of n!n! for large nn, with Stirling's approximation (eq. 1.2.5(7)), and the convergence of the binomial series are in P5. Chapter 8 uses the results of this chapter for the Stirling numbers, and Chapter 11 uses them for the Bernoulli numbers.

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