Bell Numbers
How many ways can you split a set of distinguishable objects into unlabeled groups? This question, innocent as it sounds, has no simple closed formula. Yet it generates one of the richest integer sequences in combinatorics: the Bell numbers. They count every possible way of partitioning a finite set. There is no constraint on the number or size of the blocks. This makes them the master total that sits above the finer-grained Stirling Numbers of the Second Kind. The Bell numbers matter because "partition a set into unlabeled nonempty groups" is one of the most fundamental operations in mathematics. It underlies equivalence relations, clustering, unlabeled graph coloring classes, and the combinatorics of exponential structures. Whenever a problem reduces to "count the ways to group things with no group ordering and no group labels," a Bell number is often lurking nearby. It is exactly this pattern that gives the count in The Twelvefold Way for distributing distinguishable balls into indistinguishable boxes with no restriction on occupancy. The big picture is that the Bell numbers admit three complementary faces. There is a sum over Stirling numbers (structural, block-counting). There is a recurrence discovered by counting partitions according to the block containing the largest element. There is also a strikingly elegant exponential generating function . Remarkably, all three are computable by hand for small . A beautiful device called the Bell triangle turns the recurrence into pure arithmetic. It uses no factorials, no Stirling numbers, just additions. This article builds the theory from the ground up. It gives the precise definition, and a full proof of the Bell recurrence via a bijective/combinatorial argument. It offers a self-contained derivation of the exponential generating function using the Exponential Generating Functions machinery. It also gives a careful development of the Bell triangle, with a proof that it computes exactly the numbers it claims to. Two fully worked numerical examples follow. A counterexample probes what happens without the finiteness hypothesis. A tour of applications closes out the treatment.
- The Bell number counts the number of set partitions of an -element set, with .
- , a sum of Stirling Numbers of the Second Kind over all possible numbers of blocks .
- The Bell recurrence comes from tracking the block containing one distinguished element.
- The exponential generating function is , provable directly from the Exponential Generating Functions product/composition rules.
- The Bell triangle is a Pascal-like array of integers whose left edge lists and whose entries are pure sums, giving an efficient hand computation method.
- Key idea: counting all unlabeled partitions of a finite set reduces to a single clean recurrence obtained by isolating one marked element and choosing its companions.
Where this lives today
The Bell numbers appear whenever a counting problem reduces to "partition a labeled finite set with no constraint on block count or size." In combinatorics on words and set systems, they count the number of distinct equivalence relations on a finite set (since equivalence relations on correspond bijectively to partitions of ). In the theory of the twelvefold way — the master classification of the twelve basic counting problems for distributing balls into boxes — the Bell number is exactly the count for distributing distinguishable balls into indistinguishable boxes with no occupancy restriction, foreshadowed and formally placed in The Twelvefold Way. In statistics and data analysis, Bell numbers bound or estimate the number of possible clusterings of labeled data points into an unspecified number of unlabeled clusters, relevant to clustering-algorithm complexity analysis and to model-selection problems where the number of clusters is itself unknown. In computer science, the Bell numbers arise in the analysis of algorithms enumerating all partitions of a finite set (used, for instance, in symbolic computation systems and in generating test cases for graph coloring and hypergraph partitioning problems), and the Bell triangle provides an -time, purely additive algorithm for tabulating without ever computing a factorial or binomial coefficient directly. In algebraic combinatorics and umbral calculus, Bell numbers are the "moments" of the Poisson distribution with parameter — a fact traceable directly to the exponential generating function , since the moment generating function of a Poisson() random variable is , which at is exactly . This links the purely combinatorial Bell numbers to probability theory in a precise, checkable way: for . In cryptography and coding theory, related exponential-structure counting techniques (of which the Bell/Stirling framework is the prototypical example) inform the enumeration of equivalence classes under group actions, relevant to isomorphism-counting problems for combinatorial designs.
Ask the tutor: How does the Bell number formula change if I require every block to have size at least ?
Let for , and let . A partition of a set is a collection of pairwise disjoint, nonempty subsets of , called blocks, such that
The blocks are unordered and unlabeled: two partitions are considered identical if they consist of the same subsets, regardless of the order in which those subsets are listed. The Bell number is the total number of partitions of the set :
By convention , corresponding to the unique partition of the empty set (the empty collection of blocks).
Intuition
Think of as labeled balls that must be dropped into some number of identical, unlabeled bins, with every bin required to be nonempty and every ball required to land somewhere. The bins have no names and no order — swapping two bins that hold the same balls changes nothing. The Bell number counts the total number of distinct outcomes of this process, summed over every possible number of bins from (all balls together) to (every ball alone). This is different from the Stirling number , which fixes the number of bins at exactly . The Bell number aggregates over all :
with the convention giving consistently. This sum is not a definition-by-fiat; it is an immediate consequence of partitioning the set of all partitions of according to how many blocks they have — a partition of has some well-defined number of blocks , and counts exactly those with blocks, so summing over recovers the total. The more subtle and useful fact is the recurrence: to build a partition of , look at the block containing the element . That block consists of together with some subset of the other elements — say a subset of size for some , chosen in ways — and the remaining elements must themselves be partitioned in some way, contributing a factor of . Summing over how many elements join in its block gives the Bell recurrence proved below.
For every integer ,
We use a direct combinatorial (bijective counting) argument, together with the additivity of counting over a partition of the sample space.
Setup. Fix and consider the set . We count the partitions of by conditioning on the block that contains the specific element ; call this block .
Step 1: classify by the size of the companion set. Since and , we may write
where is the (possibly empty) set of elements from that share a block with . Let , i.e. , so ranges over and represents the number of elements of not in the block of . The set of all partitions of is the disjoint union, over , of the set of partitions in which exactly elements of lie outside the block of . This is a genuine partition of the sample space (each partition of has a uniquely determined companion set , hence a uniquely determined ), so by additivity of counting,
Step 2: count each term by a two-stage choice. Fix . A partition of of this type is uniquely specified by two independent pieces of data: 1. The set with that, together with , forms the block . There are choices for (choosing which of the elements of join ; equivalently, choosing the complementary set of elements that stay outside). 2. A partition of the remaining elements — those in , a set of size — into blocks. Since blocks are determined purely by which elements group together, the number of ways to partition any -element set is , independent of which elements they are (partitions of are in bijection with partitions of via any fixed bijection , since the definition of a partition depends only on the equality/inequality structure, not on the labels themselves). These two choices are independent and jointly determine the full partition of : the block containing is , and the remaining blocks are exactly the blocks of the chosen partition of . Conversely, every partition of with companion-set size arises this way, and distinct choices of give distinct partitions of (they differ either in the block containing , or, if not, in some other block). Hence the number of partitions of with exactly elements outside equals
Step 3: sum. Combining Steps 1 and 2,
as claimed.
∎Using and the recurrence:
These match direct enumeration (e.g. is exactly the five partitions of pictured above).
Define , the exponential generating function of the sequence . Then this power series has positive radius of convergence and
We give a proof via the exponential formula for labeled structures, derived here from first principles using the Stirling-number decomposition, so the argument is self-contained given only the EGF product rule (the EGF of a sequence counting "labeled structure on a set, decomposed into an ordered sequence of substructures on a set partition" equals the appropriate composition/exponential of building-block EGFs — we re-derive the specific instance needed rather than citing the formula as a black box).
Step 1: EGF of "exactly one nonempty block." A single nonempty block on a labeled set of size can be realized in exactly way (there is only one way to make a given set into a single block). So the sequence " if , else " has EGF
Step 2: EGF of "a set partition into exactly unlabeled nonempty blocks", summed with a marker for . We first handle ordered partitions into exactly blocks (an ordered -tuple of disjoint nonempty subsets covering ), and then divide by to un-order them. Fix . The number of ways to partition into an ordered sequence of nonempty, disjoint blocks whose union is is exactly , since each unordered partition into blocks gives rise to ordered versions and no two distinct unordered partitions or two distinct orderings coincide. The EGF product rule states: if is the number of ways to linearly order a labeled structure on as a sequence of "pieces" built from a class with EGF (each piece a nonempty labeled block, here with per-block EGF from Step 1), assembled by first partitioning into an ordered sequence of blocks and then decorating each block independently, then the EGF of is . This is because multiplying EGFs corresponds exactly to the "choose a subset for block 1, a subset for block 2 among what remains, etc." labeled product construction: for each ,
which for our case (each block simply "is" a set, weight if nonempty) gives precisely the count of ordered partitions of into nonempty labeled blocks. Concretely here, since each block's generating function is ,
which is a standard and directly checkable identity: expanding via inclusion–exclusion on which of "slots" a given element may avoid recovers the standard formula
and one verifies directly that equals times this expression, by expanding and reading off coefficients: , so
the last equality being the (already-established, prerequisite) explicit formula for Stirling numbers of the second kind.
Step 3: unlabel the blocks and sum over . To count unordered partitions into exactly blocks, divide by (the number of orderings of distinguishable blocks — valid since all blocks are automatically distinct as sets, being disjoint and nonempty, so no overcounting from repeated blocks occurs). Hence the EGF of (as a sequence in , for fixed ) is
Summing over all (with the term contributing only at , matching ) gives the EGF of :
where the last equality is just the Taylor series of the exponential function evaluated at , valid for all real (indeed all complex) since converges everywhere. Convergence of the outer sum over for each fixed follows because is a fixed real number once is fixed, and converges absolutely for every real .
Step 4: radius of convergence of itself. Since is an entire function (composition of entire functions), its Taylor series converges for all ; in particular has infinite radius of convergence, so the formal manipulations above are also valid as honest analytic identities.
∎Worked examples
Example 1: Computing two independent ways, then cross-checking. Via the Bell recurrence. Using :
Computing term by term:
Sum: . So . Via the Stirling-number sum. The Stirling numbers of the second kind for are
(These follow from the Stirling recurrence , a prerequisite fact.) Summing:
Both routes agree: , confirming the consistency of the recurrence with the Stirling-sum definition.
Example 2: A concrete labeled partition-counting problem. Suppose a study coordinator must group distinct research participants — labeled — into an unspecified number of discussion groups, where every participant is in exactly one group, groups have no names or ordering (a "group of and a group of " is the same arrangement regardless of which is called "group A"), and a group of size is not allowed. How many distinct grouping arrangements are possible? This is exactly . From the corollary above, . To sanity-check via the defining Stirling-sum route: (all together), , , , (all singletons), and
matching. As an explicit spot-check, consider groups: one way to split into two nonempty groups is and ; another is and ; the full count of such two-block splits is , consistent with the Stirling formula (here ). This confirms the pieces feeding into are individually correct, not just the final sum. ---
The Bell triangle
The Bell triangle (also called the Aitken array or Peirce triangle) is the triangular array of integers for and , defined by:
- .
- for (the first entry of each new row equals the last entry of the previous row).
- for (each subsequent entry is the sum of the entry to its left and the entry above that one).
With as above, for every :
In particular, the left edge of the triangle (reading ) lists , and the last entry of row is .
We prove by strong induction on the joint statement:
This refined statement — tracking every entry in row , not just the endpoints — is what makes the induction go through cleanly (a direct induction on just the endpoints would not have enough information to advance a row).
Base case . Row has the single entry . We check : should equal ✓, and the sum formula with gives ✓.
Inductive step. Suppose holds for some ; we show . First entry of row . By definition, . By the inductive hypothesis applied at ,
where the last equality is precisely the Bell recurrence proved above (with there playing the role of here, i.e. ). Hence , confirming the first half of . General entry of row , by induction on within the row. We show, for ,
by induction on . The case is exactly the first-entry computation just done. Suppose the formula holds for row at position (where ), i.e.
By the defining recurrence of the triangle,
The second summand, by the outer inductive hypothesis at position (valid since ), is
So
Reindex the first sum by (running ) and the second by (running ):
Combining the two sums termwise using Pascal's rule for the overlapping range , and noting the term appears only in the second sum (coefficient ) and the term appears only in the first sum (coefficient ), we get
exactly the claimed formula for row , position . This completes the induction on , and hence establishes the full statement .
Extracting the endpoint claim. Setting in the just-proved row formula for :
again by the Bell recurrence. This confirms the last entry of row is , matching the theorem statement (shifted by one index from 's bookkeeping, which used for the first entry of row — here , consistent with "last entry of row is " at ). By the principle of strong (here, ordinary, nested) induction, holds for all , and the two extracted facts , hold for all .
∎The theorem's implicit hypothesis is that is a finite set; drop this and the Bell number is no longer well-defined as a natural number, and the recurrence's derivation (which relies on choosing a specific "largest" or "last" element and a binomial coefficient count) breaks down entirely. Consider , a countably infinite set. The number of partitions of into nonempty blocks is not a finite number at all — it is (as a cardinality) , the cardinality of the continuum. Indeed, for each subset with both and its complement infinite, the two-block partition is distinct for distinct , and there are such subsets (up to the identification , which only divides the count by , an operation invisible at infinite cardinalities). So already the two-block partitions alone number , an uncountable cardinal, not an integer. The proof of the Bell recurrence crucially used: (a) the existence of a distinguished last element outside , and (b) that "the number of elements outside the block of " is a well-defined finite number so that a finite sum makes sense. For there is no last element, and a block containing "" could contain infinitely many other elements, leaving infinitely many outside — the induction has no base case and the sum has no analogue with finitely many terms. This shows finiteness of the ground set is not a technical nicety but load-bearing: without it, is not even a natural number.
Scope, edge cases & common traps
| Situation | What happens | Correct handling |
|---|---|---|
| (one partition: the empty collection of blocks) | Always include this base case; forgetting it shifts the entire recurrence | |
| Blocks vs. ordered blocks | counts unordered partitions | Do not confuse with , the count of ordered set partitions (surjections composed with orderings), which grows much faster |
| Empty blocks | Not allowed by definition | If empty blocks were allowed, every partition of into "at most " parts would be miscounted; always use nonempty blocks in the Stirling/Bell framework |
| Large by hand | Direct Stirling-sum needs all | Bell triangle is more efficient for hand computation: pure integer addition, no binomial coefficients needed |
| Infinite ground sets | undefined / not a natural number | See the counterexample: finiteness of is essential |
The mathematician behind it
Origins · 1 minEric Temple Bell and how this was discovered
Eric Temple Bell was a Scottish-born mathematician who spent most of his career at the California Institute of Technology, working primarily in number theory and the theory of partitions, while also becoming widely known for his popular (if historically embellished) book Men of Mathematics. Although the numbers that bear his name had been studied earlier — notably by the American logician Charles Sanders Peirce — Bell's systematic 1934 papers on "exponential numbers" cemented both the notation and the modern combinatorial framing that ties the sequence to set partitions and to the function .
Is the same as the number of ways to partition into positive integer parts (integer partitions)?
No — this is one of the most common confusions in the area. The number of integer partitions of (ways to write as an unordered sum of positive integers, e.g. , giving ways) is a different sequence, denoted , with . The Bell number counts partitions of a labeled set of elements into unlabeled nonempty blocks, and the labels matter: . Every set partition of does determine an integer partition of (the multiset of block sizes), but many different set partitions can share the same block-size profile, which is exactly why is generally much larger than .
How fast do the Bell numbers grow?
Very fast — faster than exponential in . An asymptotic estimate, due to Bell himself and refined by others using the saddle-point method on the generating function , gives
which grows faster than divided by any fixed exponential factor but slower than itself for large in a precise ratio sense tied to . Concretely, the first several values already show super-exponential-looking growth, and by , , dwarfing .
Does the Bell triangle need the binomial coefficients or factorials at all?
No — that is precisely its practical advantage. Once row starts with the single entry , every subsequent entry is obtained by a single addition: the new entry equals the entry to its left plus the entry diagonally above-left. There is no multiplication, no binomial coefficient, and no factorial anywhere in the construction, even though the array provably reproduces sums involving binomial coefficients (as the proof shows via the auxiliary formula for ). This makes the Bell triangle an efficient by-hand or introductory-programming method for tabulating Bell numbers up to moderate .
How does the Bell number relate to the Stirling numbers of the second kind precisely?
The Bell number is the row sum of the Stirling triangle: , where counts partitions of into exactly nonempty blocks. Every partition of has some definite number of blocks between and (or, for , the empty partition with blocks), so summing over all possible block counts recovers the unrestricted total. This is not a coincidence or approximation; it is an exact identity following from partitioning the set of all set-partitions of by their number of blocks, a genuine partition of the "space of partitions" itself.
Can the Bell recurrence be proved using generating functions instead of the combinatorial argument given here?
Yes, and it is instructive to see both. Differentiating gives , so matching coefficients of on both sides (using the product rule for EGFs, i.e. multiplying the series for and ) yields exactly . This generating-function proof is shorter but relies on already having established , whereas the combinatorial proof given as the main theorem here is logically prior and self-contained, which is why it is presented as the primary derivation.
What is the "ordered Bell number" and how is it different?
The ordered Bell number (or Fubini number) counts partitions of into nonempty blocks that are then arranged in a linear order — equivalently, the number of ways to rank competitors allowing ties. It satisfies , with EGF , and grows even faster than (for instance versus , since the two size--type partitions of each admit orderings of their two blocks). It is a close relative of the Bell numbers but must not be conflated with them, since the Bell numbers explicitly discard block order.