Fact-checked by Grok 2 weeks ago

Stirling number

Stirling numbers are two families of positive integers that count specific partitioning and permutation structures: the Stirling numbers of the second kind, denoted S(n,k) or \left\{ \begin{array}{c} n \\ k \end{array} \right\}, count the number of ways to a set of n distinct elements into exactly k non-empty unlabeled subsets, while the Stirling numbers of the first kind, denoted \left| \begin{array}{c} n \\ k \end{array} \right|, count the number of s of n elements that consist of exactly k disjoint cycles (with a signed variant s(n,k) = (-1)^{n-k} \left| \begin{array}{c} n \\ k \end{array} \right| often used in generating functions). These numbers, named after the Scottish mathematician James Stirling, play a central role in enumerative combinatorics and appear in the change-of-basis transformations between the monomial basis x^n and the falling factorial basis (x)_n = x(x-1)\cdots(x-n+1) in polynomial expansions. Specifically, the identity x^n = \sum_{k=0}^n S(n,k) (x)_k expresses powers in terms of falling factorials using second-kind numbers, while the inverse relation (x)_n = \sum_{k=0}^n s(n,k) x^k (with signed first-kind numbers) converts falling factorials to powers. Both types satisfy similar recurrences: for second-kind numbers, S(n+1,k) = k \cdot S(n,k) + S(n,k-1), reflecting the choice of placing the (n+1)-th element into an existing subset or a new one; for unsigned first-kind numbers, \left| \begin{array}{c} n+1 \\ k \end{array} \right| = n \cdot \left| \begin{array}{c} n \\ k \end{array} \right| + \left| \begin{array}{c} n \\ k-1 \end{array} \right|, corresponding to inserting the (n+1)-th element into an existing cycle or starting a new one. Beyond partitions and permutations, Stirling numbers extend to broader applications, including the enumeration of surjective functions (where the number of surjections from an n-set to a k-set is k! \cdot S(n,k)), Bell numbers (total partitions, B_n = \sum_k S(n,k)), and connections to algebraic structures like the cycle index of the or derivatives of generating functions such as \ln(1+x). They also arise in probability (e.g., Ewens sampling formula), (e.g., approximations), and even physics (e.g., via cycle decompositions). Values are zero when k > n or k = 0 (except trivial cases), with S(n,1) = 1 and S(n,n) = 1 for second-kind, and similarly \left| \begin{array}{c} n \\ 1 \end{array} \right| = (n-1)! and \left| \begin{array}{c} n \\ n \end{array} \right| = 1 for first-kind, highlighting their boundary behaviors in combinatorial counts.

Definitions and Notation

Stirling Numbers of the First Kind

The signed Stirling numbers of the first kind, denoted s(n,k), are integers defined such that |s(n,k)| equals the number of permutations of n elements with exactly k cycles (where fixed points count as 1-cycles), and the sign is given by (-1)^{n-k}. The unsigned versions, often denoted c(n,k), \left[ \begin{array}{c} n \\ k \end{array} \right], or |s(n,k)|, simply count these permutations without the sign. This combinatorial interpretation arises from decomposing permutations into disjoint cycle structures, where s(n,k) = 0 if k > n or k < 0, and s(n,n) = 1 corresponding to the identity permutation with n fixed points. In standard notation, s(n,k) distinguishes the signed first-kind numbers from the unsigned second-kind Stirling numbers S(n,k), which count set partitions. These signed numbers serve as coefficients in the polynomial expansion of the falling factorial: x^{\underline{n}} = x(x-1)\cdots(x-n+1) = \sum_{k=0}^n s(n,k) \, x^k. For example, with n=3, x(x-1)(x-2) = x^3 - 3x^2 + 2x = \sum_{k=1}^3 s(3,k) \, x^k, yielding s(3,1) = 2, s(3,2) = -3, and s(3,3) = 1. This expansion facilitates change-of-basis transformations between power basis polynomials and falling factorials, with the second-kind numbers providing the inverse relation. Basic values of the signed Stirling numbers of the first kind form a triangular array, with rows indexed by n and columns by k = 1 to n (since s(n,0) = 0 for n > 0). The following table shows values up to n=5, derived from the unsigned counts adjusted by the sign (-1)^{n-k}:
n \setminus k12345
11
2-11
32-31
4-611-61
524-5035-101
These values reflect the cycle counts: for instance, |s(4,2)| = 11 permutations of 4 elements into exactly 2 cycles. The Stirling numbers of the first kind were introduced by James Stirling in his 1730 treatise Methodus Differentialis, where they appeared in algebraic expansions related to factorials and interpolation formulas, predating their combinatorial interpretation.

Stirling Numbers of the Second Kind

Stirling numbers of the second kind, denoted S(n, k) or \left\{ \begin{array}{c} n \\ k \end{array} \right\}, count the number of ways to a set of n distinct objects into k non-empty unlabeled subsets. These numbers arise in various combinatorial contexts and play a core role in expressing powers of a in terms of falling s, providing a between the \{x^n\} and the basis \{(x)_k\}, where the is defined as (x)_k = x(x-1)\cdots(x-k+1) for k \geq 1 and (x)_0 = 1. Specifically, x^n = \sum_{k=0}^n S(n,k) (x)_k. For small values, the table of S(n,k) illustrates their growth:
n \setminus k12345
11
211
3131
41761
511525101
Here, S(3,1) = 1 corresponds to the single partition of three objects into one subset, S(3,2) = 3 to the three ways to partition into two subsets (e.g., for objects {a,b,c}: {{a},{b,c}}, {{b},{a,c}}, {{c},{a,b}}), and S(3,3) = 1 to the partition into three singletons. The Bell number B_n = \sum_{k=1}^n S(n,k) gives the total number of partitions of an n-set into any number of non-empty subsets, linking Stirling numbers of the second kind to the enumeration of all set partitions. James Stirling introduced these numbers in his 1730 treatise Methodus differentialis, where they appeared in the context of series expansions, though their combinatorial interpretation as partition counts was later developed by others.

