# Stirling number

In mathematics, Stirling numbers arise in a variety of analytic and combinatorial problems. They are named after James Stirling, who introduced them in a purely algebraic setting in his book Methodus differentialis (1730).[1] They were rediscovered and given a combinatorial meaning by Masanobu Saka in 1782.[2]

Two different sets of numbers bear this name: the Stirling numbers of the first kind and the Stirling numbers of the second kind. Additionally, Lah numbers are sometimes referred to as Stirling numbers of the third kind. Each kind is detailed in its respective article, this one serving as a description of relations between them.

A common property of all three kinds is that they describe coefficients relating three different sequences of polynomials that frequently arise in combinatorics. Moreover, all three can be defined as the number of partitions of n elements into k non-empty subsets, with different ways of counting orderings within each subset.

## Notation

Several different notations for Stirling numbers are in use. Common notation for ordinary (signed) Stirling numbers of the first kind is:

${\displaystyle s(n,k)\,}$

For unsigned Stirling numbers of the first kind, which count the number of permutations of n elements with k disjoint cycles, is:

${\displaystyle {\biggl [}{n \atop k}{\biggr ]}=c(n,k)=|s(n,k)|=(-1)^{n-k}s(n,k)\,}$

And for Stirling numbers of the second kind, which count the number of ways to partition a set of n elements into k nonempty subsets:[3]

${\displaystyle {\biggl \{}{\!n\! \atop \!k\!}{\biggr \}}=S(n,k)=S_{n}^{(k)}\,}$

For example, the sum ${\textstyle \sum _{k=0}^{n}\left[{n \atop k}\right]=n!}$ is the number of all permutations, while the sum ${\textstyle \sum _{k=0}^{n}\left\{{\!n\! \atop \!k\!}\right\}=B_{n}}$ is the nth Bell number.

Abramowitz and Stegun use an uppercase ${\displaystyle S}$ and a blackletter ${\displaystyle {\mathfrak {S}}}$, respectively, for the first and second kinds of Stirling number. The notation of brackets and braces, in analogy to binomial coefficients, was introduced in 1935 by Jovan Karamata and promoted later by Donald Knuth. (The bracket notation conflicts with a common notation for Gaussian coefficients.[4]) The mathematical motivation for this type of notation, as well as additional Stirling number formulae, may be found on the page for Stirling numbers and exponential generating functions.

## Expansions of falling and rising factorials

Stirling numbers express coefficients in expansions of falling and rising factorials (also known as the Pochhammer symbol) as polynomials.

That is, the falling factorial, defined as ${\displaystyle (x)_{n}=x(x-1)\cdots (x-n+1)}$, is a polynomial in x of degree n whose expansion is

${\displaystyle (x)_{n}=\sum _{k=0}^{n}s(n,k)x^{k}}$

with (signed) Stirling numbers of the first kind as coefficients.

Note that (x)0 = 1 because it is an empty product. Combinatorialists also sometimes use the notation ${\displaystyle x^{\underline {n}}}$ for the falling factorial, and ${\displaystyle x^{\overline {n}}}$ for the rising factorial.[5] (Confusingly, the Pochhammer symbol that many use for falling factorials is used in special functions for rising factorials.)

Similarly, the rising factorial, defined as ${\displaystyle x^{(n)}=x(x+1)\cdots (x+n-1)}$, is a polynomial in x of degree n whose expansion is

${\displaystyle x^{(n)}=\sum _{k=0}^{n}{\biggl [}{n \atop k}{\biggr ]}x^{k}=\sum _{k=0}^{n}(-1)^{n-k}s(n,k)x^{k}}$

with unsigned Stirling numbers of the first kind as coefficients. One of these expansions can be derived from the other by observing that ${\displaystyle x^{(n)}=(-1)^{n}(-x)_{n}}$.

Stirling numbers of the second kind express the reverse relations:

${\displaystyle x^{n}=\sum _{k=0}^{n}S(n,k)(x)_{k}}$

and

${\displaystyle x^{n}=\sum _{k=0}^{n}(-1)^{n-k}S(n,k)x^{(k)}.}$

## As change of basis coefficients

Considering the set of polynomials in the (indeterminate) variable x as a vector space, each of the three sequences

${\displaystyle x^{0},x^{1},x^{2},x^{3},\dots \quad (x)_{0},(x)_{1},(x)_{2},\dots \quad x^{(0)},x^{(1)},x^{(2)},\dots }$

is a basis. That is, every polynomial in x can be written as a sum ${\displaystyle a_{0}x^{(0)}+a_{1}x^{(1)}+\dots +a_{n}x^{(n)}}$ for some unique coefficients ${\displaystyle a_{i}}$ (similarly for the other two bases). The above relations then express the change of basis between them, as summarized in the following commutative diagram:

