q-Stirling Identities Revisited

We give combinatorial proofs of q-Stirling identities using restricted growth words. This includes a poset theoretic proof of Carlitz’s identity, a new proof of the q-Frobenius identity of Garsia and Remmel and of Ehrenborg’s Hankel q-Stirling determinantal identity. We also develop a two parameter generalization to unify identities of Mercier and include a symmetric function version.


Introduction
The classical Stirling number of the second kind S(n, k) is the number of set partitions of n elements into k blocks. The Stirling numbers of the second kind first appeared in work of Stirling in 1730, where he gave the Newton expansion of the functions f (z) = z n in terms of the falling factorial basis [31,Page 8]. Kaplansky and Riordan [19] found the combinatorial interpretation that the Stirling number S(n, k) enumerates the number of ways to place n − k non-attacking rooks on a triangular board of side length n − 1. From later work of Garsia and Remmel, this is equivalent to the number of set partitions of n elements into k blocks [14].
The q-Stirling numbers of the second kind arose from Carlitz's development of a qanalogue of the Bernoulli numbers and is predated by a problem of his involving abelian groups [3,4]. There is a long history of studying set partitions [6,14,21,28], Stirling numbers of the second kind and their q-analogues [3,12,15,25,34,35].
In the literature there are many identities involving Stirling and q-Stirling numbers of the second kind. Stirling identities which appear in Jordan's text [18] have been transformed to q-identities by Ernst [13] using the theory of Hahn-Cigler-Carlitz-Johnson, Carlitz-Gould and the Jackson q-derivative. Verde-Star uses the divided difference operator [32] and the complete homogeneous symmetric polynomials in the indeterminates x k = 1 + q + · · · + q k in his work [33].
The goal of this paper is to give bijective proofs of many of these q-Stirling identities as well as a number of new identities. Underlying these proofs is the theory of restricted growth words which we review in the next section. In Section 3 we discuss recurrence structured q-Stirling identities, while in Section 4 we focus on Gould's ordinary generating function for the q-Stirling number. A poset theoretic proof of Carlitz's identity is given in Section 5. Section 6 contains combinatorial proofs of the de Médicis-Leroux q-Vandermonde convolutions. We provide new proofs of Garsia and Remmel's q-analogue of the Frobenius identity and of Ehrenborg's Hankel q-Stirling determinantal identity in Sections 7 and 8. In Section 9 we prove two identities of Carlitz each using a sign-reversing involution on RG-words. In Section 10 we prove two parameter q-Stirling identities, generalizing identities of Mercier and include a symmetric function reformulation. We end with concluding remarks.