Combinatorial Interpretations

Permutations and Cycles for the First Kind

The unsigned Stirling numbers of the first kind, denoted c(n,k), count the number of of n elements with exactly k cycles, where fixed points are considered 1-cycles. The signed Stirling numbers of the first kind, s(n,k), satisfy s(n,k) = (-1)^{n-k} c(n,k), providing a signed that aligns with the for falling factorials and facilitates applications in . This signing convention ensures all permutations with the same number of cycles share the same sign, equal to the sign of the permutation itself, since the sign of a permutation is (-1)^{n-k}. For n=4, there are 24 in total. The breakdown by number of cycles is as follows: c(4,1) = 6 (all 4-cycles, such as (1\,2\,3\,4)); c(4,2) = 11 (eight permutations consisting of a 3-cycle and a fixed point, like (1\,2\,3)(4), and three consisting of two 2-cycles, like (1\,2)(3\,4)); c(4,3) = 6 (six permutations each with a 2-cycle and two fixed points, like (1\,2)(3)(4)); and c(4,4) = 1 (the permutation with four fixed points). The corresponding signed values are s(4,1) = -6, s(4,2) = 11, s(4,3) = -6, and s(4,4) = 1. These numbers appear in the of the S_n, which encodes the of by cycle type. The for the unsigned counts is \sum_{n=0}^\infty \left( \sum_{k=0}^n c(n,k) t^k \frac{x^n}{n!} \right) = \exp\left( t \log \frac{1}{1-x} \right), where the inner sum extracts the coefficient for fixed n and t. The signed via s(n,k) supports applications such as counting signed in the context of permutation signs and inclusion-exclusion principles. For (permutations without fixed points), the numbers contribute through the by excluding 1-cycles, yielding the e^{-x}/(1-x) = \sum_{n=0}^\infty d(n) x^n / n!, where d(n) is the derangement count, derived from the full permutation .

Set Partitions for the Bell Numbers and Second Kind

Stirling numbers of the second kind, denoted S(n,[k](/page/K)), count the number of ways to a set of n labeled into exactly [k](/page/K) nonempty unlabeled subsets. Equivalently, S(n,[k](/page/K)) equals the number of surjective functions from a set of n to a set of [k](/page/K) , divided by [k](/page/K)!, since each corresponds to [k](/page/K)! ways to label the subsets. For example, consider partitioning the set \{1,2,3,4\} into 2 nonempty subsets, where S(4,2) = 7. The distinct partitions are:
\{1,2,3\} \mid \{4\},
\{1,2,4\} \mid \{3\},
\{1,3,4\} \mid \{2\},
\{2,3,4\} \mid \{1\},
\{1,2\} \mid \{3,4\},
\{1,3\} \mid \{2,4\},
\{1,4\} \mid \{2,3\}. These illustrate how the subsets are unordered, so partitions differing only by subset relabeling are considered identical.
The Bell number B_n, which enumerates the total number of partitions of an n-element set into any number of nonempty subsets, is given by B_n = \sum_{k=1}^n S(n,k). For n=4, B_4 = S(4,1) + S(4,2) + S(4,3) + S(4,4) = 1 + 7 + 6 + 1 = 15. Thus, the Stirling numbers of the second kind provide a refinement of the , distributing the total partition count across the possible numbers of subsets k. An explicit formula for the Bell numbers, known as Dobiński's formula, is
B_n = \frac{1}{e} \sum_{k=0}^\infty \frac{k^n}{k!}.
This arises from the exponential generating function for Bell numbers and relates directly to the sum over Stirling numbers, as the formula counts weighted partitions via Poisson-distributed structures.
In , Stirling numbers of the second kind are fundamental for enumerating set partitions and structures in combinatorial species, such as unlabeled collections of sets. They also appear in statistics for computing raw moments of distributions like the , where E(X^n) = \sum_{i=1}^n S(n,i) \lambda^i, and in clustering analysis, where partitioning data points into groups mirrors set partition counts.

Polynomial Expansions and Basis Changes

Falling and Rising Factorials