The coefficients for the two bottom changes are described by the Lah numbers below. Since coefficients in any basis are unique, one can define Stirling numbers this way, as the coefficients expressing polynomials of one basis in terms of another, that is, the unique numbers relating ${\displaystyle x^{n}}$ with falling and rising factorials as above.

Falling factorials define, up to scaling, the same polynomials as binomial coefficients: ${\textstyle {\binom {x}{k}}=(x)_{k}/k!}$. The changes between the standard basis ${\displaystyle \textstyle x^{0},x^{1},x^{2},\dots }$ and the basis ${\textstyle {\binom {x}{0}},{\binom {x}{1}},{\binom {x}{2}},\dots }$ are thus described by similar formulas:

${\displaystyle x^{n}=\sum _{k=0}^{n}{\biggl \{}{\!n\! \atop \!k\!}{\biggr \}}k!{\binom {x}{k}}\quad {\text{and}}\quad {\binom {x}{n}}=\sum _{k=0}^{n}{\frac {s(n,k)}{n!}}x^{k}}$.

### As inverse matrices

The Stirling numbers of the first and second kinds can be considered inverses of one another:

${\displaystyle \sum _{j\geq 0}s(n,j)S(j,k)=\sum _{j\geq 0}(-1)^{n-j}{\biggl [}{n \atop j}{\biggr ]}{\biggl \{}{\!j\! \atop \!k\!}{\biggr \}}=\delta _{nk}}$

and

${\displaystyle \sum _{j\geq 0}S(n,j)s(j,k)=\sum _{j\geq 0}(-1)^{j-k}{\biggl \{}{\!n\! \atop \!j\!}{\biggr \}}{\biggl [}{j \atop k}{\biggr ]}=\delta _{nk},}$

where ${\displaystyle \delta _{nk}}$ is the Kronecker delta. These two relationships may be understood to be matrix inverse relationships. That is, let s be the lower triangular matrix of Stirling numbers of the first kind, whose matrix elements ${\displaystyle s_{nk}=s(n,k).\,}$ The inverse of this matrix is S, the lower triangular matrix of Stirling numbers of the second kind, whose entries are ${\displaystyle S_{nk}=S(n,k).}$ Symbolically, this is written

${\displaystyle s^{-1}=S\,}$

Although s and S are infinite, so calculating a product entry involves an infinite sum, the matrix multiplications work because these matrices are lower triangular, so only a finite number of terms in the sum are nonzero.

### Example

Expressing a polynomial in the basis of falling factorials is useful for calculating sums of the polynomial evaluated at consecutive integers. Indeed, the sum of a falling factorial is simply expressed as another falling factorial (for k≠−1)