Preliminaries
A word w = w 1 w 2 · · · w n of length n where the entries are positive integers is called a restricted growth word, or RG-word for short, if w i is bounded above by max(0, w 1 , w 2 , . . . , w i−1 )+1 for all indices i. This class of words was introduced by Milne in the papers [24,25]. The set of RG-words of length n where the largest entry is k is in bijective correspondence with set partitions of the set {1, 2, . . . , n} into k blocks. Namely, if w i = w j , place the elements i and j in the same block of the partition. To describe the inverse of this bijection, write the partition π = B 1 /B 2 / · · · /B k in standard form, that is, with min(B 1 ) < min(B 2 ) < · · · < min(B k ). The associated RG-word is given by w = w 1 · · · w n where w i = j if the entry i appears in the jth block B j of π.
One way to obtain a q-analogue of Stirling numbers of the second kind is to introduce a weight on RG-words. Let RG(n, k) denote the set of all RG-words of length n with maximal entry k. Observe that RG(n, k) is the empty set if n < k. The set RG(n, 0) is also empty for n > 0 but the set RG(0, 0) is the singleton set consisting of the empty word . Define the weight of w = w 1 w 2 · · · w n ∈ RG(n, k) by where [k] q = 1 + q + · · · + q k−1 . To see this, consider a word w ∈ RG(n, k). If the last letter is a left-to-right maxima then the word w is of the form w = v · k where v ∈ RG(n − 1, k − 1), yielding the first term of the recurrence. Otherwise w is of the form w = v · i where v ∈ RG(n − 1, k) and 1 i k, which yields the second term of the recurrence. The boundary conditions S q [n, 0] = δ n,0 and S q [0, k] = δ 0,k also follow from the interpretation (2.2). For other weightings of RG-words which generate the q-Stirling numbers of the second kind, see [26] and [34].
For a word w = w 1 w 2 · · · w n define the length of w to be (w) = n. Similarly, define the ls-weight of w to be ls(w) = q n i=1 (w i −1) . This is a generalization of the ls-statistic of RG-words [34, Section 2]. The concatenation of two words u and v is denoted by u · v. The word v is a factor of the word w if one can write In other words, a factor of w is a subword consisting of consecutive entries. For S a set of positive integers, let S k denote the set of all words of length k with entries in S. Furthermore, let S * denote the union S * = · k 0 S k , that is, the set of all words with entries in S. Observe that when S is the empty set then S * consists only of the empty word . Let [j, k] denote the interval [j, k] = {i ∈ P : j i k}.
Recall the q-Stirling numbers of the second kind are specializations of the homogeneous symmetric function h n−k : See for instance [22, Chapter I, Section 2, Example 11]. This follows directly by observing that a word w ∈ RG(n, k) has a unique expansion of the form where u i is a word in [1, i] * . By summing over all words u i for i = 1, . . . , k such that the sum of their lengths is (u 1 ) + (u 2 ) + · · · + (u k ) = n − k, equation (2.3) follows.

Recurrence related identities
In this section we focus on recurrence structured identities for the q-Stirling numbers of the second kind. The proofs we provide here use the combinatorics of RG-words.
We begin with Mercier's identity [23,Theorem 3]. This is a q-analogue of Jordan [18, equation 9, page 187]. Mercier's original proof of Theorem 3.1 was by induction. Later a combinatorial proof using 0-1 tableaux was given by de Médicis and Leroux [7]. In the same paper, de Médicis and Leroux proved Theorems 3.3 and 3.4 using 0-1 tableaux.
Theorem 3.1 (Mercier, 1990). For nonnegative integers n and k, the following identity holds: Proof. When n < k there is nothing to prove. For any word w ∈ RG(n + 1, k + 1), suppose there are m entries in w that are not equal to one. Remove the n + 1 − m entries equal to one in w and then subtract one from each of the remaining m entries to obtain a new word u. Observe u ∈ RG(m, k) and wt(w) = q m−k · wt(u). Conversely, given a word u ∈ RG(m, k), one can first increase each of the m entries by one and then insert n+1−m ones into the word to obtain an RG-word w ∈ RG(n + 1, k + 1). There are n n−m = n m ways to insert the n + 1 − m ones since the first entry in an RG-word must be one. In other words, for any u ∈ RG(m, k) we can obtain n m new RG-words in RG(n + 1, k + 1) under the map described above, which gives the desired identity.
Using similar ideas we also prove the following q-identity. It is a q-analogue of a result due to Jordan [18,   Proof. For a subset A ⊆ {2, 3, . . . , n + 1} observe that the sum over the weights of RGwords in the set RG(n + 1, m + 1) with ones in the set of positions containing the set A is given by S q [n + 1 − |A|, m + 1]. Hence by inclusion-exclusion the right-hand side of equation (3.2) is the sum of the weights of all words in RG(n + 1, m + 1) where the element 1 only occurs in first position. This set of RG-words is also obtained by taking a word in RG(n, m), adding one to each entry, which multiplies the weight by q n−m , and concatenating it with a one on the left.   Leroux, 1993). For nonnegative integers n and k, the following identity holds: Proof. Factor a word w ∈ RG(n + 1, k + 1) as w = x · (k + 1) · y where x ∈ RG(j, k) for some j k and y belongs to [1, k + 1] * . The factor y has length n − j. The sum of the weights of these words is [k + 1] n−j q · S q [j, k]. The result follows by summing over all possible integers j.
Theorem 3.4 (de Médicis- Leroux, 1993). For nonnegative integers n and k, the following identity holds: Proof. For a word w ∈ RG(n, k) consider factorizations w = x · y · z with the following two properties: (1) the rightmost letter of the factor x, call this letter i, is a left-to-right maxima of x, and (2) the word y is non-empty and all letters of y are at most i. We claim that the number of such factorizations of w is n − k. Let s i be the number of letters between the first occurrence of i and the first occurrence of i + 1, and let s k be the number of letters after the first occurrence of k. For a particular i, we have s i choices for the word y. But k i=1 s i = n − k since there are n − k repeated letters in w. This completes the claim.
Fix integers 1 j n − k and 1 i k. Given a word u ∈ RG(n − j, k), we can factor it uniquely as x · z, where the last letter of x is the first occurrence of i in the word u. Pick y to be any word of length j with letters at most i. Finally, let w = x · y · z. Observe that this is a factorization satisfying the conditions from the previous paragraph. Furthermore, we have wt(w) = wt(u) · ls(y). Summing over all words u ∈ RG(n, k) and Lastly, summing over all i and j gives the desired equality.