The falling factorial, denoted (x)_n = x(x-1)\cdots(x-n+1), expands as a polynomial in the power basis using the signed Stirling numbers of the first kind: (x)_n = \sum_{k=0}^n s(n,k) x^k, where s(n,k) are the signed coefficients satisfying the recurrence s(n,k) = s(n-1,k-1) - (n-1)s(n-1,k) with boundary conditions s(n,n) = 1 and s(n,0) = 0 for n \geq 1. This identity can be proved by induction on n. For the base case n=1, (x)_1 = x = s(1,1)x holds since s(1,1)=1. Assuming it holds for n-1, then (x)_n = (x)_{n-1}(x-n+1) = (x)_{n-1}x - (n-1)(x)_{n-1}. Substituting the inductive hypothesis yields (x)_n = \left( \sum_{k=0}^{n-1} s(n-1,k) x^k \right) x - (n-1) \sum_{k=0}^{n-1} s(n-1,k) x^k = \sum_{k=1}^n s(n-1,k-1) x^k - (n-1) \sum_{k=0}^{n-1} s(n-1,k) x^k = \sum_{k=0}^n s(n,k) x^k, using the recurrence for s(n,k). For example, expanding (x)_3 = x(x-1)(x-2) = x^3 - 3x^2 + 2x gives s(3,3) = 1, s(3,2) = -3, and s(3,1) = 2. The inverse relation expresses powers in terms of falling factorials using the Stirling numbers of the second kind S(n,k), which count the partitions of an n-set into k nonempty subsets: x^n = \sum_{k=0}^n S(n,k) (x)_k. This holds because the falling factorials form a basis for the polynomials of degree at most n, and the coefficients S(n,k) arise from the , verified by the recurrence S(n,k) = k S(n-1,k) + S(n-1,k-1) with S(n,n)=1 and S(n,0)=0 for n \geq 1. An inductive proof follows similarly: For n=1, x = S(1,1)(x)_1. Assuming for n-1, multiply by x to get x^n = x \cdot x^{n-1} = x \sum_{k=0}^{n-1} S(n-1,k) (x)_k. Using the identity x (x)_k = (x)_{k+1} + k (x)_k, this becomes \sum_{k=0}^{n-1} S(n-1,k) (x)_{k+1} + \sum_{k=0}^{n-1} k S(n-1,k) (x)_k = \sum_{k=1}^n S(n-1,k-1) (x)_k + \sum_{k=1}^{n-1} k S(n-1,k) (x)_k = \sum_{k=0}^n S(n,k) (x)_k. The rising factorial x^{(n)} = x(x+1)\cdots(x+n-1) relates analogously to the unsigned Stirling numbers of the first kind |s(n,k)|: x^{(n)} = \sum_{k=0}^n |s(n,k)| x^k, where the unsigned numbers satisfy |s(n,k)| = (-1)^{n-k} s(n,k) and count permutations of n elements into k cycles. This follows by substituting y = -x - n + 1 into the falling factorial expansion, yielding the positive coefficients for the rising form.

Change of Basis Between Power and Falling Factorial Bases

In the vector space of polynomials of degree at most n, the power basis \{x^0, x^1, \dots, x^n\} and the falling factorial basis \{(x)_0, (x)_1, \dots, (x)_n\}, where (x)_k = x(x-1)\cdots(x-k+1) with (x)_0 = 1, are related by a linear transformation whose coefficients are the Stirling numbers. Specifically, each power x^m = \sum_{k=0}^m S(m,k) (x)_k, where S(m,k) are the Stirling numbers of the second kind. The change of basis matrix from the power basis to the falling factorial basis is thus the (n+1) \times (n+1) upper triangular matrix with entries S(j,i) in row i, column j (indices from 0 to n), which transforms the coordinates of a polynomial from the power basis to the falling factorial basis. The inverse matrix, effecting the transformation from falling factorial coordinates to power coordinates, has entries given by the signed Stirling numbers of the first kind s(j,i) in the corresponding positions. For polynomials of degree at most 3, the change of basis matrix from power to falling factorial basis is \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 1 & 1 \\ 0 & 0 & 1 & 3 \\ 0 & 0 & 0 & 1 \end{pmatrix}, where the (i,j)-entry (rows and columns indexed from 0) is S(j,i). To illustrate, consider p(x) = x^3, which has power basis coordinates (0, 0, 0, 1)^\top. Multiplying by the matrix yields the falling factorial coordinates (0, 1, 3, 1)^\top, corresponding to p(x) = 1 \cdot (x)_1 + 3 \cdot (x)_2 + 1 \cdot (x)_3. These matrices are upper triangular with 1s on the diagonal, hence have 1 and are unipotent (all eigenvalues equal to 1, with the part (M - I) satisfying (M - I)^{n+1} = 0). Such properties make them valuable in umbral calculus, where they facilitate operator representations and symbolic manipulations of polynomials and sequences, treating powers and falling factorials as if interchanged under suitable notations. An important application arises in finite differences. For a polynomial f(x) = \sum_{k=0}^d a_k x^k, the nth forward difference at 0 is \Delta^n f(0) = n! \sum_{k=n}^d S(k,n) a_k, where \Delta f(x) = f(x+1) - f(x) and \Delta^n = \Delta (\Delta^{n-1}). This formula follows from expressing f in the falling factorial basis, where forward differences act diagonally: \Delta (x)_k = k (x)_{k-1}, so only the coefficient of (x)_n contributes to \Delta^n f(0), scaled by n!.

Generating Functions and Explicit Formulas

Ordinary and Exponential Generating Functions

