Volume P2 · Concrete mathematics
Binomial identities
Draft. This chapter is written and checked by the tools of the project, and a person has not reviewed it yet. Read it with care.
Contents
Vandermonde's convolution
Statement
In this chapter , and are real numbers unless the text says otherwise, and , and are integers. The binomial coefficient is for and for (Section 6.2). A sum with no limits runs over all integers . In each sum of this section only a finite number of terms are not zero, so the sum is a finite sum in the sense of Section 1.1.
Definition P2.7.1 (convolution). Let and be two sequences of numbers indexed by the integers, with for every . Their convolution is the sequence with . The term with index is zero unless , so for , and for .
Example P2.7.2. Let for every . Then is a sum of ones, so for . The convolution of the constant sequence with itself is the sequence .
Example P2.7.3. Let and , so the nonzero terms are and . The convolution has , , , , and . These are the numbers . The theorem below says that this is no accident.
A polynomial in several variables is a finite sum of terms with real coefficients and exponents . Section 6.4 used the fact that a polynomial in one variable with infinitely many roots is the zero polynomial. The lemma below is the same fact for variables. It is the tool that lifts an identity from the nonnegative integers to all real numbers.
Lemma P2.7.4 (polynomial argument). Let be a polynomial with real coefficients, and let be infinite sets of real numbers. If for every choice of , then every coefficient of is zero. So for all real .
Lean: Mathlib MvPolynomial.funext is the case where every is the whole of an infinite domain, and MvPolynomial.funext_set is the case of this lemma with a set for each variable (proved in Mathlib).
Proof. Use induction on . For a nonzero polynomial of degree has at most roots (Section 6.4). The polynomial has infinitely many roots, the elements of , so it is the zero polynomial. Now let and assume the lemma for variables. Collect the terms of by the power of : , where each is a polynomial in variables. Fix . The polynomial in one variable is zero at every . That is an infinite set, so the case gives for each . This holds for every choice of the , so the induction hypothesis gives that each has only zero coefficients. The coefficients of are the coefficients of the , so they are all zero.
Theorem P2.7.5 (Vandermonde's convolution). For all real and and every integer ,
Lean: Mathlib Nat.add_choose_eq for natural and , and Ring.add_choose_eq for and in a binomial ring, which includes and (proved in Mathlib). In the form with TAOCP.binom of TAOCP/Notation (tamnd/taocp-lean main), not yet stated.
Proof. If , then each term has or , so each term is zero, and the right side is zero too. Let . First let and be nonnegative integers. Take a set with elements and a set with elements, with no element in common. The right side counts the subsets of with elements. Sort these subsets by , the number of their elements in . A subset with elements in is a choice of elements of and of elements of , and the two choices are free. So there are such subsets, and the sum over counts each subset once. The identity holds for all nonnegative integers and .
Now fix . The left side is , and each is a polynomial in . So the left side is a polynomial in and , and the right side is a polynomial in and too. Their difference is zero at every point of , where is the set of nonnegative integers. The lemma shows that the difference is the zero polynomial, so the identity holds for all real and .
Corollary P2.7.6 (shifted indices). For all real and and all integers and ,
Lean: not in Mathlib in this form; it follows from Ring.add_choose_eq by a change of the index.
Proof. Put . As runs over all integers, runs over all integers, each once (Section 1.2). The term becomes , and Vandermonde's convolution with in place of gives the result.
Corollary P2.7.7 (indices running together). Let be a nonnegative integer. For every real and all integers and ,
Lean: not in Mathlib in this form.
Proof. For a nonnegative integer the symmetry holds for every integer (Section 6.2). For it is the factorial form, and for or both sides are zero. So the term is . In this form the lower indices have the sum , which does not depend on . The corollary on shifted indices, with the roles of and exchanged, gives .
The condition on cannot be dropped. For the right side would have the lower index , which is not an integer, and the symmetry step fails.
Corollary P2.7.8 (negated form). Let be a nonnegative integer. For every real and every integer ,
Lean: not in Mathlib in this form; the case , is close to Int.alternating_sum_range_choose (proved in Mathlib).
Proof. Vandermonde's convolution with upper indices and gives . Put this into the left side. The index runs from to and runs from to , so both sums are finite and they may change places (Section 1.2): Call the inner sum . If , each is zero, so . If , trinomial revision (Section 6.3) gives , and , so . If , the same revision and the index give by the binomial theorem, with . This is for and for . So , and the left side is .
Corollary P2.7.9 (a sum with two limits). Let , and be nonnegative integers. For every real ,
Lean: not in Mathlib in this form.
Proof. Let . Then is a nonnegative integer, so symmetry gives . Negation of the upper index, for every integer (Section 6.3), then gives . The sign of the term becomes , which does not depend on . Now the limits can go. For the lower index is negative, so . For the lower index is negative, so . So by Vandermonde's convolution with the index . A second negation gives , and the two signs cancel.
Corollary P2.7.10 (upper indices running). Let , , and be integers with , and . Then
Lean: not in Mathlib in this form; the case , is Nat.sum_Icc_choose (proved in Mathlib).
Proof. Let . The right side counts the subsets of with elements. For such an let be its element of rank from below. Then has elements below and elements above . Write . Since and , the integer is at least . Since , . For a fixed the set is a choice of elements from the numbers below and of elements from the numbers above , so there are sets with this . Each from to appears in the sum. A value of that is not possible gives a zero term: for the factor is zero because , and for the factor is zero because . So the sum counts each once.
The condition is used once: it makes for every set . Exercise 5 shows that the identity is false without it.
Corollary P2.7.11 (sum of squares of a row). For every integer , .
Lean: Mathlib Nat.sum_range_choose_sq (proved in Mathlib).
Proof. Symmetry gives for every integer , so the sum is , which is by Vandermonde's convolution.
Proof
All the identities of this section come from one counting fact: to choose things from two disjoint piles, choose some from the first pile and the rest from the second. The polynomial argument then carries the count from whole numbers to real numbers. The argument works because each binomial coefficient with a fixed lower index is a polynomial in its upper index. It needs the lower indices to be fixed integers or to run over integers. It never applies to a lower index that depends on in a way that leaves the integers.
The relatives of the convolution come from three moves that Chapter 6 proved: a change of the summation index, symmetry, and negation of the upper index. Symmetry needs an upper index that is a nonnegative integer, and that is why the corollaries carry such conditions. Negation moves a variable from the upper index to the lower index or back, and it costs a sign. The negated form also uses the binomial theorem in the form for an integer . This small fact is the root of the inversion formulas of Section 7.2.
To use the section on a given sum, look at where the index appears. If appears in the two lower indices with opposite signs, as and , the sum is a convolution. If it appears in both lower indices with the same sign, try symmetry on a factor whose upper index is a nonnegative integer. If appears in an upper index, try negation to bring it down, or try the form with upper indices running. A factor or outside the coefficients goes away by absorption (Section 6.3). After each move, check the conditions of the identity that you plan to use, and test the result for a small case.
Examples
Example P2.7.12. Take , and . The terms of the convolution are , , and . Their sum is , and .
Example P2.7.13. Take and . The coefficients are , and . The terms of the convolution are , and , with the sum . The right side is . The identity holds for real upper indices, as the polynomial argument promised.
Example P2.7.14. Find for an integer . Absorption gives for every integer , and symmetry gives . So the sum is . The lower indices and have the constant sum , so the shifted form of the convolution gives . For the terms are , and , with the sum , and .
Example P2.7.15. Show that . Each factor is a central binomial coefficient, and the upper indices and move with , so the sum does not look like a convolution. Section 6.4 gives for . So , and the sum is by the convolution with and the value . For the terms are , and , with the sum . The trick was to move the variable from the upper index to the lower index with a real upper index.
Example P2.7.16. Find for an integer . Here appears in both lower indices with the same sign, and the upper index is a nonnegative integer. The form with indices running together, with , and in place of , gives . For the terms are , and , with the sum .
Example P2.7.17. The negated form with , and says . The terms for are , , and . The sum is .
Exercises
- [10] Compute term by term, and compare the result with Vandermonde's convolution.
- [M15] Let and be nonnegative integers. Show that . Then show that for an integer and a real , .
- [M20] Find a closed form for , where is an integer, and check it for and .
- [M22] Use the value of from Section 6.4 and the convolution with to find for every integer .
- [M15] Show that the identity with upper indices running is false for and . Which step of the proof fails?
- [M20] Let be an integer. Prove that .
- [M15] Prove that for all real , , and every integer , where the sum runs over all triples of integers with sum .
- [M20] Find a nonzero polynomial with for every integer and every . Explain why this does not contradict the polynomial argument, and why the proof of Vandermonde's convolution needs both variables to range over infinite sets.
Lean
Mathlib has Vandermonde's convolution twice. Nat.add_choose_eq states it for natural numbers, with the sum over the antidiagonal Finset.antidiagonal k, which is the set of pairs with . Ring.add_choose_eq states it in a binomial ring, a ring with a binomial coefficient Ring.choose r k for each element and each natural . Mathlib has an instance that makes every ring that is a module over the nonnegative rationals a binomial ring. So and are binomial rings, and Ring.add_choose_eq covers real upper indices. The sum of squares of a row is Nat.sum_range_choose_sq, and the polynomial argument is MvPolynomial.funext_set.
The book's coefficient has an integer lower index, which may be negative. TAOCP/Notation (tamnd/taocp-lean main) defines TAOCP.binom (r : R) : ℤ → R over a field , with the value zero for a negative lower index, and TAOCP.binom_natCast is the bridge to Nat.choose. The forms with shifted indices and the negated form need the integer lower index, and they are not yet stated for TAOCP.binom. A fidelity point: Nat.choose has a natural upper index and truncated subtraction, so a statement such as with has a different meaning there. Statements of this section should use TAOCP.binom on or .
Notes and history
The convolution is named after Alexandre-Théophile Vandermonde, who published it in 1772. Zhu Shijie had it in 1303 in a Chinese text on the arithmetic of series, and Chu Shih-chieh is the older spelling of his name, so the identity is also called the Chu-Vandermonde identity. The counting proof and the polynomial argument used here are the standard modern proof. Another proof compares the coefficients of in , with the binomial series of Section 6.4. P3 gives that proof with formal power series.
TAOCP states the convolution as eq. 1.2.6(21) and its relatives as eqs. 1.2.6(22) to 1.2.6(25), and it proves some of them in the exercises of Section 1.2.6. The handbook proves them all in the text and leaves new problems for the exercises. The convolution is used throughout the later volumes: in the analysis of algorithms of Volume 3, where a sum over the sizes of two subfiles is a convolution, and in the generating functions of Section 1.2.9, where it is the product of two binomial series. GKP94 Section 5.1 has a table of the basic identities, and its Section 5.2 has a long set of worked sums that use the moves of this section.
Orthogonality and binomial inversion
Statement
This section solves one kind of equation. A sequence is not known, but the sums are known for each . The answer is a formula for in terms of , and it rests on one identity, the orthogonality relation. The same identity gives the th difference of a function as a sum, and it shows that the th difference of a polynomial of degree is a constant.
Theorem P2.7.18 (orthogonality). Let be a nonnegative integer and let be an integer. Then
Lean: not in Mathlib in this form; the case is Int.alternating_sum_range_choose (proved in Mathlib).
Proof. This is the negated form of Section 7.1 with . The right side of that form is , which is for and otherwise.
The sign may also be written , since and have the same parity. The name comes from linear algebra. Let be the matrix with the entry in row and column , for , and let be the matrix with the entry . The theorem says , the identity matrix. So is the inverse of .
Definition P2.7.19 (binomial transform). Let be a sequence of numbers. Its binomial transform is the sequence with for each . The sum has the terms , so it is finite.
Example P2.7.20. For the binomial theorem gives . For it gives . In this sense the binomial transform adds to the base of a power.
Example P2.7.21. For the sum has one term, and . For , . So has the transform .
Theorem P2.7.22 (binomial inversion). Let and be sequences indexed by the nonnegative integers. Then for every if and only if for every .
Lean: not in Mathlib in this form; the difference forms below are in Mathlib.
Proof. Assume the first set of equations. Fix . Put the formula for into the right side of the second equation. The sums over and are finite, so they may change places: by orthogonality with . For the converse, assume the second set of equations and compute in the same way: Here , because . Orthogonality makes the inner sum , and the sign is then . So the right side is .
Definition P2.7.23 (repeated difference). Let be a function on the real numbers, or on the integers. Chapter 3 defines . Define and for . The function is the th difference of .
Example P2.7.24. Let . Then , , and for . A table of values shows the same thing: the values have the differences , then , then .
Example P2.7.25. Let . Then , so for every . In the same way for a real .
Theorem P2.7.26 (difference formula). For every function , every and every integer ,
Lean: Mathlib fwdDiff_iter_eq_sum_shift (proved in Mathlib), with the step of fwdDiff h equal to .
Proof. Use induction on . For both sides are . Assume the formula for . Then In the first sum put in place of , so it becomes . In the second sum write . The coefficient of is then , which is by the addition formula.
Theorem P2.7.27 (Newton's forward formula). For every function , every and every integer ,
Lean: Mathlib shift_eq_sum_fwdDiff_iter (proved in Mathlib).
Proof. Fix and put and . The difference formula says for every . Binomial inversion turns this into , which is the claim.
Theorem P2.7.28 (difference of a polynomial). Let be an integer and let be a polynomial with real coefficients. Then for every , and for every . In particular
Lean: Mathlib Polynomial.fwdDiff_iter_degree_eq_factorial, fwdDiff_iter_eq_factorial and Polynomial.fwdDiff_iter_eq_zero_of_degree_lt (proved in Mathlib).
Proof. For the binomial theorem gives , and . So if is a polynomial of degree at most with the coefficient at , and , then is a polynomial of degree at most with the coefficient at . If , then is a constant and . Apply this times, for : the function is a polynomial of degree at most with the coefficient at . For this is the constant , and one more difference gives . The last formula is the difference formula with and .
Corollary P2.7.29 (a sum with a free step). For every integer and all real and ,
Lean: not in Mathlib in this form.
Proof. The function is a polynomial in of degree at most . Each of its factors has the coefficient at , so the coefficient of is . Write . The theorem on the difference of a polynomial gives the sum .
Definition P2.7.30 (derangement). A derangement of a finite set is a permutation of with for every , that is, a permutation with no fixed point. Let be the number of derangements of . The empty permutation of the empty set has no fixed point, so .
Example P2.7.31. For write a permutation as the list . The six permutations are , , , , and . Only and move every element, so . For the only permutation fixes , so , and for the only derangement is , so .
Example P2.7.32. For the derangements are , , , , , , , and , so . Three of them, , and , are products of two exchanges, and the other six are single cycles of length .
Theorem P2.7.33 (derangements). For every integer , , and
Lean: Mathlib card_derangements_eq_numDerangements and numDerangements_sum (proved in Mathlib); the second has the sum in a form with Nat.ascFactorial.
Proof. Sort the permutations of by the set of the elements that they move. A permutation that moves exactly the elements of is the identity on the complement of , and on it is a derangement of . Conversely each derangement of , extended by the identity, gives such a permutation. A derangement of a set with elements is a derangement of after a renaming, so there are of them. There are sets with elements, so . Binomial inversion with and gives the first formula for . For the second, , and the index gives .
Corollary P2.7.34 (factorials in falling powers). Let . Then for every integer . The numbers are the only numbers with this property.
Lean: not in Mathlib.
Proof. The theorem gives , and , so . For the uniqueness, let be numbers with for every . For the falling power has the factor . So the equation for reads , with , and it determines from . By induction on the numbers are determined, so they are the .
Proof
The proofs of this section are one idea used four times. Orthogonality says that the matrices and are inverse to each other. So an equation of the form " is the binomial transform of " can be solved for , and the solution is the alternating transform of . The proof is always the same: put one formula into the other, change the order of the two finite sums, and let orthogonality kill every term but one.
The difference formula is the case where is the sequence of differences of a function. Newton's forward formula is its inverse. The theorem on polynomials uses one more fact: each difference lowers the degree of a polynomial by one and multiplies the top coefficient by the degree. The corollary with a free step is an example of the general method: if the summand is a polynomial in times , then only the degree and the top coefficient of the polynomial matter. For derangements the method runs the other way: a count of all permutations by their fixed points gives the binomial transform of , and inversion gives .
Examples
Example P2.7.35. The binomial transform of is . Inversion gives , which is the binomial theorem for . For the terms are , , and , with the sum .
Example P2.7.36. Find numbers with for all . Inversion gives at . The table of differences of starts with , , , and for . So , which is the second example after the definition of the transform.
Example P2.7.37. The difference formula with , and gives . The theorem on polynomials predicts . With and the same sum is , as the theorem predicts for .
Example P2.7.38. The corollary with a free step, for , and , says . The terms are , and , with the sum . The third term has a negative upper index, and the identity needs it.
Example P2.7.39. The first values of are , , , , , , , and . For the identity reads . The formula agrees.
Example P2.7.40. The numbers of the corollary on factorials start with , , , , and . For the expansion reads . The terms with vanish because .
Exercises
- [10] Compute from the formula of the theorem on derangements, and check it with the recurrence of Exercise 2.
- [M15] Prove that for every .
- [M20] Prove that for every by a count. Look at the element that the derangement sends to .
- [M20] Use binomial inversion to find numbers with for every , and check the result for and .
- [M15] Compute and without adding up the terms.
- [M20] Let be an integer and let and be real numbers. Prove that .
- [M22] A permutation of with exactly fixed points is called a partial derangement. Show that there are of them, and prove that for . What does this say about the average number of fixed points of a permutation?
- [HM22] Use the series to prove that for every . Deduce that is the integer nearest to for every .
Lean
Mathlib has the difference operator as fwdDiff h f, with the notation Δ_[h] f, for a function on an additive monoid. The difference formula is fwdDiff_iter_eq_sum_shift, and Newton's forward formula is shift_eq_sum_fwdDiff_iter, which Mathlib calls the Gregory-Newton formula. The theorem on polynomials is fwdDiff_iter_eq_factorial for , Polynomial.fwdDiff_iter_degree_eq_factorial for a polynomial of degree , and Polynomial.fwdDiff_iter_eq_zero_of_degree_lt for the higher differences. The theorem on derangements is card_derangements_eq_numDerangements together with numDerangements_sum, and the limit is numDerangements_tendsto_inv_e.
Orthogonality and binomial inversion with integer lower indices are not in Mathlib in this form, and they are not yet stated with TAOCP.binom of TAOCP/Notation (tamnd/taocp-lean main). Mathlib states the alternating row sum as Int.alternating_sum_range_choose, over the integers, because the sum has negative terms.
Notes and history
Binomial inversion goes back to the calculus of finite differences of the eighteenth century, and Newton's forward formula is in Newton's work on interpolation of the 1670s. Euler counted the derangements in 1753, and the problem is older: Pierre Rémond de Montmort posed it in 1708 as a problem about a card game, and Nicolaus Bernoulli solved it. The inclusion and exclusion principle gives the formula for in one step; P3 has that principle. The proof here uses inversion instead, because inversion is the subject of this section.
TAOCP states orthogonality as eq. 1.2.6(33), the theorem on polynomials as eq. 1.2.6(34) and the corollary with a free step as eq. 1.2.6(35). Eqs. 1.2.6(31) and 1.2.6(32) are the expansion of in falling powers, which the corollary on factorials proves here by a count of derangements. Volume 3 meets the same numbers in the analysis of sorting, where the number of fixed points of a random permutation has mean (Exercise 7). The difference operator returns in Chapter 8, where the th difference of at gives the Stirling numbers of the second kind, and in Chapter 11, where it gives the Bernoulli numbers. GKP94 Section 5.3 develops the same tricks under the heading of the inversion of sums, and its Section 2.6 is the finite calculus of Chapter 3.
Abel's identity and convolutions
Statement
Vandermonde's convolution of Section 7.1 has a family of relatives in which the upper index moves with the lower index. The members of the family are the polynomials below. For they are the binomial coefficients , and the convolution formula for them is Vandermonde's convolution. For and they are the Catalan numbers. This section proves the convolution formulas with a count of sequences and the polynomial argument, and it proves Abel's binomial theorem, an identity of the same kind with powers in place of binomial coefficients.
Definition P2.7.41 (the polynomials A and B). Let be an integer. For real and define and, for , Define also . Both are polynomials in and of degree at most . When , the factorial form of Section 6.2 gives .
Example P2.7.42. For the definition gives , and also . For and it gives .
Example P2.7.43. For and the definition gives . The first values are . These are the Catalan numbers , and the two forms agree, because . For and the values are .
Theorem P2.7.44 (Abel's identity). For all real , and and every integer , The term with is , that is, the factor has the value for , and in the term with .
Lean: not in Mathlib.
Proof. Fix and . Let be the left side, a polynomial in . The proof is by induction on . For the sum has one term, . Let and assume for all . The derivative of with respect to is , and . So The polynomial has the derivative zero, so it is a constant. To find the constant, put . Then , and every term has the form ; for this is , which is the term . So The function is a polynomial in of degree at most . By the theorem on the difference of a polynomial in Section 7.2, the sum is . So , the constant is zero, and for all .
Definition P2.7.45 (good sequence). Let be integers. The sequence is good if each partial sum , for , is positive. Its cyclic shifts are the sequences for .
Example P2.7.46. The sequence has the partial sums , so it is good. Its cyclic shifts are , then with the partial sums , and . Only the first shift is good, and the sum of the terms is .
Example P2.7.47. The sequence has the sum . Its shifts that start at and at are good: the shifts are and , with the partial sums and . The other three shifts start with , with and with , so they are not good. So exactly shifts are good, and is the sum.
Lemma P2.7.48 (cycle lemma). Let be integers with for each and with the sum . Then exactly of the cyclic shifts of the sequence are good.
Lean: not in Mathlib.
Proof. Extend the sequence to all integer indices by , and let be the partial sums with and for every integer . Then . The shift that starts at is good exactly when for . Since , this holds exactly when for every . Call such an index a low point.
For each integer let be the largest with . It exists, because as and as . Each step is at most and , so , and thus . By the choice of , every later partial sum exceeds , so is a low point. Conversely, a low point is . So is a one to one map from the integers onto the low points. It is increasing: for , gives , and gives . It also satisfies , because .
Let be the smallest with . Then and . The map is increasing, so the low points in are exactly . These are low points, so shifts are good.
Theorem P2.7.49 (count of good sequences). Let , and be integers. The number of good sequences of length that contain terms equal to and terms equal to is .
Lean: not in Mathlib.
Proof. Let . The sum of every such sequence is . There are such sequences, one for each set of positions for the terms . Count the pairs in which is such a sequence and is a position where a good shift of starts. By the cycle lemma, each is in exactly pairs, so there are pairs. Each pair gives the good sequence that is the shift of at . For a fixed good and a fixed there is exactly one whose shift at is , so each good comes from exactly pairs. So the number of good sequences is , and this is by the definition.
Theorem P2.7.50 (convolution of A). For all real , and and every integer ,
Lean: not in Mathlib.
Proof. Both sides are polynomials in , and . By the polynomial argument of Section 7.1 it is enough to prove the identity for integers , and with . In that case the right side counts the good sequences with total and terms equal to . Let be such a sequence with the partial sums . Every step up is exactly , and the walk starts at and ends at , so it takes the value at least once. Let be the last index with . After the walk never takes the value again, and it ends above , so for . So the first terms form a good sequence with total , and the remaining terms form a good sequence with total . Conversely, put a good sequence with total in front of a good sequence with total ; the result is good, its total is , and the last visit to the value is at the junction. So this split is a one to one correspondence. If the first part has terms equal to , the count of the previous theorem gives choices. The sum over is symmetric in and after the change , and this proves the identity.
Lemma P2.7.51 (from B to A). For every integer and all real and , and thus, for every , .
Lean: not in Mathlib.
Proof. Both sides of the first equation are polynomials in and , so it is enough to prove it when is not zero. Then and by absorption. Since , the last coefficient is . The second equation follows by induction on : for both sides are , and the first equation reduces the case to the case with in place of .
Theorem P2.7.52 (convolution of A and B). For all real , and and every integer ,
Lean: not in Mathlib.
Proof. Expand by the lemma, change the order of the two finite sums and use the convolution of : By the lemma again, the right side is .
With the definitions written out, this theorem is where the factor means for and the term means when .
Proof
The section has two kinds of proof. Abel's identity is proved with calculus on polynomials: the derivative in moves from to , and one value of fixes the constant. The value is the one that makes each term a polynomial in of low degree times , so the result of Section 7.2 kills the sum.
The convolutions are proved with a count. The numbers count good sequences, by the cycle lemma, and a good sequence with total splits in one way at the last time its partial sums take the value . This proves the convolution of for positive integers, and the polynomial argument of Section 7.1 extends it to all real , and . The convolution of and then follows by algebra, because is a sum of shifted copies of .
Examples
Example P2.7.53. The convolution of with and gives , the recurrence of the Catalan numbers. For : .
Example P2.7.54. The convolution of and with , and gives and . So For the terms are .
Example P2.7.55. With , and the same theorem gives , because . For : .
Example P2.7.56. Abel's identity with , and gives . For the terms are , and , and the sum is . For the terms are , , and , and the sum is .
Example P2.7.57. The good sequences with , and have length , three terms and four terms . The count is , and each of the five sequences starts with . After the first term comes one of , then , then , then and then .
Exercises
- [10] Write and as products of linear factors, and compute .
- [M15] Check Abel's identity for by an expansion of the three terms.
- [M18] List the good sequences with , and , and compare their number with .
- [M15] The sequence has the sum . How many of its cyclic shifts are good? Which hypothesis of the cycle lemma fails?
- [M20] Put and in Abel's identity. Write the identity that results, and check it for .
- [M20] Use the convolution of and to prove , and check it for .
- [M20] Prove that , and deduce that for all real and .
- [M22] A sequence of terms and terms is balanced if all its partial sums are nonnegative. Use the count of good sequences to prove that there are balanced sequences.
- [M20] Let . Use the convolution of to find a closed form for , and check it for .
Lean
No result of this section is in Mathlib. Mathlib has the Catalan numbers as catalan, with the recurrence catalan_succ and the closed form catalan_eq_centralBinom_div. So the first worked example is in Mathlib in this special form. The polynomials and can be stated with TAOCP.binom of TAOCP/Notation (tamnd/taocp-lean main) when , but the polynomial form of the definition is better for a formal statement, because it has no exception. A formal proof of the convolution of needs the cycle lemma, a bijection on sequences and the polynomial argument, MvPolynomial.funext_set; none of these steps is in Mathlib in a ready form, and they are not yet stated in TAOCP/Notation.
Notes and history
Niels Henrik Abel published his identity in 1826, in a paper on series. The cycle lemma is due to Aryeh Dvoretzky and Theodore Motzkin (1947), and the same idea is in the ballot problem of Joseph Bertrand (1887). The polynomials appear in the work of Heinrich August Rothe (1793) and Hagen (1891). The proof here, with a count for positive integers and the polynomial argument for the rest, is a standard method of enumerative combinatorics.
TAOCP states Abel's identity as eq. 1.2.6(16), the convolution of and as eq. 1.2.6(26) and the convolution of as eq. 1.2.6(30); eqs. 1.2.6(27) to 1.2.6(29) are special cases with worked sums like those above. The term in the fourth example counts the labeled trees on vertices, a fact of Section 2.3.4.4, and Abel's identity is the main tool for sums over trees and mappings in Volume 3. The generating function of is a power of the solution of the equation , and P3 proves this with Lagrange inversion. GKP94 Section 5.4 calls these generating functions the generalized binomial series. TAOCP counts the binary trees with the Catalan numbers in Section 2.3.4.4.
Multinomials, partial sums and q-binomials
Statement
This section collects four extensions of the binomial coefficient. Multinomial coefficients count words with more than two kinds of letter. Partial sums of a row of Pascal's triangle have a closed form only in special cases, and the section proves two of them. The -binomial coefficients are polynomials in that become the binomial coefficients at . Hypergeometric series are a common notation for almost all the sums of this chapter.
Definition P2.7.58 (multinomial coefficient). Let and let be nonnegative integers with the sum . The multinomial coefficient is For it is the binomial coefficient: .
Example P2.7.59. The word AABC has letters, with letters A, letter B and letter C. The multinomial coefficient is , and the next theorem shows that it counts the words with these letters: AABC, AACB, ABAC, ABCA, ACAB, ACBA, BAAC, BACA, BCAA, CAAB, CABA and CBAA.
Example P2.7.60. The word BOOKKEEPER has letters: one B, two O, two K, three E, one P and one R. The number of words with the same letters is .
Theorem P2.7.61 (words with given letters). Let be nonnegative integers with the sum . The number of words of length with letters equal to , for each , is .
Lean: Mathlib Nat.multinomial, with the defining equation Nat.multinomial_spec (proved in Mathlib).
Proof. Give the copies of the letter the distinct labels . Then the labeled letters are distinct, and there are ways to put them in a row (Section 6.1). Each word arises from exactly rows, one for each way to order the labels of each letter among themselves. So the number of words is .
Theorem P2.7.62 (product form). Let be nonnegative integers and let . Then
Lean: Mathlib Nat.multinomial_insert, and List.multinomial_cons for a list (proved in Mathlib).
Proof. Since , the factorial form gives . In the product the factor in the numerator of one term cancels with the factor in the denominator of the next term. What remains is , and .
Theorem P2.7.63 (multinomial theorem). For all real and every integer ,
Lean: Mathlib Finset.sum_pow_eq_sum_piAntidiag (proved in Mathlib).
Proof. The left side is a product of factors . When the product is expanded, each term picks one from factor , for . So the terms are in one to one correspondence with the words over the letters . A word with letters gives the term . By the theorem on words, there are such words.
Theorem P2.7.64 (alternating partial sum). For every integer , .
Lean: not in Mathlib.
Proof. Negation of the upper index gives for , and the terms with are zero. So the sum is . For odd , group the terms in pairs ; the sum is . For even , the sum is the sum for , which is , plus , so it is . In both cases this is the right side.
Theorem P2.7.65 (a partial sum with a linear factor). For every real and every integer ,
Lean: not in Mathlib.
Proof. For both sides are zero. Absorption gives , and the addition formula gives , for every integer . So The sum over telescopes to .
Corollary P2.7.66 (half of an odd row). For every integer , .
Lean: Mathlib Nat.sum_range_choose_halfway (proved in Mathlib).
Proof. By symmetry, , and maps onto . So the two halves of the row have the same sum. The full row has the sum , so each half has the sum .
Remark P2.7.67 (partial sums in general). For general and the partial sum has no closed form of the kind of this chapter. The two theorems above work because a linear factor, or the special upper index , makes the terms telescope or pair up. GKP94 Section 5.7 gives an algorithm that decides whether a partial sum of this kind telescopes.
Definition P2.7.68 (q-binomial coefficient). Let and be integers. For the -binomial coefficient is the rational function of and for and for . In particular .
Example P2.7.69. For the definition gives . Its value at is .
Example P2.7.70. For and the definition gives The sum of the coefficients is , and the coefficients read the same in both directions.
Theorem P2.7.71 (q-Pascal rules). For every integer and every integer , So each is a polynomial in with nonnegative integer coefficients, and its value at is .
Lean: not in Mathlib; Mathlib lists the -binomials as future work in RingTheory/Polynomial/Pochhammer.
Proof. If or all terms are zero. If or one term on each side is and the other terms are zero, since . Let . The definition gives and . So The second rule follows in the same way. The definition gives and , so . The rules build each from the row with sums and products by powers of , so induction on gives a polynomial with nonnegative integer coefficients. At the rules become the addition formula, and induction gives the value .
Theorem P2.7.72 (q-binomials count subset sums). Let . The coefficient of in is the number of -element subsets of whose elements have the sum .
Lean: not in Mathlib.
Proof. For a -element subset let , and let over the -element subsets of . The claim is . For or there is one subset, with , so . Let . A subset that does not contain is a subset of . A subset that contains is for a -element subset of , and . So . This is the second -Pascal rule, so induction on gives .
Theorem P2.7.73 (q-binomial theorem). For every integer and all real and ,
Lean: not in Mathlib.
Proof. Induction on . For both sides are . Assume the identity for and multiply both sides by . The coefficient of on the right becomes . Since , this is , and the second -Pascal rule for makes it .
Definition P2.7.74 (hypergeometric series). Let , , and be real, and let be such that for the values of that occur. The hypergeometric series is with the rising powers of Chapter 3. If for an integer , then for , the series is a finite sum, and only is needed. Otherwise the series is infinite, and P5 treats its convergence.
Example P2.7.75. Since , the definition gives , the geometric series, which converges to for .
Example P2.7.76. For an integer , , so . With this gives , the binomial theorem.
Theorem P2.7.77 (Vandermonde in hypergeometric form). Let be an integer, and let and be real with . Then
Lean: not in Mathlib.
Proof. The term of the left side is , because . Multiply it by . Since and , the result is Here both factors come from the rule and the negation of the upper index, . Vandermonde's convolution gives . Divide by .
Proof
The four topics of the section need four kinds of argument. The multinomial coefficient is proved by a count with labels, and its product form by the factorial form and cancellation. The two partial sums are proved by telescoping and by pairs of terms; a sum of a row with no such structure does not have a closed form. The -binomials are proved by the -Pascal rules, which turn every question into an induction on . The subset sums show what the coefficients count. The hypergeometric form of Vandermonde's convolution needs only the translation between rising powers and binomial coefficients.
Examples
Example P2.7.78. The coefficient of in is . The product form gives the same number as .
Example P2.7.79. The theorem with a linear factor, for and , reads , that is, . For it gives .
Example P2.7.80. The -element subsets of have the sums . After the shift by they give the polynomial , and this is also . The reason is that the definition is the quotient of by the two products for and for , and this form is symmetric in and .
Example P2.7.81. The -binomial theorem for reads , with and .
Example P2.7.82. The theorem on hypergeometric series with , and gives the three terms , and on the left side, with the sum , and for the right side.
Exercises
- [10] How many words can be formed with all the letters of COMMITTEE?
- [M15] Find the coefficient of in .
- [M15] Prove that the sum of over all is .
- [M20] Prove that for , where the sum is over the with .
- [M20] Prove that for every integer .
- [M20] Use the theorem with a linear factor and the corollary on half of an odd row to find in closed form.
- [M15] Compute from a -Pascal rule, and check its value at .
- [M20] Prove that for , so the coefficients of read the same in both directions. Use the subsets of and the map .
- [M22] Prove that in two ways: by the theorem of this section, and by the sum of the squares of a row from Section 7.1.
Lean
Mathlib defines Nat.multinomial s f for a finite set s and a function f to the natural numbers, with the defining property Nat.multinomial_spec: the product of the factorials times the coefficient is the factorial of the sum. The product form is the step Nat.multinomial_insert, which adds one part, and List.multinomial_cons is the same for a list of parts. The multinomial theorem is Finset.sum_pow_eq_sum_piAntidiag, with the sum over the functions in Finset.piAntidiag; Finset.sum_pow is the same theorem with the sum over multisets. The half row is Nat.sum_range_choose_halfway.
Mathlib defines the hypergeometric series as ordinaryHypergeometric, but the value is not in Mathlib. The -binomial coefficients and the partial sums with a negative upper index are not in Mathlib. A statement of the partial sums uses TAOCP.binom of TAOCP/Notation (tamnd/taocp-lean main), because the upper index is negative or real; these statements are not yet in TAOCP/Notation.
Notes and history
Leibniz found the multinomial theorem near the end of the seventeenth century, and Abraham de Moivre published a proof in 1697. The -binomial coefficients are due to Gauss (1808), who used them to evaluate quadratic Gauss sums, and they are also called Gaussian polynomials. The coefficient of in also counts the words with letters and letters that have exactly inversions, that is, pairs of a before a ; Volume 3 uses this fact for the inversions of permutations of a multiset. Gauss studied the hypergeometric series in a long paper of 1812, and the theorem on is the finite case of his evaluation of . GKP94 Sections 5.5 and 5.6 show that almost every identity of this chapter is a hypergeometric identity, and P3 continues that point of view.
TAOCP states the partial sums as eqs. 1.2.6(36) to 1.2.6(38), the hypergeometric series as eq. 1.2.6(39), the -binomials as eq. 1.2.6(40) and the multinomial coefficients as eqs. 1.2.6(41) to 1.2.6(43). This section ends the chapter. The table shows where the equations of TAOCP 1.2 that the outline gives to this chapter appear.
| TAOCP 1.2 | Result of P2 |
|---|---|
| 1.2.6(16) | Theorem P2.7.44 (Abel's identity) |
| 1.2.6(21) | Theorem P2.7.5 (Vandermonde's convolution) |
| 1.2.6(22) | Corollary P2.7.7 (indices running together) |
| 1.2.6(23) | Corollary P2.7.8 (negated form) |
| 1.2.6(24) | Corollary P2.7.9 (a sum with two limits) |
| 1.2.6(25) | Corollary P2.7.10 (upper indices running) |
| 1.2.6(26) | Theorem P2.7.52 (convolution of A and B) |
| 1.2.6(27) to 1.2.6(29) | Examples P2.7.53 to P2.7.55 |
| 1.2.6(30) | Theorem P2.7.50 (convolution of A) |
| 1.2.6(31), 1.2.6(32) | Corollary P2.7.34 (factorials in falling powers) |
| 1.2.6(33) | Theorem P2.7.18 (orthogonality) |
| 1.2.6(34) | Theorem P2.7.28 (difference of a polynomial) |
| 1.2.6(35) | Corollary P2.7.29 (a sum with a free step) |
| 1.2.6(36) | Remark P2.7.67 (partial sums in general) |
| 1.2.6(37) | Theorem P2.7.64 (alternating partial sum) |
| 1.2.6(38) | Theorem P2.7.65 (a partial sum with a linear factor) |
| 1.2.6(39) | Definition P2.7.74 (hypergeometric series), Theorem P2.7.77 (Vandermonde in hypergeometric form) |
| 1.2.6(40) | Definition P2.7.68 (q-binomial coefficient), Theorem P2.7.71 (q-Pascal rules) |
| 1.2.6(41) | Definition P2.7.58 (multinomial coefficient) |
| 1.2.6(42) | Theorem P2.7.63 (multinomial theorem) |
| 1.2.6(43) | Theorem P2.7.62 (product form) |
Chapter 6 defined the binomial coefficient for a real upper index and an integer lower index , and it proved the rules that act on one coefficient at a time: the factorial form, symmetry, absorption, the addition formula, negation of the upper index, trinomial revision and the binomial theorem. This chapter is about sums of products of binomial coefficients. A sum of this kind has a closed form much more often than a first look suggests, and the reason is almost always one of a small number of identities. The chapter proves these identities, shows how to recognize them in disguise, and shows where they stop.
Section 7.1 proves Vandermonde's convolution and its four relatives with shifted indices, a negated sign and running upper indices. It also proves the polynomial argument in several variables, the tool that lifts an identity from the nonnegative integers to all real numbers. Section 7.2 proves the orthogonality relation for binomial coefficients and its consequence, binomial inversion. The same section shows that the th difference of a polynomial of degree is constant, and it counts the derangements. Section 7.3 proves Abel's binomial theorem and the convolution formulas for the polynomials , which contain Vandermonde's convolution as the case . The proof there is a counting proof with the cycle lemma. Section 7.4 is about multinomial coefficients, partial sums of a row of Pascal's triangle, -binomial coefficients and hypergeometric series.
TAOCP uses these results from Section 1.2.6 on. Equations 1.2.6(21) to 1.2.6(43) are the subject of this chapter, and the table at the end of Section 7.4 maps each of them to its item here. Section 1.2.9 meets the same identities again as products of generating functions, and Volume 4A uses the multinomial coefficients and the -binomials for the analysis of combinatorial algorithms. The volume P3 of the handbook proves the generating function forms, and it proves Lagrange inversion, which is the analytic side of Section 7.3.
The chapter assumes P1 (induction, sets and functions) and the earlier chapters of P2. Chapter 1 gives the laws for sums, the change of the index and Iverson's bracket. Chapter 3 gives the falling powers , the difference operator and the rule . Chapter 6 gives the rules for one binomial coefficient named above. A reference such as "Section 6.3" points to the place where a rule is proved.
The source of this page. Something is wrong? Report it.