Gould's generating function
Gould [15, equation (3.4)] gave an analytic proof for the ordinary generating function of the q-Stirling numbers of the second kind. Later Ernst [13,Theorem 3.22] gave a proof using the orthogonality of the q-Stirling numbers of the first and second kinds. Wachs and White [34] stated a p, q-version of this generating function without proof. Here we prove Gould's q-generating function using RG-words.
Theorem 4.1 (Gould, 1961). The q-Stirling numbers of the second kind S q [n, k] have the generating function .
Proof. The left-hand side of (4.1) is the sum of over all RG-words w of length at least k with largest letter k where each term is wt(w)·t (w) . Using the expansion in equation (2.4), that is, w = 1·u 1 ·2·u 2 · · · k ·u k where u i is a word in [1, i] * , observe the weight of w factors as wt(w) = ls(u 1 ) · ls(u 2 ) · · · ls(u k ) whereas the term t (w) factors as t k · t (u 1 ) · t (u 2 ) · · · t (u k ) .
the electronic journal of combinatorics 25(1) (2018), #P1.37 Since there are no restrictions on the length of ith word u i , all the words u i for i = 1, . . . , k together contribute the factor 1 + By multiplying together all the contributions from all of the words u i , the identity follows.

A poset proof of Carlitz's identity
In this section we state a poset decomposition theorem for the Cartesian product of chains. This decomposition implies Carlitz's identity. For basic poset terminology and background, we refer the reader to Stanley's treatise [29,Chapter 3].
Let C m denote the chain on m elements. Recall that P n is the set of all words of length n having positive integer entries. We make this set into a poset, in fact, a lattice, by entrywise comparison, where the partial order relation is given by v 1 v 2 · · · v n w 1 w 2 · · · w n if and only if v i w i for all indices 1 i n. Note that [1, m] n is the subposet consisting of all words of length n where the entries are at most m.
For a word v in RG(n, k), factor v according to equation (2.4), that is, write v as the Theorem 5.1. The n-fold Cartesian product of the m-chain has the decomposition Proof. Define a map f : P n −→ P n as follows. Let w = w 1 w 2 · · · w n be a word in P n . If w is an RG-word, let f (w) = w. Otherwise let i be the smallest index in w reading from left to right that makes w fail to be an RG-word. In other words, i is the smallest index such that max(0, w 1 , w 2 , . . . , w i−1 ) + 1 < w i . Let f (w) be the new word formed by replacing the ith entry of w with max(0, w 1 , w 2 , . . . , w i−1 ) + 1. Observe that for all words w we obtain the poset inequality f (w) w.
Since the word w only has n entries, we know that the (n + 1)st iteration of f is equal to the nth iteration of f , that is, f n+1 (w) = f n (w). Furthermore, f n (w) is an RG-word. Finally, define ϕ : P n −→ · 0 k n RG(n, k) to be the map f n . Observe that ϕ is a surjection since every RG-word is a fixed point. Furthermore, for all words w the inequality ϕ(w) w holds in the poset P n .
Let v be a word in RG(n, k). Use the expansion Observe that as a poset this fiber is isomorphic to P k . When we restrict to [1, m] n we obtain that the intersection . Taking the disjoint union over all RG-words v, the decomposition follows.
By considering the rank generating function of Theorem 5.1, we can obtain a poset theoretic proof of Carlitz's identity [4,Section 3]. Other proofs are due to Milne using finite operator techniques on restricted growth functions [25], de Médicis and Leroux via interpreting the identity as counting products of matrices over the finite field GF(q) having non-zero columns [7], and Ehrenborg and Readdy using the theory of juggling sequences [12].
Corollary 5.2 (Carlitz, 1948). The following q-identity holds: Proof. The cases when n = 0 or m = 0 are straightforward. The rank generating function of the left-hand side of Theorem 5.1 is [m] n q . The rank generating function of the interval By summing over all RG-words, the result follows. The map ϕ that appears in the proof of Theorem 5.1 has interesting properties.
Proposition 5.4. The map ϕ : P n −→ · 0 k n RG(n, k) is the dual of a closure operator, that is, it satisfies the following three properties: Proof. Properties (i) and (ii) are direct from the construction of the map ϕ. To prove property (iii) assume that we have v w but ϕ(v) ϕ(w). Let i be the smallest index As a consequence of the closure property, if v and w are RG-words then so is their join v ∨ w = u where the ith entry is given by u i = max(v i , w i ). This can also be proven directly. Note however that the set of RG-words is not closed under the meet operation; see for instance the two RG-words 1123 and 1213.  .14)]. In this section we present combinatorial proofs of the de Médicis-Leroux results using RG-words.
As a remark, Theorem 3.1 is the special case of n = 1 in Theorem 6.1.
Theorem 6.1 (de Médicis- Leroux, 1995). The following q-Vandermonde convolution holds for q-Stirling numbers of the second kind: Proof. Given a word w ∈ RG(m + n, k), factor it as w = u · z where u has length n and i is the largest entry in u. By assumption, u ∈ RG(n, i).
The second factor z = w n+1 · w n+2 · · · w n+m has length m and its maximal entry is at most k. In particular, if i < k then the maximal entry for z is exactly k. Suppose there are j entries in z that are strictly larger than i. These j entries from z form a subword v.
For any word w ∈ RG(m + n, k), we can decompose it as described above. In such a decomposition, the first segment u contributes to a factor of S q [n, i]. The subsequence v of the second segment z contributes to a factor of S q [j, k − i] · q i·(j−(k−i)) since the shift v (−i) causes a weight loss of q i from each of the j − (k − i) repeated entries in v. Finally, the remaining entries in z that are less than or equal to i range from 1 to i. Each will contribute to a factor of [i] q . These m − j entries can be assigned at any position in z, which gives m j choices. Multiplying all these weights, we obtain the desired identity. Note that Theorem 3.3 is a special case of Theorem 6.2 when one takes r = 0. Theorem 6.2 (de Médicis- Leroux, 1995). The following q-Vandermonde convolution holds for q-Stirling numbers of the second kind: Proof. This result is proved in a similar fashion as Theorem 6.1. For any w ∈ RG(n + 1, k + r + 1), suppose w is of the form x · (k + 1) · y where x ∈ RG(n − i, k) for some i. Consider the remaining word y = w n−i+2 · · · w n+1 of length i. The maximal entry of y is k + r + 1. Suppose there are j entries in y that are at least k + 2. These j entries form a subword v, and v (−k−1) , obtained by subtracting k +1 from each entry in v, is an RG-word in RG(j, r), giving a total weight of S q [j, r]. The weight loss from the shift is q (k+1)·(j−r) since there are j − r repeated entries. The remaining i − j entries in y can be any value the electronic journal of combinatorics 25(1) (2018), #P1.37 from the interval [1, k + 1]. Each such entry contributes to a factor of [k + 1] q . Finally, there are i j ways to place the j entries back into u. This proves identity (6.2). Remark 6.3. Theorem 3.2 can be viewed as an inversion of Theorem 3.1. Furthermore, Theorem 3.1 is a special case of Theorem 6.1. Is there any sort of natural inversion analogue to Theorem 6.1?

