The *twelvefold way* gives the number of mappings $f$ from set $N$ of $n$
objects to set $K$ of $k$ objects (putting balls from set $N$ into boxes in set
$K$). See Table 26.17.1. In this table ${\left(k\right)}_{n}$ is
Pochhammer’s symbol, and $S\left(n,k\right)$ and ${p}_{k}\left(n\right)$ are
defined in §§26.8(i) and 26.9(i).

Table 26.17.1 is reproduced (in modified form) from Stanley (1997, p. 33). See also Example 3 in §26.18.

elements of $N$ | elements of $K$ | $f$ unrestricted | $f$ one-to-one | $f$ onto |
---|---|---|---|---|

labeled | labeled | ${k}^{n}$ | ${\left(k-n+1\right)}_{n}$ | $k\mathrm{!}S\left(n,k\right)$ |

unlabeled | labeled | $\left({\displaystyle \begin{array}{c}k+n-1\\ n\end{array}}\right)$ | $\left({\displaystyle \begin{array}{c}k\\ n\end{array}}\right)$ | $\left({\displaystyle \begin{array}{c}n-1\\ n-k\end{array}}\right)$ |

labeled | unlabeled | $\begin{array}{c}\hfill S\left(n,1\right)+S\left(n,2\right)\hfill \\ \hfill +\mathrm{\cdots}+S\left(n,k\right)\hfill \end{array}$ | $\{\begin{array}{cc}1\hfill & n\le k\hfill \\ 0\hfill & n>k\hfill \end{array}$ | $S\left(n,k\right)$ |

unlabeled | unlabeled | ${p}_{k}\left(n\right)$ | $\{\begin{array}{cc}1\hfill & n\le k\hfill \\ 0\hfill & n>k\hfill \end{array}$ | ${p}_{k}\left(n\right)-{p}_{k-1}\left(n\right)$ |