How you say something is often as important as what you say. A simple “Good Morning” can confuse even a wizard like Gandalf and this can be no more apparent than in writing mathematics where ambiguity is not tolerated. This explains one reason why LATE X has made such a major impact on mathematics even though it only deals with the syntax of mathematical writing and not its content. The TE X project started by Donald Knuth (1938–) gave mathematicians the tools they needed to be able to write beautifully typeset papers and books that brought to light the semantics of math in a crystal clear format. In this way, syntax precedes semantics.

Notation is also a vitally important component of mathematics. Clear notation reveals patterns to the mind that are obscured by more awkward expressions. To illustrate this, recall that Pascal’s equation was derived in the chapter, Let Me Count the Ways with equation (2.34). To express this more concisely recall that the falling factorial notation is defined by

$$\displaystyle \begin{aligned} {n}^{\underline{k}} = n (n-1) \cdots (n - k + 1) \end{aligned} $$
(3.1)

and the rising factorial notation by

$$\displaystyle \begin{aligned} {n}^{\overline{k}} = n (n+1) \cdots (n + k - 1) \end{aligned} $$
(3.2)

Some algebra shows that \({n}^{\overline {k}} = {(n + k - 1)}^{ \underline {k}}\) and \({n}^{ \underline {k}} = {(n - k +1)}^{\overline {k}}\). With these notations we can write a binomial coefficient in multiple ways

$$\displaystyle \begin{aligned} \left ( \begin{array}{c} n \\ k \end{array} \right ) = \frac{n!}{k! (n-k)!} = \frac{{n}^{\underline{k}}}{k!} = \frac{{(n - k +1)}^{\overline{k}}}{k!} \end{aligned}$$

The combinatorial term on the left-hand side of (2.34) can now be expressed as

$$\displaystyle \begin{aligned} \left ( \begin{array}{c} i + k- 1 \\ i - 1 \end{array} \right ) = \frac{{i}^{\overline{k}}}{k!} \end{aligned}$$

and the right-hand side by

$$\displaystyle \begin{aligned} \left ( \begin{array}{c} n + k \\ k+ 1 \end{array} \right ) = \left ( \begin{array}{c} n-1 + k+1 \\ k+1 \end{array} \right ) = \frac{{n}^{\overline{k+1}}}{(k+1)!} \end{aligned}$$

Some minor simplifications then shows that Pascal’s formula (2.34) can be expressed compactly as

$$\displaystyle \begin{aligned} \sum_{i=1}^n {i}^{\overline{k}} = \frac{{n }^{\overline{k+1}}}{k+1} \end{aligned} $$
(3.3)

Equation (3.3) expresses Pascal’s equation in a form that highlights a pattern which is not evident in (2.34) and expresses a relationship contained in the integers. Define a variety k integer to be the product of k successive integers. Thus \({i}^{\overline {k}}\) is the i’th variety k integer. In these terms, equation (3.3) expresses a relationship between variety k integers with variety k + 1 integers. Specifically, the equation shows that the sum of the first n variety k integers equals the n + 1’st variety k + 1 integer divided by k + 1. This result will be partially generalized later in the book with equation (7.26) which considers the powers of variety 2 integers. The next section brings up the question: what is a rising factorial?

3.1 Stirling Numbers of the First Kind

To move towards answering this, first note that \({n}^{\overline {k}}\) is a k’th degree polynomial in n. Let the coefficients of this polynomial be denoted by b i,k for i = 0, …k. Two coefficients are immediately obvious: b 0,k = 0 and b k,k = 1. What are the remaining coefficients? To answer this, a straightforward calculation shows that

 

Coefficients b i,k

ki

1

2

3

4

5

Sum

1

1

    

1

2

1

1

   

2

3

2

3

1

  

6

4

6

11

6

1

 

24

5

24

50

35

10

1

120

Blanks above equal 0 and thus, as an illustration, the table shows that \({n}^{\overline {4}} = 6 n + 11 n^2 + 6 n^3 + n^4 \).