A q-analogue of the Frobenius identity
We now prove a q-analogue of the Frobenius identity by Garsia and Remmel [14, equation I.1].
Theorem 7.1 (Garsia-Remmel, 1986). The following q-Frobenius identity holds: Proof. When n = 0 the result is direct. We concentrate on the case n > 0. For a word w in P n let max(w) denote its maximal entry. Hence the left-hand side of equation (7.1) is given by Recall the poset map ϕ : P n −→ · 0 k n RG(n, k) appearing in the proof of Theorem 5.1.
Let v ∈ RG(n, k). The fiber ϕ −1 (v) is given in equation (5.1). The sum over this fiber appears in the proof of Corollary 5.2, that is, Multiplying the above by x m and summing over all m 0 yields The result now follows by summing over all RG-words of length n.

A determinantal identity
The following identity was first stated by Ehrenborg [10, Theorem 3.1] who proved it using juggling patterns. We now present a proof using RG-words.
Factor the word w(i) ∈ RG(s + i + σ(i), s + σ(i)) as w(i) = u(i) · v(i) where the lengths are given by (u(i)) = s + i and (v(i)) = σ(i). Furthermore, let a i denote the number of repeated entries in the RG-word w(i) that appear in the factor v(i), that is, There are σ(i)−a i left-to-right maxima of w(i) that appear in v(i). Since w(i) has s+σ(i) left-to-right maxima, we obtain that the first factor u(i) has (s+σ(i))−(σ(i)−a i ) = s+a i left-to-right maxima, that is, the factor u(i) belongs to the set RG(s + i, s + a i ). To be explicit, the left-to-right maxima of u(i) are given by 1, 2, . . . , s + a i . Lastly, observe that there are i repeated entries in any word w(i) ∈ RG(s + i + σ(i), s + σ(i)) and σ(i) is the length of v(i), yielding the bound a i min(i, σ(i)) for all i. Let T 1 ⊆ T consist of all tuples (σ, w(0), . . . , w(n)) where the sequence of a i 's for i = 0, . . . , n are distinct. This implies a i = i = σ(i), that is, σ is the identity permutation. Furthermore, the first factor u(i) is equal to 12 · · · (s + i) and the second factor v(i) can be any word of length i with the entries from the interval [1, s + i]. Thus wt(w(i)) = ls(v(i)) and the sum over all such words v(i) gives a total weight of [s + i] i q . Thus we have (σ,w(0),...,w(n))∈T 1 (−1) σ · wt(w(0)) · wt(w(1)) · · · wt(w(n)) = Let T 2 = T − T 1 be the complement of T 1 . Define a sign-reversing involution ϕ on T 2 as follows. For t = (σ, w(0), . . . , w(n)) ∈ T 2 there exists indices i 1 and i 2 such that a i 1 = a i 2 . Let (j, k) be the least such pair of indices in the lexicographic order. First let σ = σ • (j, k) where (j, k) denotes the transposition. Second, let w(i) = w(i) for i = j, k. Finally, define w(j) and w(k) by switching the second factors in the factorizations, that is, w(j) = u(j)v(k) and w(k) = u(k)v(j). Overall, the function is given by ϕ(t) = (σ , w(0) , . . . , w(n) ) Since u(j) and u(k) have the same number of left-to-right maxima, it is straightforward to check that w(j) = u(j)v(k) belongs to RG(s+j +σ(k), s+σ(k)) = RG(s+j +σ (j), s+ σ (j)). Hence it follows that ϕ(t) ∈ T 2 . Let a i be the number repeated entries in w(i) that occur beyond position s + i. Directly, we have a i = a i and we obtain that ϕ is an involution. Finally, we have (−1) σ = −(−1) σ implying ϕ is a sign-reversing involution. Finally, it is direct to see that wt(w(j))·wt(w(k)) = wt(w(j) )·wt(w(k) ) using the observation that u(j) and u(k) have the same number of left-to-right maxima. Hence the map ϕ is a sign-reversing involution on T 2 which preserves the weight wt(w(0)) · · · wt(w(n)). Thus the determinant is given by equation (8.1).

