A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Stirling Numbers of the First and Second Kind

Graduate Depth 95 in the knowledge graph ☐ I know this ☆ Set as goal
583prerequisites beneath it
See this on the map →
Permutations and Ordered ArrangementsCatalan Numbers and Recursive Structures+4 more→
combinatorics counting

Core Idea

Stirling numbers of the second kind S(n,k) count partitions of n elements into k non-empty subsets; Stirling numbers of the first kind s(n,k) count permutations with exactly k cycles. These numbers satisfy recurrences and appear in identities relating falling and rising factorials. They are central to partitions, cycle structures, and combinatorial applications.

How It's Best Learned

Derive the recurrence relations for both kinds and verify with small examples (n ≤ 4) by explicit enumeration.

Common Misconceptions

The two kinds of Stirling numbers are different; S(n,k) counts partitions into subsets while s(n,k) counts cycle permutations.

Explainer

From your work on permutations and combinations, you know how to count arrangements and selections of objects. Stirling numbers extend this toolkit to answer two questions that ordinary binomial coefficients cannot: how many ways can you partition a set into non-empty groups, and how many permutations have a specific cycle structure?

Stirling numbers of the second kind, written S(n, k), count the number of ways to partition a set of n labeled elements into exactly k non-empty, unlabeled subsets. For example, S(3, 2) = 3 because the set {1, 2, 3} can be split into two non-empty parts in exactly three ways: {1} and {2, 3}, {2} and {1, 3}, or {3} and {1, 2}. The subsets are unordered (so {1} | {2,3} is the same partition as {2,3} | {1}), but the elements within them are labeled. These numbers satisfy the recurrence S(n, k) = k·S(n−1, k) + S(n−1, k−1): either the nth element joins one of the k existing groups (k choices), or it forms a new singleton group.

Stirling numbers of the first kind, written c(n, k) or sometimes s(n, k) with appropriate sign conventions, count permutations of n elements with exactly k cycles. Recall from your combinatorics background that every permutation can be written as a product of disjoint cycles — for instance, the permutation (1→2→3→1, 4→4) has cycle type (3)(1). The Stirling number of the first kind c(4, 2) counts permutations of {1,2,3,4} with exactly 2 cycles. These also satisfy a recurrence: c(n, k) = c(n−1, k−1) + (n−1)·c(n−1, k), because the nth element either starts its own fixed cycle or inserts into one of the (n−1) positions within existing cycles.

The deeper reason these numbers matter is their connection to falling and rising factorials. The falling factorial x(x−1)(x−2)···(x−n+1) can be expanded as a sum of powers xᵏ with coefficients that are (signed) Stirling numbers of the first kind. Conversely, powers xⁿ can be expressed as sums of falling factorials using Stirling numbers of the second kind. This makes Stirling numbers the natural "change of basis" coefficients between two important polynomial bases — a role analogous to binomial coefficients transforming between ordinary and factorial polynomial families.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Angle Pairs: Complementary, Supplementary, and Vertical → Parallel Lines and Transversals → Corresponding Angles → Alternate Interior Angles → Triangle Angle Sum Theorem → Exterior Angle Theorem → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Trigonometric Ratios Review → Radian Measure → Converting Between Degrees and Radians → The Unit Circle → Graphing Sine and Cosine → Graphing Tangent and Reciprocal Trigonometric Functions → Derivatives of Trigonometric Functions → Antiderivatives → Indefinite Integrals → Basic Integration Rules → Riemann Sums → Definite Integral Definition → Probability Density Functions and Continuous Distributions → Cumulative Distribution Functions → Continuous Random Variables → Probability Density Functions → Expected Value → The Probabilistic Method in Graph Theory → Lovász Local Lemma → Ramsey Theory Foundations → Ramsey Numbers and Bounds → Catalan Numbers and Recursive Structures → Stirling Numbers of the First and Second Kind

Longest path: 96 steps · 583 total prerequisite topics

Prerequisites (6)

Leads To (0)

No topics depend on this one yet.