upgrade
upgrade

๐Ÿ’๐ŸฝAlgebraic Combinatorics

Stirling Numbers

Study smarter with Fiveable

Get study guides, practice questions, and cheatsheets for all your subjects. Join 500,000+ students with a 96% pass rate.

Get Started

Why This Matters

Stirling numbers are the workhorses of combinatorial enumerationโ€”they answer two fundamental questions that appear throughout algebraic combinatorics: How many ways can we arrange elements into cycles? and How many ways can we partition a set into groups? These questions connect directly to permutation groups, symmetric functions, and generating function techniques that form the backbone of the course. When you encounter problems about distributing objects, counting permutations by structure, or expanding polynomials in different bases, Stirling numbers are almost certainly lurking beneath the surface.

You're being tested on your ability to recognize which type of Stirling number applies to a given problem, derive values using recurrence relations, and connect these numbers to broader structures like Bell numbers and generating functions. Don't just memorize the formulasโ€”understand what each Stirling number counts and why the recurrences make combinatorial sense. If you can explain why adding an element either creates a new cycle/subset or joins an existing one, you've mastered the conceptual core.


Stirling Numbers of the First Kind: Counting Cycles

The first kind counts permutations by their cycle structure. Every permutation can be uniquely decomposed into disjoint cycles, and c(n,k)c(n,k) tells you exactly how many permutations of nn elements have exactly kk cycles.

Unsigned Stirling Numbers of the First Kind

  • Denoted c(n,k)c(n,k) or [nk]\begin{bmatrix} n \\ k \end{bmatrix}โ€”counts permutations of nn elements with exactly kk disjoint cycles
  • Recurrence relation: c(n,k)=c(nโˆ’1,kโˆ’1)+(nโˆ’1)โ‹…c(nโˆ’1,k)c(n,k) = c(n-1,k-1) + (n-1) \cdot c(n-1,k)โ€”the new element either forms its own 1-cycle or inserts into one of (nโˆ’1)(n-1) positions in existing cycles
  • Boundary conditions: c(n,0)=0c(n,0) = 0 for n>0n > 0, c(0,0)=1c(0,0) = 1, and c(n,n)=1c(n,n) = 1 since the identity permutation has nn fixed points

Signed Stirling Numbers of the First Kind

  • Denoted s(n,k)s(n,k) with lowercaseโ€”these incorporate the sign (โˆ’1)nโˆ’k(-1)^{n-k} based on permutation parity
  • Relationship to unsigned version: s(n,k)=(โˆ’1)nโˆ’kc(n,k)s(n,k) = (-1)^{n-k} c(n,k), connecting cycle count to even/odd permutation classification
  • Appears in polynomial expansions: the falling factorial xnโ€พ=x(xโˆ’1)(xโˆ’2)โ‹ฏ(xโˆ’n+1)x^{\underline{n}} = x(x-1)(x-2)\cdots(x-n+1) expands as โˆ‘k=0ns(n,k)xk\sum_{k=0}^{n} s(n,k) x^k

Compare: Unsigned c(n,k)c(n,k) vs. signed s(n,k)s(n,k)โ€”both count the same permutations, but signed versions track parity. If a problem involves expanding falling factorials into standard powers, you need signed Stirling numbers; if you're just counting cycle structures, use unsigned.


Stirling Numbers of the Second Kind: Counting Partitions

The second kind counts set partitions. A partition divides elements into non-empty, non-overlapping groups where order within groups doesn't matter, and S(n,k)S(n,k) counts partitions of nn elements into exactly kk such subsets.

Definition and Recurrence

  • Denoted S(n,k)S(n,k) or {nk}\begin{Bmatrix} n \\ k \end{Bmatrix}โ€”counts ways to partition an nn-element set into exactly kk non-empty subsets
  • Recurrence relation: S(n,k)=kโ‹…S(nโˆ’1,k)+S(nโˆ’1,kโˆ’1)S(n,k) = k \cdot S(n-1,k) + S(n-1,k-1)โ€”the new element either joins one of kk existing subsets or forms a new singleton subset
  • Always non-negative integers with boundaries S(n,0)=0S(n,0) = 0 for n>0n > 0, S(0,0)=1S(0,0) = 1, and S(n,1)=S(n,n)=1S(n,1) = S(n,n) = 1

Combinatorial Interpretation

  • Models "balls into boxes" problemsโ€”specifically, nn distinguishable objects into kk indistinguishable non-empty groups
  • Multiply by k!k! for distinguishable boxesโ€”the number of surjective functions from an nn-set to a kk-set is k!โ‹…S(n,k)k! \cdot S(n,k)
  • Connects to equivalence relations: each partition corresponds to an equivalence relation on the set, making S(n,k)S(n,k) fundamental to abstract algebra

Compare: First kind c(n,k)c(n,k) vs. second kind S(n,k)S(n,k)โ€”first kind counts arrangements into cycles (order matters within cycles), second kind counts partitions into subsets (no internal order). Both recurrences have the same structure: new element either starts fresh or joins existing structure.


Generating Functions and Analytic Tools

Generating functions transform Stirling number sequences into algebraic objects, enabling powerful techniques for deriving identities and asymptotic behavior.

Generating Function for First Kind

  • Exponential generating function: โˆ‘n=kโˆžc(n,k)xnn!=(โˆ’lnโก(1โˆ’x))kk!\sum_{n=k}^{\infty} c(n,k) \frac{x^n}{n!} = \frac{(-\ln(1-x))^k}{k!}
  • Ordinary generating function form: connects to rising/falling factorial expansions in polynomial bases
  • Useful for extracting coefficients and proving identities involving factorials and cycle counts