A pair of identities of Carlitz
In this section we turn our attention to two identities of Carlitz. Observe that setting q = 1 in Theorems 9.2 and 9.3 in this section does not yield any information about the Stirling number S(n, k) of the second kind.
We first prove a theorem from which Carlitz's Theorem 9.2 will follow.
Theorem 9.1. For two non-negative integers n and k not both equal to 0, the following identity holds: Proof. For a word u = u 1 u 2 · · · u n in RG(n, k) let NLRM(u) be the set of all positions r such that the letter u r is not a left-to-right-maxima of the word u, that is, u r max(u 1 , u 2 , . . . , u r−1 ). Furthermore, for a position r ∈ N LRM (u) define the bound b(r) to be max(u 1 , u 2 , . . . , u r−1 ). Note that b(r) is the largest possible value we could change u r to be so that the resulting word remains an RG-word in RG(n, k).
To describe the left-hand side of (9.1), consider the set of pairs (u, P ) where u ∈ RG(n, k) and P ⊆ NLRM(u). Define the weight of such a pair (u, P ) to be (−q) |P | · wt(u). It is clear that the sum of the weight over all such pairs (u, P ) is given by the left-hand side of (9.1).
Define a sign-reversing involution as follows. For the pair (u, P ) pick the smallest position r in NLRM(u) such that either r ∈ P and u r b(r) − 1 or r ∈ P and 2 u r . In the first case, send P to P − {r} and replace the rth letter u r with u r + 1. In the second case, send P to P ∪ {r} and replace the rth letter u r with u r − 1. This is a sign-reversing involution which pairs terms having the same weight, but opposite signs. Furthermore, the remaining pairs (u, P ) satisfy for all positions r ∈ NLRM(u) either r ∈ P and u r = b(r) or r ∈ P and u r = 1.
We now sum the weight of these remaining pairs (u, P ). First select the cardinality j of the set P . Note that 0 j n − k and that it yields a factor of (−q) j . Second, select the positions r of the non-left-right-maxima such that r will not be in the set P and u r = 1. There will be n − k − j such positions and they can be anywhere in the interval [2, n], yielding n−1 n−k−j possibilities. Third, select a weakly increasing word z of length j with letters from the set [k]. This will be the letters corresponding to the non-left-to-right-maxima such that their positions belong to set P . The ls-weight of these letters will be the q-binomial coefficient j+k−1 j q . Fourth, insert into the word z the letters of the left-to-right-maxima. There is a unique way to do this insertion. Finally, insert the electronic journal of combinatorics 25(1) (2018), #P1.37 the 1's corresponding to positions not in the set P , which were already been chosen by the binomial coefficient.
Note that the above proof fails when n = k = 0 since we are using that a non-empty RG-word must begin with the letter 1, whereas the empty RG-word does not.
The next identity is due to Carlitz [3, equation (9)]. It was stated by Gould [15, equation (3.10)]. As a warning to the reader, Gould's notation S 2 (n, k) for the q-Stirling number of the second kind is related to ours by S 2 (n, k) = S q [n + k, n]. This identity also appears in the paper of de Médicis, Stanton and White [9, equation (3.3)] using modern notation.
Theorem 9.2 (Carlitz, 1933). For two non-negative integers n and k the following identity holds: Proof. When n = k = 0 the statement is direct. It is enough to show that the right-hand sides of equations (9.1) and (9.2) agree. We have Here we used the Pascal recursion for the q-binomial coefficients in the first step, shifted j to j + 1 in the second sum in the third step, and applied the Pascal recursion for the binomial coefficients in the last step.
The next identity is also due to Carlitz; see [3, equation (8)]. It is equivalent to the previous identity, but we provide a proof using RG-words. Theorem 9.3 (Carlitz, 1933). For n and k two non-negative integers the following identity holds: the electronic journal of combinatorics 25(1) (2018), #P1.37 Proof. The right-hand side describes the following collection of triplets (A, u, P ) where A is a subset of the set [n], u is a word in RG(|A|, k) and P is a subset of NLRM(u). Define the weight of the triple (A, u, P ) to be the product (−1) j−k−|P | · q |P | · wt(u). To better visualize the pair (A, u), define the word w = w 1 w 2 · · · w n of length n with the letters in the set {0} ∪ [k] as follows. Write A as the increasing set {a 1 < a 2 < · · · < a j } and let w ar = u r . The remaining letters of w are set to be 0, that is, if i ∈ A let w i = 0. Note that the word w uniquely encodes the pair (A, u). Let Q be the set Q = {a r : r ∈ P }, that is, the set Q encodes the subset P , where these non-left-to-right-maxima occur in the longer word w. Similar to the proof of Theorem 9.1 we define a sign-reversing involution by selecting the smallest r ∈ NLRM(w) such that r ∈ Q and w r 2, or r ∈ Q and 1 w r b(r) − 1.
In the first case decrease w r by 1 and join r to the subset Q. In the second case, increase w r by 1 and remove r from Q. The remaining words w satisfy the following: for a non-leftto-right-maxima r such that w r 1 either r ∈ Q and w r = 1 both hold, or r ∈ Q and w r = b(r) hold.
On the remaining pairs (w, Q) define yet again a sign-reversing involution. Let i > a 1 be the smallest index i such that w i = 0, or w i = 1 and i ∈ Q. This involution replaces w i with 1 − w i . Note that this involution changes the sign.
The pairs (w, Q) which remain unmatched under this second involution are those where the word w is weakly increasing and the subset Q consists of all non-left-to-right-maxima r with w r 1. Note that the weight of the pair (w, Q) is the weight q |Q| · q r∈Q wr−1 = q r∈Q wr . Finally, the sum of the weights of these pairs is n k q .

