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.6-64

Exercise 1.2.6-64

stated in Lean solution written

RatingM20
MarkersM (mathematical)
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.6 of Volume 1. Companion chapter: Binomial coefficients

The task

Show that the number of partitions of an nn-set into mm nonempty blocks is the Stirling number of the second kind.

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

Let f(n,m)f(n,m) be the number of such partitions. Find a recurrence by looking at the last element.

Hint 2

Compare with the recurrence of Exercise 1.2.6-35.

Solution

Show the solution

Let f(n,m)f(n,m) be the number of partitions of {1,…,n}\{1,\ldots,n\} into mm nonempty blocks. For n=0n = 0 the only partition is the empty one, so f(0,m)=[m=0]f(0,m) = [m = 0]. For n≥1n \ge 1 no partition has 00 blocks, so f(n,0)=0f(n,0) = 0.

Let n≥0n \ge 0 and take a partition of {1,…,n+1}\{1,\ldots,n+1\} into m≥1m \ge 1 blocks. Remove the element n+1n+1 from its block. There are two cases. If {n+1}\{n+1\} was a block alone, what is left is a partition of {1,…,n}\{1,\ldots,n\} into m−1m - 1 blocks, and each such partition arises once. Otherwise the block of n+1n+1 had other elements, and what is left is a partition of {1,…,n}\{1,\ldots,n\} into mm blocks. A partition into mm blocks arises in mm ways, one for each block that receives n+1n+1. Hence f(n+1,m)=f(n,m−1)+m f(n,m).f(n+1,m) = f(n,m-1) + m\,f(n,m). By Exercise 1.2.6-35 the numbers {nm}\left\{{n \atop m}\right\} of eq. 1.2.6(45) satisfy the same recurrence and the same start values {0m}=[m=0]\left\{{0 \atop m}\right\} = [m = 0], {n0}=0\left\{{n \atop 0}\right\} = 0 for n≥1n \ge 1. By induction on nn, f(n,m)={nm}f(n,m) = \left\{{n \atop m}\right\}.

Check

For n=4n = 4, m=2m = 2: the partitions have block sizes 1+31 + 3 (four of them) or 2+22 + 2 (three of them), so f(4,2)=7f(4,2) = 7, which is {42}\left\{{4 \atop 2}\right\} in row 0,1,7,6,10,1,7,6,1. For n=3n = 3: f(3,1)=1f(3,1) = 1, f(3,2)=3f(3,2) = 3, f(3,3)=1f(3,3) = 1.

Remarks

The row sum ∑m{nm}\sum_m\left\{{n \atop m}\right\} is the number of partitions of an nn-set (the Bell numbers 1,1,2,5,15,52,…1, 1, 2, 5, 15, 52, \ldots). The same recurrence with n−1n - 1 in place of mm counts permutations by cycles, for the first kind.

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

In Lean

stated The statement is in Lean and it builds. The proof is not in Lean yet.

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

Something is wrong? Report it.