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-24

Exercise 1.2.9-24

proved in Lean solution written

RatingM22
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

Prove ∑k(mk)[zn−k]G(z)k=[zn](1+zG(z))m\sum_k\binom mk[z^{n-k}]G(z)^k=[z^n](1+zG(z))^m, and evaluate both sides for G=1/(1−z)G=1/(1-z) and for G=(ez−1)/zG=(e^z-1)/z.

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

Expand (1+zG)m(1+zG)^m with the binomial theorem.

Hint 2

For the two cases compute 1+zG(z)1+zG(z) first.

Solution

Show the solution

By the binomial theorem for series, (1+zG)m=∑k(mk)zkG(z)k(1+zG)^m=\sum_k\binom mkz^kG(z)^k. The coefficient of znz^n in zkGkz^kG^k is [zn−k]Gk[z^{n-k}]G^k. Take [zn][z^n] on both sides: [zn](1+zG)m=∑k(mk)[zn−k]G(z)k[z^n](1+zG)^m=\sum_k\binom mk[z^{n-k}]G(z)^k.

(a) For G=1/(1−z)G=1/(1-z): 1+zG=1+z1−z=11−z1+zG=1+\frac z{1-z}=\frac1{1-z}. So both sides equal [zn](1−z)−m=(m+n−1n)[z^n](1-z)^{-m}=\binom{m+n-1}n.

(b) For G=(ez−1)/zG=(e^z-1)/z: 1+zG=ez1+zG=e^z, so (1+zG)m=emz(1+zG)^m=e^{mz} and both sides equal mn/n!m^n/n!.

Check

(a) With m=3m=3, n=2n=2 the left side is (31)[z1](1−z)−1+(32)[z0](1−z)−2=3+3=6=(42)\binom31[z^1](1-z)^{-1}+\binom32[z^0](1-z)^{-2}=3+3=6=\binom42. (b) With m=2m=2, n=3n=3: G=1+z2+z26+⋯G=1+\frac z2+\frac{z^2}6+\cdots, so [z2]G=16[z^2]G=\frac16 and [z1]G2=1[z^1]G^2=1. The left side is 2⋅16+1=43=233!2\cdot\frac16+1=\frac43=\frac{2^3}{3!}. Python checks (a) for (m,n)=(3,4)(m,n)=(3,4) and (5,3)(5,3).

Remarks

The identity is a form of the binomial theorem for series. In case (b) it gives a formula for mnm^n with the Stirling numbers, since [zn−k]Gk=k!{nk}/n![z^{n-k}]G^k=k!\left\{{n\atop k}\right\}/n! by (23).

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.