${\displaystyle \sum _{0\leq i

This is analogous to the integral ${\textstyle \int _{0}^{n}x^{k}dx=n^{k+1}/(k+1)}$, though the sum should be over integers i strictly less than n.

For example, the sum of fourth powers of integers up to n (this time with n included), is:

{\displaystyle {\begin{aligned}&\sum _{i=0}^{n}i^{4}=\sum _{i=0}^{n}\sum _{k=0}^{4}{\biggl \{}{\!4\! \atop \!k\!}{\biggr \}}(i)_{k}=\sum _{k=0}^{4}{\biggl \{}{\!n\! \atop \!k\!}{\biggr \}}{\frac {(n+1)_{k+1}}{k+1}}\\[8mu]&\quad ={\biggl \{}{\!4\! \atop \!1\!}{\biggr \}}{\frac {(n+1)_{2}}{2}}+{\biggl \{}{\!4\! \atop \!2\!}{\biggr \}}{\frac {(n+1)_{3}}{3}}+{\biggl \{}{\!4\! \atop \!3\!}{\biggr \}}{\frac {(n+1)_{4}}{4}}+{\biggl \{}{\!4\! \atop \!4\!}{\biggr \}}{\frac {(n+1)_{5}}{5}}\\[8mu]&\quad ={\frac {1}{2}}(n+1)_{2}+{\frac {7}{3}}(n+1)_{3}+{\frac {6}{4}}(n+1)_{4}+{\frac {1}{5}}(n+1)_{5}\end{aligned}}}

Here the Stirling numbers can be computed from their definition as the number of partitions of 4 elements into k non-empty unlabeled subsets.

In contrast, the sum ${\textstyle \sum _{i=0}^{n}i^{k}}$ in the standard basis is given by Faulhaber's formula, which in general is more complex.

## Lah numbers

The Lah numbers ${\displaystyle L(n,k)={n-1 \choose k-1}{\frac {n!}{k!}}}$ are sometimes called Stirling numbers of the third kind.[6] By convention, ${\displaystyle L(0,0)=1}$ and ${\displaystyle L(n,k)=0}$ if ${\displaystyle n>k}$ or ${\displaystyle k=0.

These numbers are coefficients expressing falling factorials in terms of rising factorials and vice versa:

${\displaystyle x^{(n)}=\sum _{k=0}^{n}L(n,k)(x)_{k}\quad }$ and ${\displaystyle \quad (x)_{n}=\sum _{k=0}^{n}(-1)^{n-k}L(n,k)x^{(k)}.}$

As above, this means they express the change of basis between the bases ${\displaystyle (x)_{0},(x)_{1},(x)_{2},\cdots }$ and ${\displaystyle x^{(0)},x^{(1)},x^{(2)},\cdots }$, completing the diagram. In particular, one formula is the inverse of the other, thus:

${\displaystyle \sum _{j}L(n,j)\cdot (-1)^{j-k}L(j,k)=\delta _{nk}.}$

Similarly, composing for example the change of basis from ${\displaystyle x^{(n)}}$ to ${\displaystyle x^{n}}$ with the change of basis from ${\displaystyle x^{n}}$ to ${\displaystyle (x)_{n}}$ gives the change of basis directly from ${\displaystyle x^{(n)}}$ to ${\displaystyle (x)_{n}}$:

${\displaystyle L(n,k)=\sum _{j}{\biggl [}{n \atop j}{\biggr ]}{\biggl \{}{\!j\! \atop \!k\!}{\biggr \}},}$

In terms of matrices, if ${\displaystyle L}$ denotes the matrix with entries ${\displaystyle L_{nk}=L(n,k)}$ and ${\displaystyle L^{-}}$ denotes the matrix with entries ${\displaystyle L_{nk}^{-}=(-1)^{n-k}L(n,k)}$, then one is the inverse of the other: ${\displaystyle L^{-}=L^{-1}}$. Similarly, composing the matrix of unsigned Stirling numbers of the first kind with the matrix of Stirling numbers of the second kind gives the Lah numbers: ${\displaystyle L=|s|\cdot S}$.

The numbers ${\textstyle \left\{{\!n\! \atop \!k\!}\right\},\left[{n \atop k}\right],L(n,k)}$ can be defined as the number of partitions of n elements into k non-empty unlabeled subsets, each of which is unordered, cyclically ordered, or linearly ordered, respectively. In particular, this implies the following inequalities:

${\displaystyle {\biggl \{}{\!n\! \atop \!k\!}{\biggr \}}\leq {\biggl [}{n \atop k}{\biggr ]}\leq L(n,k).}$

## Symmetric formulae

Abramowitz and Stegun give the following symmetric formulae that relate the Stirling numbers of the first and second kind.[7]

${\displaystyle s(n,k)=\sum _{j=0}^{n-k}(-1)^{j}{n-1+j \choose n-k+j}{2n-k \choose n-k-j}S(n-k+j,j)}$

and

${\displaystyle S(n,k)=\sum _{j=0}^{n-k}(-1)^{j}{n-1+j \choose n-k+j}{2n-k \choose n-k-j}s(n-k+j,j).}$

## Stirling numbers with negative integral values

The Stirling numbers can be extended to negative integral values, but not all authors do so in the same way.[8][9][10] Regardless of the approach taken, it is worth noting that Stirling numbers of first and second kind are connected by the relations:

${\displaystyle {\biggl [}{n \atop k}{\biggr ]}={\biggl \{}{\!-k\! \atop \!-n\!}{\biggr \}}\quad {\text{and}}\quad {\biggl \{}{\!n\! \atop \!k\!}{\biggr \}}={\biggl [}{-k \atop -n}{\biggr ]}}$

when n and k are nonnegative integers. So we have following table for ${\displaystyle \left[{-n \atop -k}\right]}$:

−1 −2 −3 −4 −5 kn 1 1 1 1 1 0 1 3 7 15 0 0 1 6 25 0 0 0 1 10 0 0 0 0 1

Donald Knuth[10] defined the more general Stirling numbers by extending a recurrence relation to all integers. In this approach, ${\textstyle \left[{n \atop k}\right]}$ and ${\textstyle \left\{{\!n\! \atop \!k\!}\right\}}$ are zero if n is negative and k is nonnegative, or if n is nonnegative and k is negative, and so we have, for any integers n and k,

${\displaystyle {\biggl [}{n \atop k}{\biggr ]}={\biggl \{}{\!-k\! \atop \!-n\!}{\biggr \}}\quad {\text{and}}\quad {\biggl \{}{\!n\! \atop \!k\!}{\biggr \}}={\biggl [}{-k \atop -n}{\biggr ]}.}$

On the other hand, for positive integers n and k, David Branson[9] defined ${\textstyle \left[{-n \atop -k}\right]\!,}$ ${\textstyle \left\{{\!-n\! \atop \!-k\!}\right\}\!,}$ ${\textstyle \left[{-n \atop k}\right]\!,}$ and ${\textstyle \left\{{\!-n\! \atop \!k\!}\right\}}$ (but not ${\textstyle \left[{n \atop -k}\right]}$ or ${\textstyle \left\{{\!n\! \atop \!-k\!}\right\}}$). In this approach, one has the following extension of the recurrence relation of the Stirling numbers of the first kind:

${\displaystyle {\biggl [}{-n \atop k}{\biggr ]}={\frac {(-1)^{n+1}}{n!}}\sum _{i=1}^{n}{\frac {(-1)^{i+1}}{i^{k}}}{\binom {n}{i}}}$,

For example, ${\textstyle \left[{-5 \atop k}\right]={\frac {1}{120}}{\Bigl (}5-{\frac {10}{2^{k}}}+{\frac {10}{3^{k}}}-{\frac {5}{4^{k}}}+{\frac {1}{5^{k}}}{\Bigr )}.}$ This leads to the following table of values of ${\textstyle \left[{-n \atop k}\right]}$.

0 1 2 3 4 kn 1 1 1 1 1 ${\displaystyle {\tfrac {-1}{2}}}$ ${\displaystyle {\tfrac {-3}{4}}}$ ${\displaystyle {\tfrac {-7}{8}}}$ ${\displaystyle {\tfrac {-15}{16}}}$ ${\displaystyle {\tfrac {-31}{32}}}$ ${\displaystyle {\tfrac {1}{6}}}$ ${\displaystyle {\tfrac {11}{36}}}$ ${\displaystyle {\tfrac {85}{216}}}$ ${\displaystyle {\tfrac {575}{1296}}}$ ${\displaystyle {\tfrac {3661}{7776}}}$ ${\displaystyle {\tfrac {-1}{24}}}$ ${\displaystyle {\tfrac {-25}{288}}}$ ${\displaystyle {\tfrac {-415}{3456}}}$ ${\displaystyle {\tfrac {-5845}{41472}}}$ ${\displaystyle {\tfrac {-76111}{497664}}}$ ${\displaystyle {\tfrac {1}{120}}}$ ${\displaystyle {\tfrac {137}{7200}}}$ ${\displaystyle {\tfrac {12019}{432000}}}$ ${\displaystyle {\tfrac {874853}{25920000}}}$ ${\displaystyle {\tfrac {58067611}{1555200000}}}$

In this case ${\textstyle \sum _{n=-1}^{-\infty }\left[{-n \atop -k}\right]=B_{k}}$ where ${\displaystyle B_{k}}$ is a Bell number, and so one may define the negative Bell numbers by ${\textstyle \sum _{n=-1}^{-\infty }\left[{-n \atop k}\right]=B_{-k}}$. For example, this produces ${\textstyle \sum _{n=-1}^{-\infty }\left[{-n \atop 2}\right]=B_{-2}=0.421773\ldots }$.

## Citations

1. ^ Mansour & Schork 2015, p. 5.
2. ^ Mansour & Schork 2015, p. 4.
3. ^ Ronald L. Graham, Donald E. Knuth, Oren Patashnik (1988) Concrete Mathematics, Addison-Wesley, Reading MA. ISBN 0-201-14236-8, p. 244.
4. ^ Donald Knuth
5. ^ Aigner, Martin (2007). "Section 1.2 - Subsets and Binomial Coefficients". A Course In Enumeration. Springer. pp. 561. ISBN 978-3-540-39032-9.
6. ^ Sándor, Jozsef; Crstici, Borislav (2004). Handbook of Number Theory II. Kluwer Academic Publishers. p. 464. ISBN 9781402025464.
7. ^ Goldberg, K.; Newman, M; Haynsworth, E. (1972), "Stirling Numbers of the First Kind, Stirling Numbers of the Second Kind", in Abramowitz, Milton; Stegun, Irene A. (eds.), Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 10th printing, New York: Dover, pp. 824–825
8. ^ Loeb, Daniel E. (1992) [Received 3 Nov 1989]. "A generalization of the Stirling numbers". Discrete Mathematics. 103 (3): 259–269. doi:10.1016/0012-365X(92)90318-A.
9. ^ a b Branson, David (August 1994). "An extension of Stirling numbers" (PDF). The Fibonacci Quarterly. Retrieved Dec 6, 2017.
10. ^ a b D.E. Knuth, 1992.

## References

• Rosen, Kenneth H., ed. (2018), Handbook of Discrete and Combinatorial Mathematics, CRC Press, ISBN 978-1-5848-8780-5
• Mansour, Toufik; Schork, Mathias (2015), Commutation Relations, Normal Ordering, and Stirling Numbers, CRC Press, ISBN 978-1-4665-7989-7