Distributions of $n$ items into $k$ bins

77 Views Asked by At

One thing that features prominently in combinatorics is counting distributions: distributing $n$ items into $k$ bins. The counting changes depending on whether the items and bins are identical or distinct and whether the bins can be empty or not.

Is the following table correct and what goes in the first row?

Distinct items Identical items
Identical bins ? ?
Distinct bins $k^n$. Product rule; each of $n$ items has $k$ possible destination bins. ${n+k-1 \choose k-1}$. Stars and bars; choosing $k-1$ positions to define $k$ bins to place items.
Nonempty identical bins $S(n,k)$. Stirling numbers of the second kind. Equivalent to counting number of ways to partition $n$ objects into $k$ nonempty subsets. No closed-form solution. Equivalent to number of $k$-partitions of integer $n$.
Nonempty distinct bins Inclusion-exclusion. See, e.g., here. ${n-1 \choose k-1}$. Stars and bars; from the spaces between the $n$ elements, choose, $k-1$ of them to define $k$ bins. Equivalent to number of k-compositions of integer n.

Edit: Based on the answer provided by @manlet-hunter, would the same approach would be used for distinct items in identical bins where empty bins are allowed: $\sum_0^k S(n,0) = B_n$, the $n$th Bell number?

1

There are 1 best solutions below

1
On

Identical items and bins reduces to partitions. For exactly i empty bins we have $P_{k-i}^n$ ways. So the total would be: $$\sum_0^{k}P_i^n$$