Generating Function for Second Kind

  • Exponential generating function: โˆ‘n=kโˆžS(n,k)xnn!=(exโˆ’1)kk!\sum_{n=k}^{\infty} S(n,k) \frac{x^n}{n!} = \frac{(e^x - 1)^k}{k!}
  • The factor (exโˆ’1)(e^x - 1) represents "at least one element"โ€”raising it to the kkth power captures kk non-empty subsets
  • Derives the explicit formula: S(n,k)=1k!โˆ‘j=0k(โˆ’1)kโˆ’j(kj)jnS(n,k) = \frac{1}{k!} \sum_{j=0}^{k} (-1)^{k-j} \binom{k}{j} j^n via inclusion-exclusion

Compare: The generating functions reveal deep structureโ€”first kind uses lnโก(1โˆ’x)\ln(1-x) (connected to cycles via logarithm of permutation series), second kind uses (exโˆ’1)(e^x - 1) (the exponential minus identity). Recognizing these forms helps you identify which Stirling numbers appear in unfamiliar generating function problems.


Connections to Other Combinatorial Objects

Stirling numbers don't exist in isolationโ€”they're nodes in a network of combinatorial relationships that frequently appear on exams.

Bell Numbers

  • Definition: Bn=โˆ‘k=0nS(n,k)B_n = \sum_{k=0}^{n} S(n,k) counts all partitions of an nn-element set, regardless of number of parts
  • Exponential generating function: โˆ‘n=0โˆžBnxnn!=eexโˆ’1\sum_{n=0}^{\infty} B_n \frac{x^n}{n!} = e^{e^x - 1}, derived directly from the second kind's generating function
  • Bell triangle construction provides efficient computation similar to Pascal's triangle for binomial coefficients

Relationship to Binomial Coefficients

  • Conversion formulas exist between Stirling numbers and binomial coefficients via combinatorial identities
  • Powers to falling factorials: xn=โˆ‘k=0nS(n,k)xkโ€พx^n = \sum_{k=0}^{n} S(n,k) x^{\underline{k}} uses second kind to convert between polynomial bases
  • Falling factorials to powers: xnโ€พ=โˆ‘k=0ns(n,k)xkx^{\underline{n}} = \sum_{k=0}^{n} s(n,k) x^k uses signed first kind for the inverse conversion

Compare: Bell numbers vs. individual S(n,k)S(n,k) valuesโ€”Bell numbers sum over all possible partition sizes, losing information about how many subsets. If a problem asks about partitions into a specific number of groups, you need S(n,k)S(n,k); if it asks about all possible partitions, use BnB_n.


Asymptotic Analysis and Applications

Stirling's Approximation

  • The famous formula: n!โˆผ2ฯ€n(ne)nn! \sim \sqrt{2\pi n} \left(\frac{n}{e}\right)^n provides asymptotic estimates for factorials
  • Named connection but distinct conceptโ€”Stirling's approximation relates to Stirling the mathematician, not directly to Stirling numbers
  • Useful for analyzing growth rates of expressions involving Stirling numbers when nn becomes large

Applications in Partition Theory

  • Algorithm analysis: counting ways to distribute tasks among processors or hash table collision analysis
  • Statistical mechanics: partition functions and state counting in physical systems
  • Symmetric function theory: Stirling numbers appear as coefficients when changing between polynomial bases in the ring of symmetric functions

Quick Reference Table

ConceptBest Examples
Counting permutations by cyclesc(n,k)c(n,k), unsigned first kind
Counting set partitionsS(n,k)S(n,k), second kind
Signed permutation countings(n,k)s(n,k), signed first kind
Total partition countBell numbers Bn=โˆ‘kS(n,k)B_n = \sum_k S(n,k)
Falling factorial expansionxnโ€พ=โˆ‘ks(n,k)xkx^{\underline{n}} = \sum_k s(n,k) x^k
Power to falling factorialxn=โˆ‘kS(n,k)xkโ€พx^n = \sum_k S(n,k) x^{\underline{k}}
Surjective function countk!โ‹…S(n,k)k! \cdot S(n,k)
EGF for second kind(exโˆ’1)kk!\frac{(e^x-1)^k}{k!}

Self-Check Questions

  1. A permutation of 5 elements has exactly 2 cycles. Which Stirling number counts how many such permutations exist, and what recurrence would you use to compute it?

  2. Compare and contrast: Why does the recurrence for c(n,k)c(n,k) have a factor of (nโˆ’1)(n-1) while the recurrence for S(n,k)S(n,k) has a factor of kk? What combinatorial action does each factor represent?

  3. If you need to count the number of ways to assign 6 distinct tasks to 3 distinct teams (each team must have at least one task), which expression gives the answer: S(6,3)S(6,3), 3!โ‹…S(6,3)3! \cdot S(6,3), or c(6,3)c(6,3)?

  4. The generating function (exโˆ’1)44!\frac{(e^x-1)^4}{4!} is the EGF for which sequence? How would you extract the coefficient of x77!\frac{x^7}{7!}?

  5. Explain why Bn>S(n,k)B_n > S(n,k) for any fixed k<nk < n, and describe a problem where you'd need BnB_n instead of individual Stirling numbers of the second kind.