Number of Set Partitions by Number of Components

Theorem
Let $S$ be a (finite) set whose cardinality is $n$.

Let $f \paren {n, k}$ denote the number of different ways $S$ can be partitioned into $k$ (pairwise) disjoint subsets.

Then:
 * $\displaystyle f \paren {n, k} = {n \brace k}$

where $\displaystyle {n \brace k}$ denotes a Stirling number of the second kind.

Proof
The proof proceeds by induction on $n$.

For all $n \in \Z_{\ge 0}$, let $P \paren n$ be the proposition:
 * $\displaystyle f \paren {n, k} = {n \brace k}$

$P \paren {0}$ is the degenerate case:
 * $\displaystyle f \paren {0, k} = \delta_{0 k} = {0 \brace k}$

That is: the empty set can be partitioned one and only one way: into $0$ subsets.

Thus $P \paren 0$ is seen to hold.

The remainder of the proof considers $n \in \Z_{> 0}$.

First we note that when $k < 1$ or $k > n$:
 * $\displaystyle f \paren {n, k} = 0 = {n \brace k}$

Hence, throughout, we consider only such $k$ as $1 \le k \le n$.

We define the representative set of cardinality $n$ to be:
 * $S_n := \set {1, 2, \ldots, n}$

Basis for the Induction
$P \paren 1$ is the case $f \paren {1, 1}$.

There is exactly one way to partition $\set 1$, and that is:
 * $\set {\set 1}$

Thus $P \paren 1$ is seen to hold.

This is the basis for the induction.

Induction Hypothesis
Now it needs to be shown that, if $P \paren m$ is true, where $m \ge 1$, then it logically follows that $P \paren {m + 1}$ is true.

So this is the induction hypothesis:
 * $\displaystyle f \paren {m, k} = {m \brace k}$

from which it is to be shown that:
 * $\displaystyle f \paren {m + 1, k} = {m + 1 \brace k}$

Induction Step
This is the induction step:

By definition, the number of partitions of $S_m$ into $k$ subsets is $f \paren {m, k}$.

A partition of $S_{m + 1}$ can be generated by adding element $m + 1$ into one of the existing partitions of $S_m$.

There are two ways this can be done:


 * $(1): \quad$ The subset $\set {m + 1}$ may be added, in one way, to one of the partitions of $S_m$ into $k - 1$ subsets.


 * $(2): \quad$ The element $m + 1$ may be added to any one of the $k$ subsets in one of the partitions of $S_m$ into $k$ subsets.

Option $(1)$ gives $1$ partition of $S_{m + 1}$ for each partition of $S_m$ into $k - 1$ subsets, that is: $f \paren {m, k - 1}$.

Option $(2)$ gives $k$ partitions of $S_{m + 1}$ for each partition of $S_m$ into $k$ subsets, that is: $k f \paren {m, k}$.

Thus:
 * $f \paren {m + 1, k} = k f \paren {m, k} + f \paren {m, k - 1}$

By the induction hypothesis:
 * $\displaystyle f \paren {m + 1, k} = k {m \brace k} + {m \brace k - 1}$

So by definition of Stirling numbers of the second kind:
 * $\displaystyle f \paren {m + 1, k} = {m + 1 \brace k}$

So $P \paren m \implies P \paren {m + 1}$ and the result follows by the Principle of Mathematical Induction.

Therefore:
 * $\displaystyle \forall n, k \in \Z_{\ge 0}: f \paren {n, k} = {n \brace k}$