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

Exercise 1.2.9-8

proved in Lean solution written

RatingM23
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 the generating function of the partition numbers p(n)p(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

A partition of nn is a choice of how many parts equal 11, how many equal 22, and so on.

Hint 2

Each part size kk gives a series in which the exponent of zz is a multiple of kk.

Solution

Show the solution

A partition of nn is a list of multiplicities c1,c2,…≥0c_1,c_2,\ldots\ge0 with c1+2c2+3c3+⋯=nc_1+2c_2+3c_3+\cdots=n, where ckc_k is the number of parts equal to kk. For a fixed kk the series ∑c≥0zkc=1/(1−zk)\sum_{c\ge0}z^{kc}=1/(1-z^k) lists the contribution zkcz^{kc} of cc parts of size kk. In the product ∏k≥1(1−zk)−1\prod_{k\ge1}(1-z^k)^{-1}, the coefficient of znz^n is the number of lists (c1,c2,…)(c_1,c_2,\ldots) with ∑kck=n\sum kc_k=n, because each choice of one term from each factor gives one list. Only k≤nk\le n matter for znz^n, so the coefficient is a finite computation, and the product converges as a formal series. So

∑n≥0p(n)zn=∏k≥111−zk.\sum_{n\ge0}p(n)z^n=\prod_{k\ge1}\frac1{1-z^k}.

Check

The product of the factors for k≤8k\le8 gives 1+z+2z2+3z3+5z4+7z5+11z6+15z7+22z8+⋯1+z+2z^2+3z^3+5z^4+7z^5+11z^6+15z^7+22z^8+\cdots. For n=4n=4 the partitions are 44, 3131, 2222, 211211, 11111111, which are 55. Python gives the same table up to n=8n=8.

Remarks

Euler's pentagonal number theorem says ∏k(1−zk)=∑j(−1)jzj(3j−1)/2\prod_k(1-z^k)=\sum_j(-1)^jz^{j(3j-1)/2}, which gives a fast recurrence for p(n)p(n).

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.