Number of Set Partitions by Number of Components

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

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

Then:
 * $\displaystyle f \left({n, k}\right) = \left\{ {n \atop k}\right\}$

where $\displaystyle \left\{ {n \atop k}\right\}$ 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 \left({n}\right)$ be the proposition:
 * $\displaystyle f \left({n, k}\right) = \left\{ {n \atop k}\right\}$

$P \left({0}\right)$ is the degenerate case:
 * $\displaystyle f \left({0, k}\right) = \delta_{0 k} = \left\{ {0 \atop k}\right\}$

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

Thus $P \left({0}\right)$ 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 \left({n, k}\right) = 0 = \left\{ {n \atop k}\right\}$

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 := \left\{ {1, 2, \ldots, n}\right\}$

Basis for the Induction
$P \left({1}\right)$ is the case $f \left({1, 1}\right)$.

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

Thus $P \left({1}\right)$ is seen to hold.

This is the basis for the induction.

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

So this is the induction hypothesis:
 * $\displaystyle f \left({m, k}\right) = \left\{ {m \atop k}\right\}$

from which it is to be shown that:
 * $\displaystyle f \left({m + 1, k}\right) = \left\{ {m + 1 \atop k}\right\}$

Induction Step
This is the induction step:

By definition, the number of partitions of $S_m$ into $k$ subsets is $f \left({m, k}\right)$.

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 $\left\{ {m + 1}\right\}$ 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 \left({m, k - 1}\right)$.

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

Thus:
 * $f \left({m + 1, k}\right) = k f \left({m, k}\right) + f \left({m, k - 1}\right)$

By the induction hypothesis:
 * $\displaystyle f \left({m + 1, k}\right) = k \left\{ {m \atop k}\right\} + \left\{ {m \atop k - 1}\right\}$

So by definition of Stirling numbers of the second kind:
 * $\displaystyle f \left({m + 1, k}\right) = \left\{ {m + 1 \atop k}\right\}$

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

Therefore:
 * $\displaystyle \forall n, k \in \Z_{\ge 0}: f \left({n, k}\right) = \left\{ {n \atop k}\right\}$