The generating functions for Stirling numbers of the first kind provide essential tools for analyzing permutations and cycle structures. For the signed Stirling numbers of the first kind s(n,k), the exponential generating function (often referred to in combinatorial contexts as the ordinary form due to its role in labeled enumerations) is given by \sum_{n \geq k} s(n,k) \frac{x^n}{n!} = \frac{1}{k!} [\log(1+x)]^k. This formula arises from the combinatorial interpretation of signed cycle counts in the expansion of the logarithm, where the sign alternates based on cycle parity. For the unsigned variants c(n,k) = |s(n,k)|, which count permutations by the number of cycles without signs, the exponential generating function is \sum_{n \geq k} c(n,k) \frac{x^n}{n!} = \frac{1}{k!} \left[ \log \frac{1}{1-x} \right]^k = \frac{ [ -\log(1-x) ]^k }{k!}. This reflects the enumeration of cycle decompositions in the exponential formula for permutations. To illustrate, consider k=2 for the signed case: \frac{1}{2!} [\log(1+x)]^2 = \frac{1}{2} \sum_{m=2}^\infty \frac{(-1)^{m+1} H_{m-1}^{(2)}}{m} (m x^m), but expanding the series yields coefficients matching s(n,2): for n=2, s(2,2)=1; n=3, s(3,2)=-3; n=4, s(4,2)=11, verified by direct computation of the Taylor series divided by n!. Similarly, for the unsigned k=2, \frac{1}{2} [-\log(1-x)]^2 gives c(2,2)=1, c(3,2)=3, c(4,2)=11, confirming the absolute values. The generating functions for Stirling numbers of the second kind similarly encode set partition enumerations. The exponential generating function is \sum_{n \geq k} S(n,k) \frac{x^n}{n!} = \frac{ (e^x - 1)^k }{k!}, derived from the exponential formula applied to disjoint unions of non-empty sets, where e^x - 1 generates singletons and larger blocks. The ordinary generating function for fixed k takes a product form: \sum_{n \geq k} S(n,k) x^n = \frac{ x^k }{ (1 - x)(1 - 2x) \cdots (1 - k x) }. This arises from the explicit summation involving surjective functions onto k labels, with the denominator reflecting geometric series for each label's occupancy. For k=2, the exponential generating function \frac{ (e^x - 1)^2 }{2} = \frac{1}{2} (e^{2x} - 2 e^x + 1) expands to coefficients S(n,2)/n!, yielding S(2,2)=1, S(3,2)=3, S(4,2)=7, S(5,2)=15, consistent with S(n,2) = 2^{n-1} - 1. The ordinary form \frac{ x^2 }{ (1-x)(1-2x) } = x^2 + 3 x^3 + 7 x^4 + 15 x^5 + \cdots directly reproduces these values upon series expansion. These generating functions also underpin identities like the Touchard congruence for Bell numbers B_n = \sum_k S(n,k), which states that for a prime p and nonnegative integer m, B_{p+m} \equiv B_m + B_{m+1} \pmod{p}, derivable from modular properties of the exponential generating function e^{e^x - 1}.

Summation Formulas and Recurrences

Stirling numbers of both kinds satisfy simple recurrence relations that facilitate their computation. For the signed Stirling numbers of the first kind s(n,k), the recurrence is given by s(n,k) = s(n-1,k-1) - (n-1)s(n-1,k), with boundary conditions s(n,n) = 1 for n \geq 0, s(n,0) = 0 for n > 0, s(0,k) = 0 for k > 0, and s(0,0) = 1. This relation reflects the combinatorial construction of permutations by inserting the nth element either into a new cycle or extending an existing one, with the negative sign accounting for the signed convention. For the Stirling numbers of the second kind S(n,k), the recurrence is S(n,k) = k S(n-1,k) + S(n-1,k-1), with boundary conditions S(n,n) = 1 for n \geq 0, S(n,0) = 0 for n > 0, S(0,k) = 0 for k > 0, and S(0,0) = 1. Here, the term k S(n-1,k) corresponds to assigning the nth element to one of the k existing subsets, while S(n-1,k-1) accounts for starting a new subset. Explicit summation formulas provide closed-form expressions for direct evaluation, particularly useful for the second kind. The Stirling number of the second kind admits the inclusion-exclusion-based formula S(n,k) = \frac{1}{k!} \sum_{j=0}^{k} (-1)^{k-j} \binom{k}{j} j^n, derived from counting surjective functions onto k labels modulo permutations of the labels. For the signed Stirling numbers of the first kind, no comparably simple single-sum formula exists; instead, more involved multiple-sum or determinant expressions are used, though the recurrence remains the primary computational tool. To illustrate equivalence, consider S(5,3). Using the recurrence, starting from base values: S(3,2) = 3, S(4,2) = 7, S(4,3) = 6, then S(5,2) = 2 \cdot 7 + 3 = 17, S(5,3) = 3 \cdot 6 + 7 = 25. The summation formula yields S(5,3) = \frac{1}{6} \left[ (-1)^{3-0} \binom{3}{0} 0^5 + (-1)^{2} \binom{3}{1} 1^5 + (-1)^{1} \binom{3}{2} 2^5 + (-1)^{0} \binom{3}{3} 3^5 \right] = \frac{1}{6} (0 + 3 - 96 + 243) = 25, confirming the value. Similarly, for the first kind, the recurrence computes s(5,3) = 35, corresponding to the signed count of permutations of 5 elements into 3 cycles. Asymptotic approximations offer into large-scale . For fixed k, S(n,k) \sim k^n / k! as n \to \infty, capturing the dominance of assigning elements to k subsets. For the first kind with fixed difference, s(n+k,k) \sim (-1)^n k^{2n} / (2^n n!) as k \to \infty with n fixed, highlighting in structures.

Relations to Other Combinatorial Numbers