The numbers in the table have some interesting special values. For example, the sum of the rows (the last column in the table) equals factorial numbers, \(\sum _{i=0}^n b_{i,n} = n!\). Also, the first column is simply a shifted version of the summation column, b 1,n = (n − 1)! and the submajor diagonal values in the table correspond to binomial coefficients, \(b_{n-1,n} = \left ( \begin {array}{c} n \\ 2 \end {array} \right )\). Other values found in the table do not have obvious values which leads us to the problem of finding a relationship between them.

To derive this relationship, note that

$$\displaystyle \begin{aligned} {n}^{\overline{k+1}} = (n+k) {n}^{\overline{k}} = \underbrace{\ \ n \cdot {n}^{\overline{k}} \ \ }_{\text{first part}} \ + \ \underbrace{\ \ k \cdot {n}^{\overline{k}} \ \ }_{\text{second part}} \end{aligned}$$

This shows that the coefficient b i,k+1 consists of two parts determined by the exponent of n. The first part corresponds to the coefficient of n i−1 in \({n}^{\overline {k}}\) since n ⋅ n i−1 = n i, thus yielding a summand of b i−1,k. The second part corresponds to multiplying the coefficient of n i by k yielding a second summand of k ⋅ b i,k. Combining both summands shows that

$$\displaystyle \begin{aligned} b_{i,k+1} = \left \{ \begin{array}{cl} b_{i-1,k} + k b_{i,k} , & i=1, \ldots , k \\ & \\ 1, & i = k+1 \end{array} \right. \end{aligned} $$
(3.4)

These coefficients frequently appear in mathematics and are termed Stirling numbers of the first kind, named after the mathematician James Stirling (1692–1770). This brings up the immediate question: What are Stirling numbers of the second kind? We will get to that in a moment.

The typical notation for Stirling numbers of the first kind replaces the parenthesis of binomial coefficients with brackets leading to

$$\displaystyle \begin{aligned} b_{i,k} = \left [ \begin{array}{c} k \\ i \end{array} \right ] \end{aligned}$$

In this notation, the special cases previously mentioned are written as

$$\displaystyle \begin{aligned} \left [ \begin{array}{c} k \\ 0 \end{array} \right ] = 0 , \ \ \left [ \begin{array}{c} k \\ k \end{array} \right ] = 1, \ \ \left [ \begin{array}{c} k \\ 1 \end{array} \right ] = (k-1)!, \ \ \left [ \begin{array}{c} k \\ k-1 \end{array} \right ] = \left ( \begin{array}{c} k \\ 2 \end{array} \right ) , \ \ \sum_{i=0}^k \left [ \begin{array}{c} k \\ i \end{array} \right ] = k! \end{aligned} $$
(3.5)

The recurrence relationship (3.4), implies that

$$\displaystyle \begin{aligned} \left [ \begin{array}{c} k+1 \\ i \end{array} \right ] = \left [ \begin{array}{c} k \\ i-1 \end{array} \right ] + k \left [ \begin{array}{c} k \\ i \end{array} \right ] \end{aligned} $$
(3.6)

and

$$\displaystyle \begin{aligned} {n}^{\overline{k}} = \sum_{i=1}^k \left [ \begin{array}{c} k \\ i \end{array} \right ] n^i \end{aligned} $$
(3.7)

Programming the relationship (3.6), along with the special cases just mentioned, yields the following table:

Table of \(\left [ \begin {array}{c} k \\ i \end {array} \right ] \)

ki

1

2

3

4

5

6

7

8

1

1

       

2

1

1

      

3

2

3

1

     

4

6

11

6

1

    

5

24

50

35

10

1

   

6

120

274

225

85

15

1

  

7

720

1,764

1,624

735

175

21

1

 

8

5,040

13,068

13,132

6,769

1,960

322

28

1

Heading back to the modified version of Pascal’s equation allows a rewrite in terms of Stirling numbers. The left-hand side of (3.3) can be written as

$$\displaystyle \begin{aligned} \begin{array}{rcl} {}\qquad \qquad \qquad \qquad \sum_{i=1}^n {i}^{\overline{k}} &=& \sum_{i=1}^n \sum_{j=1}^k \left [ \begin{array}{c} k \\ j \end{array} \right ] i^j \\ &=& \sum_{j=1}^k \left [ \begin{array}{c} k \\ j \end{array} \right ] \sum_{i=1}^n i^j \\ &=& \sum_{j=1}^k \left [ \begin{array}{c} k \\ j \end{array} \right ] \ S_{j,n} \end{array} \end{aligned} $$
(3.8)

where

$$\displaystyle \begin{aligned} S_{j,n} = \sum_{i=1}^n i^j \end{aligned}$$

The right-hand side of the Pascal equation (3.3) implies that

$$\displaystyle \begin{aligned} \frac{{n }^{\overline{k+1}}}{k+1} = \frac{1} {k+1} \sum_{j=1}^{k+1} \left [ \begin{array}{c} k+1 \\ j \end{array} \right ] n^j \end{aligned} $$
(3.9)

Equations (3.3), (3.8), and (3.9) thus create the identity

$$\displaystyle \begin{aligned} \sum_{j=1}^k \left [ \begin{array}{c} k \\ j \end{array} \right ] \ S_{j,n} = \frac{1} {k+1} \sum_{j=1}^{k+1} \left [ \begin{array}{c} k+1 \\ j \end{array} \right ] n^j\end{aligned} $$
(3.10)

Minor modifications to less awkward indices with equations (3.9) and (3.10) show that we have just derived the identity:

$$\displaystyle \begin{aligned} {n}^{\overline{k}} = k \sum_{j=1}^{k-1} \left [ \begin{array}{c} k-1 \\ j \end{array} \right ] S_{j,n}\end{aligned} $$
(3.11)

and

$$\displaystyle \begin{aligned} \left ( \begin{array}{c} n+k \\ k+1 \end{array} \right ) = \left \langle \begin{array}{c} n \\ k+1 \end{array} \right \rangle = \frac{1}{k!} \sum_{j=1}^k \left [ \begin{array}{c} k \\ j \end{array} \right ] S_{j,n}, \ \ k=1, \ldots , n\end{aligned} $$
(3.12)

Stirling numbers of the first kind also allow writing falling factorials after minor sign changes. The modified version of (3.7) for falling factorials is given by

$$\displaystyle \begin{aligned} {n}^{\underline{k}} = \sum_{i=1}^k (-1)^{k-i} \left [ \begin{array}{c} k \\ i \end{array} \right ] n^i \end{aligned} $$
(3.13)

As an example, this implies that

$$\displaystyle \begin{aligned} {n}^{\underline{4}} = n^4 - 6 n^3 + 11 n^2 - 6 n \end{aligned} $$
(3.14)

3.2 Stirling Numbers of the Second Kind

To reverse direction, we seek to derive an equation that expresses a power in terms of falling factorials, specifically

$$\displaystyle \begin{aligned} n^k = \sum_{i=0}^k c_{i,k} {n}^{\underline{i}} \end{aligned} $$
(3.15)

for some unknown constants c i,k. Some coefficients are immediately obvious: the boundary cases c 0,k = 0 and c k,n = 0, k > n, which can now be eliminated, and c k,k = 1. What are the remaining coefficients? To answer this, a straightforward calculation shows that

 

Coefficients c i,k

ki

1

2

3

4

5

1

1

    

2

1

1

   

3

1

3

1

  

4

1

7

6

1

 

5

1

15

25

10

1

Blanks above equal 0 and thus, as an illustration, the table shows that \(n^4 = {n}^{ \underline {1}} + 7 {n}^{ \underline {2}} + 6 {n}^{ \underline {3}} + {n}^{ \underline {4}} \). There is a repeating pattern to the numbers in this table which can be illustrated by an example. Consider the entry for c 3,5 = 25. It can be written in terms of entries on the preceding row, specifically it equals 3c 3,4 + c 3,3 = 3 × 6 + 7. This pattern persists in the table which suggests that

$$\displaystyle \begin{aligned} c_{i,k} = i c_{i,k-1} + c_{i-1,k-1} \end{aligned} $$
(3.16)

Assume that this holds up to some value k and write

$$\displaystyle \begin{aligned} \begin{array}{rcl} \qquad \quad n^{k+1} = n \ n^k &\displaystyle =&\displaystyle \sum_{i=1}^{k} c_{i,k} n \ {n}^{\underline{i}}\\ &\displaystyle =&\displaystyle \sum_{i=1}^{k} c_{i,k} \left ( {n}^{\underline{i+1}}\ + i \ {n}^{\underline{i}} \right ) \\ &\displaystyle =&\displaystyle \sum_{i=1}^{k} c_{i,k} {n}^{\underline{i+1}} + \sum_{i=1}^{k} c_{i,k} i {n}^{\underline{i}} \\ &\displaystyle =&\displaystyle \sum_{i=2}^{k+1} c_{i-1,k} {n}^{\underline{i}} + \sum_{i=1}^{k} c_{i,k} i {n}^{\underline{i}} \\ &\displaystyle =&\displaystyle \sum_{i=1}^{k+1} c_{i-1,k} {n}^{\underline{i}} + \sum_{i=1}^{k+1} c_{i,k} i {n}^{\underline{i}} \\ &\displaystyle =&\displaystyle \sum_{i=1}^{k+1} c_{i,k+1} {n}^{\underline{i}} \end{array} \end{aligned} $$

where the last step follows from the induction hypothesis (3.16) and the second to last step is a result of the 0 boundary cases mentioned above.

The coefficients just derived are termed Stirling numbers of the second kind and are expressed in combinatorial notation using braces instead of parenthesis, that is . This implies that

$$\displaystyle \begin{aligned} n^k = \sum_{i=1}^{k} \left \{ \begin{array}{c} k \\ i \end{array} \right \} \ {n}^{\underline{i}} \end{aligned} $$
(3.17)

and, with equation (3.16), that

$$\displaystyle \begin{aligned} \left \{ \begin{array}{c} k \\ i \end{array} \right \} = i \left \{ \begin{array}{c} k-1 \\ i \end{array} \right \} + \left \{ \begin{array}{c} k-1 \\ i-1 \end{array} \right \} \end{aligned} $$
(3.18)

Programming the relationship (3.18) along with the special cases just mentioned yields the following table:

Table of \(\left \{ \begin {array}{c} k \\ i \end {array} \right \} \)

ki

1

2

3

4

5

6

7

8

1

1

       

2

1

1

      

3

1

3

1

     

4

1

7

6

1

    

5

1

15

25

10

1

   

6

1

31

90

65

15

1

  

7

1

63

301

350

140

21

1

 

8

1

127

966

1,701

1,050

266

28

1

Substituting (3.13) into (3.17) implies that

$$\displaystyle \begin{aligned} \begin{array}{rcl} \qquad \qquad n^k &\displaystyle =&\displaystyle \sum_{i=1}^{k} \left \{ \begin{array}{c} k \\ i \end{array} \right \} \ {n}^{\underline{i}} \\ &\displaystyle =&\displaystyle \sum_{i=1}^{k} \left \{ \begin{array}{c} k \\ i \end{array} \right \} \ \sum_{j=1}^i (-1)^{i-j} \left [ \begin{array}{c} i \\ j \end{array} \right ] n^j \\ &\displaystyle =&\displaystyle \sum_{j=1}^k \sum_{i=j}^{k} \left \{ \begin{array}{c} k \\ i \end{array} \right \} (-1)^{i-j} \left [ \begin{array}{c} i \\ j \end{array} \right ] n^j \\ &\displaystyle =&\displaystyle n^k + \sum_{j=1}^{k-1} n^j \sum_{i=j}^{k} (-1)^{i-j} \left \{ \begin{array}{c} k \\ i \end{array} \right \} \left [ \begin{array}{c} i \\ j \end{array} \right ] \\ \end{array} \end{aligned} $$

and thus that

$$\displaystyle \begin{aligned} \sum_{j=1}^{k-1} n^j \sum_{i=j}^{k} (-1)^{i-j} \left \{ \begin{array}{c} k \\ i \end{array} \right \} \left [ \begin{array}{c} i \\ j \end{array} \right ] = 0 \end{aligned} $$
(3.19)

Matching powers of n in equation (3.19) produces an equation linking the two kinds of Stirling numbers:

$$\displaystyle \begin{aligned} \sum_{i=j}^{k} (-1)^{i-j} \left \{ \begin{array}{c} k \\ i \end{array} \right \} \left [ \begin{array}{c} i \\ j \end{array} \right ] = \left \{ \begin{array}{cl} 0 , & j = 1, \ldots, k-1\\ 1, & j=k \end{array} \right. \end{aligned} $$
(3.20)

The second linkage between Stirling numbers is seen by comparing the submajor diagonals in tables found on pages 31 and 34 which suggests that

$$\displaystyle \begin{aligned} \left [ \begin{array}{c} k \\ k-1 \end{array} \right ] = \left \{ \begin{array}{c} k \\ k-1 \end{array} \right \} \end{aligned} $$
(3.21)

3.2.1 The Stirling Transform and Inverse

Equation (3.20) exposes another example of a transform. To define this let

$$\displaystyle \begin{aligned} u_\ell(\boldsymbol{x}) = \sum_{k=0}^\ell \left \{ \begin{array}{c} \ell \\ k \end{array} \right \} x_k\end{aligned} $$
(3.22)

and

$$\displaystyle \begin{aligned} v_\ell(\boldsymbol{x}) = \sum_{k=0}^\ell (-1)^{\ell - k} \left [ \begin{array}{c} \ell \\ k \end{array} \right ] x_k \end{aligned} $$
(3.23)

and set b  = u (a). Similar to the calculation of a binomial transform and its inverse, calculate

$$\displaystyle \begin{aligned} \begin{array}{rcl} \qquad \qquad v_\ell(\boldsymbol{b}) &\displaystyle =&\displaystyle \sum_{k=0}^\ell (-1)^{\ell - k} \left [ \begin{array}{c} \ell \\ k \end{array} \right ] b_k \\ &\displaystyle =&\displaystyle \sum_{k=0}^\ell (-1)^{\ell - k} \left [ \begin{array}{c} \ell \\ k \end{array} \right ] \sum_{i=0}^k \left \{ \begin{array}{c} k \\ i \end{array} \right \} a_i \\ &\displaystyle =&\displaystyle \sum_{i=0}^\ell a_i \sum_{k=i}^\ell (-1)^{\ell - k} \left [ \begin{array}{c} \ell \\ k \end{array} \right ] \left \{ \begin{array}{c} k \\ i \end{array} \right \} \\ &\displaystyle =&\displaystyle a_\ell \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \text{From Equation (3.20)} \end{array} \end{aligned} $$

This shows that u and v are inverse function of each other. These functions are termed a Stirling transform and inverse, respectively.

3.3 Combinatorial Interpretation

So far the discussion of Stirling numbers has focused on their algebraic properties. This is manifested in the recurrence relations given by equations (3.6) and (3.18). Like binomial and binomial-R coefficients, however, there is a combinatorial interpretation of these recurrences which lends insight into their associated algebraic properties. Consider, for example, the total number of ways to partition n items into k non-empty sets, a quantity we will denote by h(k, n). To illustrate, for k = 3 and set {1, 2, 3, 4} the possible partitions are

$$\displaystyle \begin{aligned} \begin{array}{rcl} {}\quad \{\{ 1\}, \{2 \}, \{ 3,4\} \} \ \ &\displaystyle \ \ \{\{ 1\}, \{3 \} , \{ 2,4\} \} \ \ &\displaystyle \ \ \{\{1 \}, \{ 4\}, \{ 2,3\} \} \\ \{\{1,2 \}, \{ 3\}, \{4 \} \} \ \ &\displaystyle \ \ \{\{1,3 \}, \{ 2\} , \{ 4\} \} \ \ &\displaystyle \ \ \{\{1,4 \}, \{ 2\}, \{4 \} \} \end{array} \end{aligned} $$
(3.24)

showing that h(3, 4) = 6. With n = 3 and set {2, 3, 4} the number of partitions with two sets is given by

$$\displaystyle \begin{aligned} \begin{array}{c} \{ \{2 \}, \ \{3,4 \}\} \ \ \ \ \{ \{3\}, \ \{2,4 \}\} \ \ \ \ \{ \{ 4 \}, \ \{2,3 \}\} \end{array} \end{aligned} $$
(3.25)

showing that h(2, 3) = 3 and the number of partitions with three sets by

$$\displaystyle \begin{aligned} \begin{array}{c} \{ \{2 \} ,\{3\}, \{4\} \} \end{array} \end{aligned} $$
(3.26)

showing that h(3, 3) = 1.

These examples contain the key for calculating a general recurrence relationship for h(k, n). Focus on one distinguished element, denoted by e, which can either occur in a partition by itself or with other members. For instance, letting e = 1 in the first example above (3.24) shows that it occurs alone in partitions found in the first row and as a member with other elements in partitions found in the second row. When e appears by itself, the remaining elements must form a partition of k − 1 sets from the remaining n − 1 elements, which for this example corresponds to the partitions found in the second example (3.25). On the other hand, suppose that e is in a set with other members. Then there are k partitions of n − 1 elements to which it can be added. In our example, the second row shows that 1 is added to each of the sets on the third example (3.26). Since there are k possibilities for selecting the distinguished element that number of such possibilities is given by k h(k, n − 1). These two cases count all possibilities and thus the general recurrence consists of two disjoint parts:

$$\displaystyle \begin{aligned} h(k,n) = \underbrace{h(k-1,n-1)}_{ e \ \text{is by itself}} \ \ \ + \underbrace{k \ h(k,n-1)}_{e \ \text{is with other elements}} \end{aligned} $$
(3.27)

Comparing the recurrence in equation (3.18), with the recurrence just derived, equation (3.27) shows that and provides a combinatorial interpretation of Stirling numbers of the second kind.

A combinatoric interpretation of Stirling numbers of the first kind arises when one considers cycles in permutations. Suppose that integers 1 through n are permuted leading to (a 1, …, a n). If a j = i, then we say that item i in the permutation was moved to position j and represent this by i → j. A cycle in the permutation is a sequence i → j → k →⋯ → i indicating that i was moved to j, j was moved to k, and so forth until eventually the sequence returns back to i. As an example, there are three cycles for the permutation (3, 2, 5, 6, 1, 4):

$$\displaystyle \begin{aligned} 1 \rightarrow 3 \rightarrow 5 \rightarrow 1 \ \ \ \ \ \ \ \ 2 \rightarrow 2 \ \ \ \ \ \ \ \ 4 \rightarrow 6 \rightarrow 4 \end{aligned}$$

How many possible permutations are there in which k cycles are formed when n items are permuted?

To derive a recurrence for this, let g(i, k) count the number of possible i-cycles when k items are permuted. Focus on one distinguished element which is added to n items. This distinguished element can either be a cycle unto itself or become part of another cycle. In the first case i cycles are created if the k other items form i − 1 cycles, g(i − 1, k). In the second case, the distinguished item can be added to any one of the existing i cycles and this can be done by adding it to any of the k places formed by the existing items, kg(i, k). These are disjoint cases and thus

$$\displaystyle \begin{aligned} g(i,k+1) = g(i-1,k) + k g(i,k) \end{aligned} $$
(3.28)

Comparing the recurrence in equation (3.6) with the recurrence just derived, equation (3.28) shows that and provides a combinatorial interpretation of Stirling numbers of the first kind.

To express the recurrence relationships considered thus far in the text along with their combinatorial interpretations, let β k,n denote a recurrence relationship of n items having k sub-features (such as choices, cycles, or partitions). The following table then illustrates the differences between the primary counting regimes:

Type

Recurrence Relationship

Combinatorial Meaning

n k

β k,n =  k−1,n

Number of permutations of k items from a set of n with replacement

\({n}^{ \underline {k}}\)

β k,n =  k−1,n−1

Number of permutations of k items from a set of n without replacement

\(\left \langle \begin {array}{c} n \\ k \end {array} \right \rangle \)

β k,n = β k−1,n  +  β k,n−1

Binomial-R coefficients: The number of ways to choose k items from a set of n with replacement.

\(\left ( \begin {array}{c} n \\ k \end {array} \right ) \)

β k,n = β k−1,n−1 +  β k,n−1

Binomial coefficients: The number of ways to choose k items from a set of n without replacement.

\(\left [ \begin {array}{c} n \\ k \end {array} \right ] \)

β k,n = β k−1,n−1 + (n − 1)β k,n−1

Stirling numbers of the first kind: The number of k cycles in a permutation of n items

\(\left \{ \begin {array}{c} n \\ k \end {array} \right \} \)

β k,n = β k−1,n−1 +  k,n−1

Stirling numbers of the second kind: The number of ways to partition n items into k non-empty subsets.