Stirling numbers of the second kind

From Wikipedia, the free encyclopedia

In mathematics, Stirling numbers of the second kind, together with Stirling numbers of the first kind, are one of the two types of Stirling numbers. They commonly occur in the study of combinatorics, where they count the number of permutations. The Stirling numbers of the first and second kind can be understood to be inverses of one-another, when taken as triangular matrices. This article is devoted to specifics of Stirling numbers of the second kind; further identities linking the two kinds, and general information, is given in the article on Stirling numbers.

Contents

[edit] Definition

The Stirling numbers of the second kind S(n,k) (with a capital "S") count the number of ways to partition a set of n elements into k nonempty subsets. The sum

B_n=\sum_{k=1}^n S(n,k)

is the nth Bell number. If we let

(x)_n=x(x-1)(x-2)\cdots(x-n+1)

(in particular, (x)0 = 1 because it is an empty product) be the falling factorial, we can characterize the Stirling numbers of the second kind by

\sum_{k=0}^n S(n,k)(x)_k=x^n.

(Confusingly, the notation that combinatorialists use for falling factorials coincides with the notation used in special functions for rising factorials; see Pochhammer symbol.)

[edit] Table of values

Below is a table of values for the Stirling numbers of the second kind:

n \ k 0 1 2 3 4 5 6 7 8 9
0 1
1 0 1
2 0 1 1
3 0 1 3 1
4 0 1 7 6 1
5 0 1 15 25 10 1
6 0 1 31 90 65 15 1
7 0 1 63 301 350 140 21 1
8 0 1 127 966 1701 1050 266 28 1
9 0 1 255 3025 7770 6951 2646 462 36 1

[edit] Recurrence relation

Stirling numbers of the second kind obey the recurrence relation

\left\{\begin{matrix} n \\ k \end{matrix}\right\} =     \left\{\begin{matrix} n-1 \\ k-1 \end{matrix}\right\}  +k \left\{\begin{matrix} n-1 \\ k \end{matrix}\right\}

with

\left\{\begin{matrix} n \\ 1 \end{matrix}\right\}=1 \quad \mbox { and } \quad  \left\{\begin{matrix} n \\ n \end{matrix}\right\} = 1.

For instance, the number 25 in column k=3 and row n=5 is given by 25=7+(3×6), where 7 is the number above and to the left of 25, 6 is the number above 25 and 3 is the column containing the 6.

[edit] Parity

Using a Sierpiński triangle, it's easy to show that the parity of a Stirling number of the second kind is equal to the parity of a related binomial coefficient:

\begin{Bmatrix}n\\k\end{Bmatrix}\equiv\binom{z}{w}\pmod{2},\quad  z = n - \left\lceil\dfrac{k + 1}{2}\right\rceil,\  w = \left\lfloor\dfrac{k - 1}{2}\right\rfloor.

Or directly, let two sets contain positions of 1's in binary representations of results of respective expressions:

\begin{align} \mathbb{A}:\ \sum_{i\in\mathbb{A}} 2^i &= n-k,\\ \mathbb{B}:\ \sum_{j\in\mathbb{B}} 2^j &= \left\lfloor\dfrac{k - 1}{2}\right\rfloor,\\ \end{align}

then mimick a bitwise AND operation by intersecting these two sets:

\begin{Bmatrix}n\\k\end{Bmatrix}\bmod 2 = \begin{cases}  0, & \mathbb{A}\cap\mathbb{B}\ne\empty\\  1, & \mathbb{A}\cap\mathbb{B}=\empty \end{cases}

to obtain the parity of a Stirling number of the second kind in O(1) time.

[edit] Simple identities

Some simple identities include

\left\{\begin{matrix} n \\ n-1 \end{matrix}\right\} =  {n \choose 2}.

This is because dividing n elements into n − 1 sets necessarily means dividing it into one set of size 2 and n − 2 sets of size 1. Therefore we need only pick those two elements;

and

\left\{\begin{matrix} n \\ 2 \end{matrix}\right\} = 2^{n-1}-1.

To see this, first note that there are 2 n ordered pairs of complementary subsets A and B. In one case, A is empty, and in another B is empty, so 2 n − 2 ordered pairs of subsets remain. Finally, since we want unordered pairs rather than ordered pairs we divide this last number by 2, giving the result above.

Another explicit expanding of the recurrence-relation gives identities in the spirit of the above example.

\left\{\begin{matrix} n \\ 2 \end{matrix}\right\} = \frac{ \frac11 (2^{n-1}-1^{n-1}) }{0!}
\left\{\begin{matrix} n \\ 3 \end{matrix}\right\} = \frac{ \frac11 (3^{n-1}-2^{n-1})- \frac12 (3^{n-1}-1^{n-1}) }{1!}
\left\{\begin{matrix} n \\ 4 \end{matrix}\right\} = \frac{ \frac11 (4^{n-1}-3^{n-1})- \frac22 (4^{n-1}-2^{n-1}) +  \frac13 (4^{n-1}-1^{n-1})}{2!}
\left\{\begin{matrix} n \\ 5 \end{matrix}\right\} = \frac{ \frac11 (5^{n-1}-4^{n-1})- \frac32 (5^{n-1}-3^{n-1}) + \frac33 (5^{n-1}-2^{n-1}) -  \frac14 (5^{n-1}-1^{n-1}) }{3!}
\vdots

[edit] Explicit formula

The Stirling numbers of the second kind are given by the explicit formula:

\left\{\begin{matrix} n \\ k \end{matrix}\right\} =\frac{1}{k!}\sum_{j=1}^{k}(-1)^{k-j}{k \choose j} j^n.

This formula is a special case of the k 'th forward difference of the monomial xn evaluated at x = 0:

\Delta^k x^n = \sum_{j=1}^{k}(-1)^{k-j}{k \choose j} (x+j)^n.

Because the Bernoulli polynomials may be written in terms of these forward differences, one immediately obtains a relation in the Bernoulli numbers:

B_m(0)=\sum_{k=0}^m \frac {(-1)^k k!}{k+1}  \left\{\begin{matrix} m \\ k \end{matrix}\right\}.

[edit] Generating function

A generating function for the Stirling numbers of the second kind is given by

\sum_{k=0}^n  \left\{\begin{matrix} n \\ k \end{matrix}\right\}  (x)_k = x^n.

[edit] Moments of the Poisson distribution

If X is a random variable with a Poisson distribution with expected value λ, then its nth moment is

E(X^n)=\sum_{k=1}^n S(n,k)\lambda^k.

In particular, the nth moment of the Poisson distribution with expected value 1 is precisely the number of partitions of a set of size n, i.e., it is the nth Bell number (this fact is Dobinski's formula).

[edit] Moments of fixed points of random permutations

Let the random variable X be the number of fixed points of a uniformly distributed random permutation of a finite set of size m. Then the nth moment of X is

E(X^n) = \sum_{k=1}^m S(n,k).

Note: The upper bound of summation is m, not n.

In other words, the nth moment of this probability distribution is the number of partitions of a set of size n into no more than m parts. This is proved on the page on random permutation statistics, although the notation is a bit different.

[edit] References