Combinatorics – Counting Ways to Partition a Set into Subsets

combinatoricsnumber theory

Suppose we have a finite set $S$ of cardinality $n$. In how many ways can we partition it into $k$-many non empty subsets?

Example: There is precisely one way to partition such a set into $n$-many subsets.
and there is one way to partition into a single (sub)set.

Best Answer

What you want is the Stirling numbers of the second kind. A Stirling number of the second kind counts the number of ways to partition a set of $n$ objects into $k$ non-empty subsets. It is usually denoted by $\left\{ n \atop k \right\}$.

See the Wikipedia article for methods to compute such numbers.