Various ways of distributing balls into cells.
Occupancy Problems
A classical set of problems in combinatorics is the number of distribution of $n$ balls to $k$ cells. The solution depends on whether the $n$ balls and/or the $k$ cells are distinguishable.
Suppose first that both the balls and the cells are distinguishable. Then the collection of balls and cells can be interpreted as $n$-element set $N$ and $k$-element set $K$, separately. A distribution then corresponds to a function $f: N\to K$. The number of distribution is then $k^n$.
If the balls are identical, but the cells are distinguishable, the number of distributions is $C(k+n-1,n)$.
$$ \begin{multline*} N(P_1'P_2'\cdots P_n')=N-\sum_{1\le i\le n}N(P_i)+\sum_{1\le i\le j\le n}N(P_iP_j) \\ -\sum_{1\le i\le j\le k\le n}N(P_iP_jP_k)+\dots+(-1)^nN(P_1P_2\cdots P_n) \end{multline*} $$$$ \sum_{i=0}^{k-1}(-1)^iC(k,i)(k-i)^n $$Partitions and Stirling Numbers of the Second Kind
The Stirling number of the second kind, $S(n,k)$, is the number of partitions of an $n$-element set into $k$ classes.
$$ S(n,1)+S(n,2)+\dots+S(n,k) $$$$ S(n+1,k)=S(n,k-1)+kS(n,k) $$$$ k^n=\sum_{j=1}^kS(n,j)P(k,j) $$$$ S(n,k)=\dfrac{1}{k!}\sum_{i=0}^k(-1)^iC(k,i)(k-i)^n $$Stirling Numbers and Polynomials
$$ x^n=\sum_{k=1}^nS(n,k)(x)_k $$where $(x)_n=1$ when $n=0$ and $(x)_n=x(x-1)\cdots(x-n+1)$ when $n\ge 1$. Hence this equation has at most $n$ degrees and at most $n$ roots. Since this equality holds for every positive integer $x$, it must holds for every real number $x$.
Stirling Numbers of the First Kind
From the view of linear algebra, the set of polynomials with real coefficients forms a vector space. Two important bases are the standard basis $\{x^k|k=0,1,\cdots\}$ and the falling factorial basis $\{(x)_k|k=0,1,\cdots\}$. Stirling numbers of the second kind $S(n,k)$ is in fact the coefficients changing from the falling factorial basis $\{(x)_k\}$ to the standard basis $\{x^k\}$.
$$ (x)_n=\sum_{k=0}^ns(n,k)x^k $$This equation uniquely determines the coefficients $s(n,k)$ since every polynomial can be uniquely expressed as a linear combination of the polynomials in a basis.
$$ s(n+1,k)=s(n,k-1)-ns(n,k) $$