Pascal's Recursion for Combinations

Subsets of a specified size can be separated into those containing a distinguished item and those that omit it.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Split around one item
  2. Build counts from known edges
  3. Split by one distinguished element
  4. Set boundaries before filling a table

Split around one item

To choose two from five, classify groups by whether they include A. With A present choose one more from four. Without A choose two from four. Thus \(4+6=10\), matching unordered combinations.

Build counts from known edges

There is one way to choose none and one way to choose all. Intermediate entries can use the two smaller counts. Bottom-up recurrence evaluation explains why filling smaller sizes first works.[1]

Split by one distinguished element

To choose three of six items, separate choices that contain the sixth item from choices that exclude it. Including it leaves two choices among five, giving ten groups. Excluding it leaves three among five, also giving ten. See unordered combinations.

Include item 6 → choose 2 of remaining 5 → 10
Exclude item 6 → choose 3 of remaining 5 → 10
Total: 20

Set boundaries before filling a table

The terms satisfy \(\binom nk=\binom{n-1}{k-1}+\binom{n-1}k\) away from the boundaries. Set the empty selection count to one and out-of-range counts to zero. Every valid subset enters exactly one case, proving the sum.

References

  1. Eric Lehman, F. Thomson Leighton and Albert R. Meyer, Mathematics for Computer Science ↩