Bell Numbers: Counting Ways to Group Things
Take three distinct friends A, B, C. In how many ways can you split them into non-empty groups (called blocks), where the order of groups doesn't matter and each person lands in exactly one group?
- One block: {A,B,C}
- Two blocks: {A},{B,C} ; {B},{A,C} ; {C},{A,B}
- Three blocks: {A},{B},{C}
That is 1+3+1=5 ways. This count is the Bell number B3=5.
Bell numbers count the set partitions of an n-element set. A partition is a collection of non-empty, pairwise disjoint subsets whose union is the whole set.
The Intuition
Bell numbers answer: "In how many ways can I break n distinct items into unlabeled piles?" The piles have no order — {A,B} with {C} is the same partition as {C} with {A,B}; only the grouping counts. The sequence grows quickly:
B0,B1,B2,⋯=1,1,2,5,15,52,203,877,…
where B0=1 counts the single empty partition.
The Recurrence
There is no simple closed formula, but Bell numbers satisfy a neat recurrence:
Bn+1=∑k=0n(kn)Bk.
Why it works: to partition {1,2,…,n+1}, look at the block containing the element n+1. If that block holds n−k of the other elements, they can be chosen in (n−kn)=(kn) ways, and the remaining k elements form any partition — Bk of them. Summing over all sizes gives the formula.
For example, B4=(03)B0+(13)B1+(23)B2+(33)B3=1+3+6+5=15.
Link to Stirling Numbers
A Stirling number of the second kind S(n,k) counts partitions into exactly k blocks. Bell numbers are their total:
Bn=∑k=0nS(n,k).
For n=3: S(3,1)=1,S(3,2)=3,S(3,3)=1, so B3=1+3+1=5, matching our count. …