Lah Numbers and Connections

The Lah numbers L(n,k), for positive integers n \geq k \geq 1, count the number of ways to a set of n distinct elements into k nonempty linearly ordered s (also known as ordered tuples or lists, where the order within each subset matters but the subsets themselves are unlabeled). An explicit formula for the unsigned Lah numbers is L(n,k) = \frac{n!}{k!} \binom{n-1}{k-1}. This formula arises from choosing k-1 "dividers" among the n-1 gaps between n ordered elements and then accounting for the internal orderings within the subsets. The Lah numbers provide the connection between the rising factorial and the falling factorial bases in the of polynomials. Specifically, the rising factorial x^{(n)} = x(x+1) \cdots (x+n-1) expands as x^{(n)} = \sum_{k=1}^n L(n,k) (x)_k, where (x)_k = x(x-1) \cdots (x-k+1) is the falling factorial of degree k. This change-of-basis relation highlights how Lah numbers bridge the two factorial bases, complementing the roles of Stirling numbers in expansions relative to the . The Lah numbers are directly related to Stirling numbers through a convolution that composes set partitions into unordered subsets (Stirling numbers of the second kind) with cycle decompositions or permutations into ordered structures (unsigned Stirling numbers of the first kind), reflecting the transition from unordered to ordered partitions. In matrix terms, the lower triangular matrix of Lah numbers is the product of the matrix of unsigned Stirling numbers of the first kind and the matrix of Stirling numbers of the second kind. For example, with n=3 and k=2, L(3,2) = 6. This counts the partitions of {1,2,3} into two linearly ordered subsets, such as { (1), (2,3) }, { (1), (3,2) }, { (2), (1,3) }, { (2), (3,1) }, { (3), (1,2) }, and { (3), (2,1) }, where the subsets are unlabeled but internally ordered. This illustrates the combinatorial link, as the three possible unordered partitions into two subsets (one singleton and one doubleton) each expand to two ordered versions (from the doubleton's permutations), yielding 6 total.

Stirling Transform and Inversion Formulas

The Stirling transform, also known as the Stirling transformation of the second kind, maps a sequence \{a_n\}_{n \geq 0} to another sequence \{b_n\}_{n \geq 0} defined by b_n = \sum_{k=0}^n S(n,k) a_k, where S(n,k) denotes the number of the second kind. This operation arises naturally in combinatorial contexts where one seeks to express sequences in terms of partition structures encoded by S(n,k). The inverse of this transform recovers the original sequence via a_n = \sum_{k=0}^n s(n,k) b_k, where s(n,k) is the signed number of the first kind. This inversion highlights the complementary roles of the two kinds of Stirling numbers, as the matrices formed by S(n,k) and s(n,k) are inverses of each other. An analogous transform using the first kind appears in basis changes between . Specifically, it relates sequences through expansions where the signed first-kind numbers convert coefficients from the power basis to the falling factorial basis, with the inverse employing unsigned variants or rising factorial adjustments to reverse . These transforms find significant applications in umbral calculus, where they facilitate the manipulation of sequences and operators as if they were powers. For instance, applying the second-kind transform to the constant sequence a_k = 1 yields the Bell numbers b_n = B_n, which count the partitions of an n-element set. In this framework, the exponential generating function (egf) of \{b_n\} is obtained by composing the egf of \{a_n\} with e^x - 1; thus, the egf e^x for constants transforms to \exp(e^x - 1) for Bell numbers. The transforms also aid in solving linear recurrences. For the Bell numbers, the relation B_{n+1} = \sum_{k=0}^n \binom{n}{k} B_k derives from the transform's structure, enabling recursive computations via umbral operators. A key inversion relation underscoring this duality is the orthogonality \sum_{k=0}^{\min(n,m)} S(n,k) s(k,m) = \delta_{n m}, where \delta_{n m} is the Kronecker delta (1 if n = m, 0 otherwise). This identity generalizes to Möbius inversion on the lattice of set partitions, allowing recovery of sequences from their transforms in poset-theoretic settings.

Matrix Representations and Properties

Inverse Matrix Relations

The Stirling numbers of the second kind S(n,k) form the entries of an infinite lower triangular matrix S, where the entry in row n and column k (with n,k \geq 1) is S_{n,k} = S(n,k) and S_{n,k} = 0 for k > n. This matrix represents the change of basis from the falling factorial basis to the monomial power basis in the vector space of polynomials. The inverse of S is another lower triangular matrix whose entry in row n and column k is the signed Stirling number of the first kind s(n,k), satisfying the orthogonality relation \sum_{k=1}^{\min(n,m)} S(n,k) s(k,m) = \delta_{n,m}, where \delta_{n,m} is the . Equivalently, the matrix product S \cdot s = I, where I is the . Both S and its inverse s have determinant 1, as they are lower triangular with 1s on the (S(n,n) = s(n,n) = 1). Consequently, all eigenvalues of each matrix are 1. For illustration, consider the $4 \times 4 principal submatrices (indices 1 to 4): S = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 1 & 1 & 0 & 0 \\ 1 & 3 & 1 & 0 \\ 1 & 7 & 6 & 1 \end{pmatrix}, \quad s = \begin{pmatrix} 1 & 0 & 0 & 0 \\ -1 & 1 & 0 & 0 \\ 2 & -3 & 1 & 0 \\ -6 & 11 & -6 & 1 \end{pmatrix}. Their product yields the $4 \times 4 , verifying the inverse relation explicitly. These inverse matrix relations find applications in solving linear systems arising from or expansions, where one seeks coefficients in the power basis given values in the falling factorial basis (or vice versa), leveraging the triangular structure for efficient forward or backward substitution akin to methods. Additionally, congruences for entries of S a prime p admit analogs of Lucas' theorem for binomial coefficients. Specifically, if the base-p digits of n and k are (n_i) and (k_i), then S(n,k) \equiv \prod_i S(n_i, k_i) \pmod{p} under certain conditions on the digits, providing a multiplicative for Stirling numbers primes.

Symmetry Formulas and Congruences

Stirling numbers of the first and second kinds exhibit a fundamental duality through their orthogonality relations, which arise from the relationship between the change-of-basis matrices they define. Specifically, the signed Stirling numbers of the first kind s(n, k) and the Stirling numbers of the second kind S(k, m) satisfy \sum_{k} s(n, k) S(k, m) = \delta_{n, m}, where \delta_{n, m} is the Kronecker delta function, equal to 1 if n = m and 0 otherwise. This identity highlights the symmetric inverse nature of the two families in transforming between the power basis and the falling factorial basis of polynomials. A symmetric form of the relation also holds in the reverse direction: \sum_{k} S(n, k) s(k, m) = \delta_{n, m}. These orthogonality relations are central to many combinatorial proofs and generating function manipulations involving Stirling numbers. Congruences for Stirling numbers, particularly those of the second kind modulo primes and prime powers, provide insights into their divisibility properties and have applications in p-adic analysis and combinatorial . A key result characterizes S(n, k) modulo p^{m+1} for odd primes p when k = a p^m, expressing it in terms of binomial coefficients: S(n, a p^m) \equiv p^m \begin{cases} \binom{n - a p^m - 1}{p - 1} - 1 & \text{if } n \equiv a \pmod{p-1}, \\ 0 & \text{otherwise}. \end{cases} \pmod{p^{m+1}}. This congruence implies that p^{m+1} divides S(n, a p^m) unless the congruence condition on n and a holds, in which case the valuation is exactly m under additional restrictions on the term. For p = 2, simpler and higher-power congruences exist; for instance, the of S(n, k) is given by S(n, k) \equiv \begin{cases} 0 \pmod{2} & \text{if } n < k, \\ \binom{n - \lfloor k/2 \rfloor - 1}{n - k} \pmod{2} & \text{if } n \geq k. \end{cases} An example for p = 3 and m = 1, with a = 1, k = 3, shows S(4, 3) \equiv 0 \pmod{3} since $4 \not\equiv 1 \pmod{2}, consistent with direct computation S(4, 3) = 6. For p = 2, S(5, 2) = 15 \equiv 1 \pmod{2}, matching \binom{5 - 1 - 1}{5 - 2} = \binom{3}{3} = 1 \pmod{2}. These results stem from explicit expansions and modular properties of the defining recurrences. More advanced congruences involve p-adic valuations v_p(S(n, k)), which can be determined via base-p digit expansions analogous to for binomial coefficients. The valuation v_p(S(n, k)) equals the number of carries when adding the base-p representations of certain parameters related to n and k, providing a combinatorial measure of divisibility by p. For instance, explicit formulas for v_p(S(p^r, k)) have been derived for specific classes of k, such as when k is a power of p.

Extensions and Generalizations

Negative Upper Index

Stirling numbers can be extended to negative upper indices using recurrence relations and generating function approaches, providing formal values consistent with analytic continuation despite lacking direct combinatorial interpretations. For the second kind, the recurrence S(n+1,k) = k S(n,k) + S(n,k-1) holds for negative n as well, with boundary conditions extended appropriately. For instance, the values for upper index -1 are given by S(-1, k) = (-1)^{k+1} k! H_k, where H_k is the k-th harmonic number. Examples include S(-1, 1) = 1 and S(-1, 2) = -3. For Stirling numbers of the first kind, similar extensions apply through their recurrences and generating functions, such as \left| \begin{array}{c} n+1 \\ k \end{array} \right| = n \left| \begin{array}{c} n \\ k \end{array} \right| + \left| \begin{array}{c} n \\ k-1 \end{array} \right|, yielding rational values for negative n. The signed variants s(-n, k) follow accordingly. These generalizations arise from and are useful in algebraic identities and special function theory.

Signed and Unsigned Variants

Stirling numbers of the first kind come in both signed and unsigned variants, with the unsigned version c(n,k) (also denoted \left| \begin{array}{c} n \\ k \end{array} \right|) counting the number of permutations of n elements into exactly k disjoint cycles, including fixed points as 1-cycles. The signed variant s(n,k) is defined as s(n,k) = (-1)^{n-k} c(n,k), incorporating an alternating sign that facilitates algebraic manipulations, particularly in generating functions where it expands the falling factorial as (x)_n = \sum_{k=0}^n s(n,k) x^k, avoiding the need for absolute values in coefficient expressions. This signed form ensures the coefficients align naturally with the polynomial's structure without additional sign adjustments. In contrast, Stirling numbers of the second kind S(n,k) are inherently unsigned and positive, enumerating the ways to a set of n elements into exactly k non-empty unlabeled subsets, with no standard signed counterpart due to their direct combinatorial positivity. The unsigned nature of both c(n,k) and S(n,k) reflects their origins in pure counting problems, such as cycle decompositions and set partitions, respectively. Historically, James Stirling introduced these numbers in 1730 within an algebraic context for series expansions, initially without explicit combinatorial interpretations or sign distinctions. Combinatorial meanings emerged later, with unsigned counts emphasized in early 20th-century works, such as Nielsen's attribution of partition interpretations to the second kind; the signed first-kind variant evolved subsequently to streamline algebraic applications, like inclusion-exclusion principles and polynomial bases, where the alternating sign simplifies derivations. Generalizations include r-Stirling numbers of the second kind S_r(n,k), which count the partitions of an n + r-element set into k + r non-empty subsets such that r distinguished elements each occupy distinct subsets, generalizing standard partitions by enforcing separation of specified elements (analogous to avoiding merged "fixed" components). Weighted variants further modify these by assigning values to block sizes or cycle lengths, but retain the unsigned positivity for counting purposes. q-Analogs deform the classical numbers via q-deformations of factorials and recurrences, such as the q-Stirling numbers of the second kind defined by S_q(n,k) = S_q(n-1,k-1) + _q S_q(n-1,k), where _q = \frac{1 - q^k}{1 - q} is the q-integer, recovering the ordinary case as q \to 1. For example, with n=3, k=2, S_q(3,2) = {{grok:render&&&type=render_inline_citation&&&citation_id=2&&&citation_type=wikipedia}}_q + q = 1 + 2q, illustrating the q-weighting that tracks additional statistics like inversions in q-analog permutations. Similar q-analogs exist for the first kind, adapting cycle counts with q-factors.

References

  1. [1]
    1.8 Stirling numbers
    Definition 1.8.1 The Stirling number of the second kind, S(n,k) or {nk}, is the number of partitions of [n]={1,2,…, n} into exactly k parts, 1≤k≤n.
  2. [2]
    [PDF] Stirling Numbers - Math 475
    Apr 17, 2012 · Furthermore the inverse is lower diagonal. Definition 1.4 The Stirling numbers of the first and second kind are defined. 2. Page 3.
  3. [3]
    Stirling Number of the First Kind -- from Wolfram MathWorld
    The signed Stirling numbers of the first kind are defined such that the number of permutations of elements which contain exactly permutation cycles is the ...
  4. [4]
    A008275 - OEIS
    The unsigned numbers are also called Stirling cycle numbers: |s(n,k)| = number of permutations of n objects with exactly k cycles.
  5. [5]
    James Stirling (1692 - Biography - MacTutor History of Mathematics
    James Stirling was a Scottish mathematician whose most important work Methodus Differentialis in 1730 is a treatise on infinite series, summation, interpolation ...
  6. [6]
    Stirling Number of the Second Kind -- from Wolfram MathWorld
    Stirling numbers of the second kind count the ways to partition n elements into m nonempty sets, also called a Stirling set number.
  7. [7]
    Stirling numbers of the second kind - PlanetMath
    Mar 22, 2013 · The Stirling numbers of the second kind can be characterized as the coefficients involved in the corresponding change of basis matrix.
  8. [8]
    Stirling Numbers of the Second Kind - Statistics How To
    The Stirling numbers of the second kind tell us how many ways there are of dividing up a set of n labelled objects into k nonempty subsets.
  9. [9]
    1.4 Bell numbers
    We denote the number of partitions of an n-element set by Bn; these are the Bell numbers. ... The S(n,k) are the Stirling numbers of the second kind. Find a ...
  10. [10]
    [PDF] Stirling Numbers of the Second Kind - MIT Mathematics
    We will define what the Stirling numbers are, and use them to prove the “Stirling Number Dual of the Binomial Theorem”. 1 Introduction. Combinatorics is a ...
  11. [11]
    DLMF: §26.8 Set Partitions: Stirling Numbers ‣ Properties ...
    s ⁡ ( n , k ) denotes the Stirling number of the first kind: ( − 1 ) n − k times the number of permutations of { 1 , 2 , ... , n } with exactly k cycles
  12. [12]
    [PDF] Stirling numbers
    4 0 -6 11 -6 1. Table 2: Stirling numbers of the first kind. The absolute value of s(m, n) is often denoted by c(m, n), since it is the number of permutations.
  13. [13]
  14. [14]
    [PDF] Enumerative Combinatorics Volume 1 second edition - Mathematics
    Chapter 1. What is Enumerative Combinatorics? 1.1. How to count. 9. 1.2. Sets and multisets. 23. 1.3. Cycles and inversions.
  15. [15]
    [PDF] Derangements: So combinatorially, we want to partition [n] into its ...
    Derangements: ... stirling numbers of the first kind) Hence, the coefficient of xn in the EGF of the derangement numbers is the coefficient of xn in the sum.
  16. [16]
    [PDF] Active learning exercise on Stirling numbers of the second kind
    Oct 10, 2011 · For positive integers n, k with 1 ≤ k ≤ n, the Stirling number of the second kind S(n, k) is the number of ways to partition a set of n labelled.
  17. [17]
    Bell Number -- from Wolfram MathWorld
    Bell as a result of the general theory he developed in his 1934 paper (Bell 1934), the first systematic study of Bell numbers was made by Ramanujan in chapter 3 ...Missing: Dobinski authoritative source<|separator|>
  18. [18]
    Dobiński's Formula -- from Wolfram MathWorld
    Dobiński's Formula ; B_n(x)=e^(-x)sum_(k=0. (1) ; B_n=1/esum_(k=0)^infty(k^n. (2) ; (m^n)/(m!)=sum_(k=1. (3) ; sum_(m=1)^infty(m^n)/(m. (4) ; sum_(k=1)^nS(n,k)lambda ...
  19. [19]
    [PDF] The Stirling Numbers of the Second Kind and Their Applications
    (r − i + 1) is known (defined) as the 'falling factorial of r up to i-th term'. The equation (4.1) is known as the generating function of the numbers. S (n ...
  20. [20]
    [PDF] Discrete Structures Stirling Numbers CS2800 Fall 2013 October 23 ...
    Oct 23, 2013 · The absolute value of s(n, k) is denoted |s(n, k)| and is called an unsigned Stirling number of the first kind. The signs alternate, so s(n, k)=( ...
  21. [21]
    [PDF] Stirling Number of Second Kind Identities - CSUN
    where (x)m = x(x - 1)···(x - m + 1) is the falling factorial. Proof. It suffices to prove the identity for all natural number x. The LHS is the number of x- ...
  22. [22]
    Conversions between standard polynomial bases - Terry Tao
    Apr 7, 2019 · For instance if one uses the falling factorial basis. \ ... and the conversion back is given by the Stirling numbers of the second kind ...
  23. [23]
    [PDF] sums of powers, stirling and bernoulli numbers
    We now can state the polynomial formula for sums of powers using Stirling numbers of the second kind. S(k, j) (n + 1)n ∗···∗ (n − j + 1) j + 1 . satisfies Ak(n ...
  24. [24]
    [PDF] generatingfunctionology - Penn Math
    May 21, 1992 · we called those numbers n k , the Stirling numbers of the second kind. To apply the exponential formula we first compute the egf of the num-.<|control11|><|separator|>
  25. [25]
    Multi-Lah numbers and multi-Stirling numbers of the first kind
    It is also well known that the unsigned Lah number L ( n , k ) counts the number of ways a set of n elements can be partitioned into k nonempty linearly ordered ...
  26. [26]
    Lah Number -- from Wolfram MathWorld
    The numbers B_(n,k)(1!,2!,3!,...)=(n-1; k-1)(n!)/(k!), where B_(n,k) is a Bell polynomial.
  27. [27]
    [PDF] The Multivariate Lah and Stirling Numbers
    We study several combinatorial properties such as explicit formulas, recurrence relations, generating functions, and some convolution identities. 1 Introduction.
  28. [28]
    Restricted Stirling and Lah number matrices and their inverses
    Note that we recover the classical Stirling numbers of both kinds and the Lah numbers by taking R to be N (e.g. { n k } N = { n k } etc.). Various instances of ...
  29. [29]
    Stirling Transform -- from Wolfram MathWorld
    S(n,k) is a Stirling number of the second kind. The inverse transform is given by a_n=sum_(k=0)^Ns(n,k)b_k, (2) where s(n,k) is a Stirling number of the ...Missing: "Stirling
  30. [30]
  31. [31]
    Sums of Powers of Integers and Stirling Numbers - SpringerLink
    May 24, 2022 · Our derivation makes use of the orthogonality relations for the Stirling numbers ... R L Graham, D E Knuth, and O Patashnik, Concrete Mathematics.
  32. [32]
    [PDF] Lecture 5 1 Stirling inverse matrices
    Feb 15, 2011 · Stirling inverse matrices relate Stirling numbers of the second kind (S(n,k)) and signed Stirling numbers of the first kind (s(k,j)) with the ...
  33. [33]
    [PDF] integers 25 (2025) on matrices whose entries are stirling numbers of ...
    Mar 26, 2025 · signed Stirling number of the first kind (also known as Stirling number of the first kind), which is defined as s(n, k)=(−1)n−kc(n, k).
  34. [34]
    [PDF] The Lucas congruence for Stirling numbers of the second kind
    By Lemma 5.1 and by Wilson's Theorem the second sum in (13) is equivalent to −1 (mod p). Thus we finally obtain the assertion of Theorem 5.2. Theorem 5.3. If k ...
  35. [35]
    [PDF] Congruences for Stirling Numbers of the Second Kind - O-Yeat Chan
    Nov 9, 2009 · We characterize the Stirling numbers of the second kind S(n, k) modulo prime powers in terms of binomial coefficients. Our results are ...<|control11|><|separator|>
  36. [36]
    (PDF) On the P-Adic Valuations of Stirling Numbers of the Second ...
    Feb 5, 2021 · In this paper, we introduced certain formulas for p-adic valuations of Stirling numbers of the second kind S(n, k) denoted by vp(S(n, ...
  37. [37]
    [PDF] Computation of Stirling numbers and generalizations
    The names reflect the combinatorial significance of the numbers, and the notations are inspired by the similar notation for the binomial coefficients. We ...
  38. [38]
    [PDF] The r-Stirling numbers - DTIC
    Jan 18, 1983 · The r-Stirling numbers of the first and second kind count restricted permutations and respectively restricted partitions, the restriction being ...
  39. [39]
    q-Stirling numbers: A new view - ScienceDirect.com
    Letting t = 1 + q we give a bijective argument showing the -Stirling numbers of the first and second kinds are orthogonal.