taocp

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

Exercise · Volume 1 · 1.2.9-18

Exercise 1.2.9-18

proved in Lean solution written

RatingM25
MarkersM (mathematical)
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.2.9 of Volume 1. Companion chapter: Generating functions

The task

Find simple formulas for the sum of k1⋯krk_1\cdots k_r over 1≤k1<⋯<kr≤n1\le k_1<\cdots<k_r\le n and over 1≤k1≤⋯≤kr≤n1\le k_1\le\cdots\le k_r\le n.

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

The first sum is the elementary symmetric function ere_r of 1,2,…,n1,2,\ldots,n and the second is hrh_r. Use the series of Exercises 1.2.9-10 and (36).

Hint 2

Compare with the product formula for the Stirling numbers, or find the recurrence in nn.

Solution

Show the solution

(a) The sum is er(1,2,…,n)e_r(1,2,\ldots,n), the coefficient of xn−rx^{n-r} in ∏k=1n(x+k)\prod_{k=1}^n(x+k) (with the product written out, each term chooses rr of the factors to give kk and the others to give xx). The numbers [n+1j]\left[{n+1\atop j}\right] satisfy ∑j[n+1j]xj=x(x+1)⋯(x+n)\sum_j\left[{n+1\atop j}\right]x^j=x(x+1)\cdots(x+n), which follows by induction from [n+1j]=n[nj]+[nj−1]\left[{n+1\atop j}\right]=n\left[{n\atop j}\right]+\left[{n\atop j-1}\right]. So the coefficient of xn+1−rx^{n+1-r} in x∏k=1n(x+k)x\prod_{k=1}^n(x+k) is the sum we want:

∑1≤k1<⋯<kr≤nk1⋯kr=[n+1n+1−r].\sum_{1\le k_1<\cdots<k_r\le n}k_1\cdots k_r=\left[{n+1\atop n+1-r}\right].

(b) The sum is hr(1,…,n)h_r(1,\ldots,n), the coefficient of zrz^r in ∏k=1n(1−kz)−1\prod_{k=1}^n(1-kz)^{-1} by (36). Let T(n,r)=hr(1,…,n)T(n,r)=h_r(1,\ldots,n). Split the multisets according to the number of copies of nn: T(n,r)=T(n−1,r)+n T(n,r−1)T(n,r)=T(n-1,r)+n\,T(n,r-1) for n,r≥1n,r\ge1, with T(n,0)=1T(n,0)=1 and T(0,r)=0T(0,r)=0 for r>0r>0. The numbers {n+rn}\left\{{n+r\atop n}\right\} satisfy the recurrence {mn}={m−1n−1}+n{m−1n}\left\{{m\atop n}\right\}=\left\{{m-1\atop n-1}\right\}+n\left\{{m-1\atop n}\right\} with m=n+rm=n+r, which reads {n+rn}={n+r−1n−1}+n{n+r−1n}\left\{{n+r\atop n}\right\}=\left\{{n+r-1\atop n-1}\right\}+n\left\{{n+r-1\atop n}\right\}. This is the same recurrence with the same boundary values, so

∑1≤k1≤⋯≤kr≤nk1⋯kr={n+rn}.\sum_{1\le k_1\le\cdots\le k_r\le n}k_1\cdots k_r=\left\{{n+r\atop n}\right\}.

Equivalently, ∑r{n+rn}zr=1/((1−z)(1−2z)⋯(1−nz))\sum_r\left\{{n+r\atop n}\right\}z^r=1/\bigl((1-z)(1-2z)\cdots(1-nz)\bigr), which is Eq. (28) with the index shifted by nn.

Check

For n=3n=3, r=2r=2: (a) 1⋅2+1⋅3+2⋅3=11=[42]1\cdot2+1\cdot3+2\cdot3=11=\left[{4\atop2}\right], and (b) 1+2+3+4+6+9=25={53}1+2+3+4+6+9=25=\left\{{5\atop3}\right\}. For n=5n=5, r=3r=3: (a) 225=[63]225=\left[{6\atop3}\right] and (b) 1050={85}1050=\left\{{8\atop5}\right\}, both computed by Python.

Remarks

For r=nr=n the sum (a) is n!=[n+11]n!=\left[{n+1\atop1}\right]. The pair of sums is the case xk=kx_k=k of Exercises 1.2.9-9 and 1.2.9-10.

This solution is drafted, and a person has not reviewed it yet. The source.

In Lean

proved The statement and its proof are in Lean. The kernel accepts the proof, and it uses the standard axioms only.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.