An extension of Mercier's identities
We simultaneously generalize two identities of Mercier by introducing a two parameter identity involving q-Stirling numbers. The proof of this identity depends on a different decomposition of RG-words. Let ([n] q ) k denote the q-analogue of the lower factorial, that is, ([n] q ) k = [n] q !/[n−k] q !. Alternatively, one can expand it as the product Theorem 10.1. For three non-negative integers n, r and s such that s < r n the following holds: Proof. On the set of RG-words S = · r k n RG(n, k) define a weight function by Our objective is to evaluate the sum w∈S f (w), which is the left-hand side of (10.1). We do this in two steps. First we will partition the set S into blocks and extend the weight f the electronic journal of combinatorics 25(1) (2018), #P1.37 to a block B by f (B) = w∈B f (w). Secondly, on the set of blocks we will define a sign-reversing involution such that if two blocks B and C are matched, their f -weights cancel, that is, f (B) + f (C) = 0. Hence the right-hand side of (10.1) will be equal to the sum over all the blocks that have not been matched.
We now define an equivalence relation on the set S. The blocks of our partition will be the equivalence classes. For any integer k where r k n, we say two words u, v ∈ RG(n, k) are equivalent if there exists an index i such that s + 1 u i , v i k and u = x · u i · y, v = x · v i · y for some word x ∈ RG(i − 1, k) and y a word in [1, s] * . Note that when s = 0 that y is the empty word . If a word v ∈ RG(n, k) is of the form v = x · k · y for some x ∈ RG(i − 1, k − 1) and y ∈ [1, s] * , then this word is not equivalent to any other words and hence it belongs to a singleton block. Since for any RG-word we can find a decomposition described as above, this is a partition of the set RG(n, k) and hence the set S.
It is straightforward to check that C ⊆ RG(n, k −1) ⊆ S. Note that the weight wt(x·j ·y) factors as wt(x) · q j−1 · ls(y). Moreover, the f -weight of the block C satisfies Hence the weight of the two blocks B and C cancel each other. It remains to determine the weight of the unmatched blocks. Observe that every block of the form {x · j · y : s + 1 j k} where x ∈ RG(i, k) and y ∈ [1, s] * has been matched by the above construction. Hence the unmatched blocks are singleton blocks. Given a word u ∈ RG(n, k) ⊆ S, it has a unique factorization as u = x · j · y where y ∈ [1, s] * and s < j. If x is a word in RG(i, k) then the word u belongs to a block that has been matched. If x ∈ RG(i, k − 1) then m = k and the word u belongs to a singleton block which has been matched if k > r. Hence the unmatched blocks are of the form {x · r · y} where x ∈ RG(i, r − 1) and y ∈ [1, s] n−i−1 . The sum of their f -weights are which is the right-hand side of the desired identity. Setting (r, s) = (1, 0) and (r, s) = (2, 1) in Theorem 10.1 we obtain two special cases, both of which are due to Mercier [23,Theorem 2]. The second identity is a q-analogue of a result due to Jordan [ (Mercier, 1990). For n 2, the following two identities hold: Proof. The f -weights of the unmatched words u = x · r · y in the proof of Theorem 10.1 can be determined in a different manner. Since x ∈ RG(i, r − 1) we can factor x according to equation (2.4). Hence the unmatched word u has the form u = 1 · x 1 · 2 · x 2 · 3 · · · (r − 1) · x r−1 · r · y, where x i belongs to [1, i] * and y belongs to [1, r − 1] * . All possible words x i of length c i give total weight of [i] c i q for i r − 2. For the word x r−1 · r · y, suppose its length is c r−1 . Then we have c r−1 choices to place the letter r and the total weight of such words of the form x r−1 · y will be [r − 1] c r−1 −1 q . Hence the f -weight for unmatched words is given by equation (10.5).
Recall the Stirling numbers of the second kind are specializations of the homogeneous symmetric function; see equation (2.3). Thus one can view Theorem 10.1 from a symmetric function perspective. Proof. Let [t n ]f (t) denote the coefficient of t n in f (t). We consider the function and compute the coefficient of t n−r in two ways. Using the first expression of G r (t) and that

Concluding remarks
There are many extensions of q-Stirling numbers of the second kind. Remmel and Wachs [27] develop (p, q)-analogues of q-Stirling numbers of the first and second kinds, and give a colored restricted growth word interpretation of Hsu and Shiue's generalized Stirling numbers [16]. An earlier two-parameter (p, q)-Stirling number of the second kind by Wachs and White [34] include interpretations via rook placements and restricted growth functions. What identities arise in these settings? As an example, Briggs and Remmel [1] have a (p, q)-analogue of Garsia and Remmel's q-Frobenius formula (Theorem 7.1) via three statistics: number of descents, major index and comajor index. One can also be interested in other applications of restricted growth words. See the recent paper of Ehrenborg, Hedmark and Hettle for an application to partitions with block sizes of the same parity [11], as well as Steingrímsson's new statistics on ordered set partitions [30] and the related papers by Ishikawa, Kasraoui and Zeng [17,20].