Skip to main content

TL;DR

Stirling Numbers (Second Kind): S(n,k) counts ways to partition n objects into exactly k non-empty groups. This concept is essential for quantitative trading interviews and is frequently tested at top firms.

By Valenke Exam Prep Team·Last updated 2026-06-01
Combinatorics

Stirling Numbers (Second Kind)

S(n,k) counts ways to partition n objects into exactly k non-empty groups.

Stirling numbers of the second kind, written S(n,k)S(n,k) or {nk}\left\{\begin{smallmatrix}n\\k\end{smallmatrix}\right\}, count the number of ways to partition a set of nn elements into exactly kk non-empty, unlabeled subsets. Intuition: Think of distributing nn distinguishable employees into kk identical project teams, where every team must have at least one member. The teams are unlabeled — only who is with whom matters, not which team is "Team A." Recurrence: S(n,k)=kS(n1,k)+S(n1,k1)S(n,k) = k \cdot S(n-1, k) + S(n-1, k-1) The new element either (a) joins one of the existing kk groups (kk choices), or (b) forms a new singleton group (reducing to k1k-1 groups for the remaining n1n-1). Explicit formula (via inclusion-exclusion): S(n,k)=1k!j=0k(1)j(kj)(kj)nS(n,k) = \frac{1}{k!} \sum_{j=0}^{k} (-1)^j \binom{k}{j} (k-j)^n Concrete example: S(4,2)=7S(4,2) = 7. Partition {a,b,c,d}\{a,b,c,d\} into 2 non-empty groups: {a}{b,c,d}, {b}{a,c,d}, {c}{a,b,d}, {d}{a,b,c}, {a,b}{c,d}, {a,c}{b,d}, {a,d}{b,c}\{a\}|\{b,c,d\},\ \{b\}|\{a,c,d\},\ \{c\}|\{a,b,d\},\ \{d\}|\{a,b,c\},\ \{a,b\}|\{c,d\},\ \{a,c\}|\{b,d\},\ \{a,d\}|\{b,c\}. Connection to labeled boxes: The number of surjections from nn elements onto kk labeled bins is k!S(n,k)k! \cdot S(n,k). First few values: S(1,1)=1, S(2,1)=1, S(2,2)=1, S(3,2)=3, S(3,3)=1, S(4,2)=7, S(4,3)=6S(1,1)=1,\ S(2,1)=1,\ S(2,2)=1,\ S(3,2)=3,\ S(3,3)=1,\ S(4,2)=7,\ S(4,3)=6. When to use: Problems about distributing distinct objects into identical groups, counting surjections, or computing Bell numbers Bn=k=0nS(n,k)B_n = \sum_{k=0}^{n} S(n,k). Appears in occupancy problems and in the combinatorics of moments (connecting ordinary moments to factorial moments).

Ready to practice for the Valenke Finance Exam?

Adaptive practice powered by Item Response Theory targets your weak areas. Start with 3 free sessions.

Start free practice →