Let be a set. A breakup of into pairwise disjoint sets such that is called a partition of the set .
§ Stirling numbers of the second kind:
These count the number of ways to break an element set into partitions/equivalence classes.
The recurrence is:
- For the th element, I either build a new equivalence class and then make equivalence classes from .
- Alternatively, I have equivalence classes from , say I decide into which the should go, which gives me choices.
- Initial conditions: , .
§ Stirling numbers and surjections
Interesting interpretation: The number of ways to surject an element set into a element set, since a surjection breaks a set up into a known number of fibers (in this case, fibers).
This is not entirely true, because we only get equivalence classes of the set . We need to decide where to map each equivalence class. So the correct count of is : there are ways to map equivalence classes of to elements of
§ Rook theory(!)
Turns out we can provide a crazy relationship betweeen ferrers diagrams, and rooks (as in the chess piece) and stirling numbers of the second kind.
We define to be the board consisting of the integer partition . For example, we think of as:
Delta(4):+--+| |+--+--+| | |+--+--+--+| | | |+--+--+--+--+Hopefully, this looks like a staircase with 4 stairs starting from the ground. We have filled in squares of blocks stacked above one another.
We define to be the number of legal rook placements on a board with free rows. That is, we have rooks to place on the board , with one on each row, such that no rook attacks another rook.
- Boundary condition: 0 free rows on a board counts as one configuration.
- Recurrence:
- term: We don't place a rook on the bottom row. This means we have used up a free row, and need to place rooks with free rows on an board:
+--+| |+--+--+| | | r(n-1, k-1)+--+--+--++--+--+--+| | | | BLANK+--+--+--+--+- : We fill out with rooks such that we have free rows. Then, we add the final row. Note that since we have rooks, free rows is equivalent to free columns! Now, we can't leave the final row free, since we have already exhausted our free rows in the recursion. We have free columns for the rook in the final row to inhabit. So we get .
§ Bijection between rooks and Stirling numbers of the second kind
Finally, note that , as which is equivalent to asking:
§ Directly reading off the bijection between set partitions and rook placements
I found this very cool. The idea is to treat each rook as a "bouncer" that bounces light rays. All elements hit by a light ray belong to an equivalence class.

§ Wrooks and signless stirling numbers
Similar to the rooks, we define a wrook (a weak rook) as one that only attacks on its row. Here denotes a placement of wrooks on with free rows.
The corresponding "counting" object is called as the signless stirling numbers:
TODO