Stirling Numbers — Definition, Formula & Example
Stirling numbers are two families of counting numbers. The second kind, , counts the ways to split distinct objects into non-empty, unlabeled groups. The first kind, , counts the ways to seat distinct people around identical round tables with no table empty.
For integers , the Stirling number of the second kind , also written , is the number of partitions of an -element set into exactly non-empty blocks. The unsigned Stirling number of the first kind , also written , is the number of permutations of an -element set that have exactly disjoint cycles. The signed version is . Both families satisfy and for . Equivalently, they are the coefficients in and .
Key Formula
Where:
- = Number of distinct objects already placed (the new object is number n + 1)
- = Number of blocks (second kind) or cycles (first kind)
- = Stirling number of the second kind: partitions into k unlabeled blocks
- = Unsigned Stirling number of the first kind: permutations with k cycles
Worked Example
Problem: Five people sit at 2 identical round tables, with at least one person at each table. Only who sits next to whom, going clockwise, matters. How many seatings are possible? Compare this with the number of ways to split the same 5 people into 2 groups when seating order does not matter.
Step 1: Start from small cases. With 3 people, (one pair at one table and a single person at the other) and (two clockwise orders at one table). Apply the first-kind recurrence with .
Step 2: Add the fifth person. Either this person sits to the left of one of the 4 people already seated, giving ways, or this person sits alone while the other 4 share one table, giving ways.
Step 3: For plain groups, use the second-kind recurrence. Here the new person joins one of the existing groups or starts a new group. Use and .
Answer: There are round-table seatings but only ways to form the two groups. The first kind is larger because it also counts the cyclic order within each group.
Why It Matters
In discrete math and algorithm analysis, you use to rewrite powers as falling factorials, which turns sums like into easy telescoping sums. The quantity counts onto functions from an -set to a -set. If you sum over every , you get the Bell number . So Bell numbers give only the total number of partitions, while Stirling numbers give the count for each number of blocks.
Common Mistakes
Mistake: Using the multiplier in the first-kind recurrence. For example, a student writes .
Correction: In the second kind, a new object joins one of blocks, so the multiplier is . In the first kind, a new person can sit to the left of any of the people already seated, so the multiplier is . The correct value is .
