# Matrix Ansatz, lattice paths and rook placements

S. Corteel¹, M. Josuat-Vergès¹†, T. Prellberg² and M. Rubey‡,³

¹LRI, CNRS and Université Paris-Sud, Bâtiment 490, 91405 Orsay, France

²School of Mathematical Sciences, Queen Mary, University of London, Mile End Road, London E1 4NS, United Kingdom

³Institut für Algebra, Zahlentheorie und Diskrete Mathematik, Leibniz Universität Hannover, Welfengarten 1, 30167 Hannover, Deutschland

**Abstract.** We give two combinatorial interpretations of the Matrix Ansatz of the PASEP in terms of lattice paths and rook placements. This gives two (mostly) combinatorial proofs of a new enumeration formula for the partition function of the PASEP. Besides other interpretations, this formula gives the generating function for permutations of a given size with respect to the number of ascents and occurrences of the pattern 13-2, the generating function according to weak exceedances and crossings, and the $n^{th}$ moment of certain $q$-Laguerre polynomials.

**Résumé.** Nous donnons deux interprétations combinatoires du Matrix Ansatz du PASEP en termes de chemins et de placements de tours. Cela donne deux preuves (presque) combinatoires d'une nouvelle formule pour la fonction de partition du PASEP. Cette formule donne aussi par exemple la fonction génératrice des permutations de taille donnée par rapport au nombre de montées et d'occurrences du motif 13-2, la fonction génératrice par rapport au nombre d'éxcédences faibles et de croisements, et le $n^{ième}$ moment de certains polynômes de $q$-Laguerre.

**Keywords:** Enumeration, Permutation tableaux, Rook placements, Lattice paths

## 1 Introduction

In recent work of Postnikov [17], permutations were given a new description as pattern-avoiding fillings of Young diagrams. More precisely, Postnikov made a correspondence between positive Grassmann cells, pattern-avoiding fillings called **J**-diagrams, and decorated permutations (which are permutations where the fixed points are bi-coloured). In particular, the usual permutations are in bijection with permutation tableaux, a subclass of **J**-diagrams. Permutation tableaux have subsequently been studied by Steingrimsson, Williams, Burstein, Corteel, Nadeau [4, 7, 8, 20], and proved to be very useful for working on permutations.

<footnote>†Partially supported by an Erwin Schrödinger fellowship and the ANR Jeune Chercheur IComb</footnote>

<footnote>‡M. Rubey acknowledges partial support by the Austrian FWF-National Research Network Analytic Combinatorics and Probabilistic Number Theory, project S9607.</footnote>
Corteel and Williams established a link between permutation tableaux and the stationary distribution of a classical process studied in statistical physics, the Partially Asymmetric Exclusion Process (PASEP). This process is described in [8, 9]. Briefly, the stationary probability of a given state in the process is proportional to the sum of weights of permutation tableaux of a given shape. The factor behind this proportionality is the partition function, which is the sum of weights of permutation tableaux of a given half-perimeter.

An alternative way of finding the stationary distribution of the PASEP is given by the Matrix Ansatz [9]. Suppose that we have operators $D$ and $E$, a row vector $\langle W|$ and a column vector $|V\rangle$ such that:

$$DE - qED = D + E, \quad \langle W|E = \langle W|, \quad D|V\rangle = |V\rangle, \quad \text{and} \quad \langle W||V\rangle = 1. \quad (1)$$

Then, coding any state of the process by a word $w$ of length $n$ in $D$ and $E$, the probability of the state $w$ is given by $\langle W|w|V\rangle$ normalised by the partition function $\langle W|(D + E)^n|V\rangle$.

We briefly describe how the Matrix Ansatz is related to permutation tableaux [8]. First, notice that there are unique polynomials $n_{i,j} \in \mathbb{Z}[q]$ such that

$$(D + E)^n = \sum_{i,j \ge 0} n_{i,j} E^i D^j$$

This sum is called the normal form of $(D+E)^n$. It is useful since, for example, the sum of coefficients $n_{i,j}$ gives an evaluation of $\langle W|(D + E)^n|V\rangle$. Each coefficient $n_{i,j}$ is a generating function for permutation tableaux satisfying certain conditions, or equivalently, alternative tableaux as defined by Viennot [27].

We give here two combinatorial interpretations of the Matrix Ansatz in terms in lattice paths and rook placements, and get two semi-combinatorial proofs of the following theorem:

**Theorem 1** For any $n > 0$, we have:

$$\langle W | (yD + E)^{n-1} | V \rangle = \frac{1}{y(1-q)^n} \sum_{k=0}^{n} (-1)^k \left( \sum_{j=0}^{n-k} y^j \left( \binom{n}{j} \binom{n}{j+k} - \binom{n}{j-1} \binom{n}{j+k+1} \right) \right) \left( \sum_{i=0}^{k} y^i q^{i(k+1-i)} \right).$$

The combinatorial interpretation of this polynomial, in terms of permutations, is given in Proposition 1. For $y = 1$ this specialises to:

**Corollary 1** For any $n > 0$, we have:

$$\langle W | (D + E)^{n-1} | V \rangle = \frac{1}{(1-q)^n} \sum_{k=0}^{n} (-1)^k \left( \binom{2n}{n-k} - \binom{2n}{n-k-2} \right) \left( \sum_{i=0}^{k} q^{i(k+1-i)} \right).$$

Besides the references mentioned earlier, we have to point out an article of Williams [29], where we find the following formula for the coefficient of $y^{m-1}$ in $\langle W | (yD + E)^n | V \rangle$:

$$E_{m,n}(q) = \sum_{i=0}^{m-1} (-1)^i [m-i]_q^n q^{mi-m^2} \left( \binom{n}{i} q^{m-i} + \binom{n}{i-1} \right). \quad (2)$$

It was obtained by enumerating $\mathbb{J}$-diagrams of a given shape and then computing the sum of all possible shapes. Until now it was the only known polynomial formula for the distribution of a permutation pattern
of length greater than two (See Proposition 1). Although the article [29] focuses on $\mathbb{J}$-diagrams, Williams and her coauthors sketched in Section 4 of [16] how this could have been done directly on permutation tableaux. Recently, Williams's formula has been obtained also by Kasraoui, Stanton and Zeng in their work on orthogonal polynomials [12]. We will show in the last section how our formula can be applied to prove and extend a conjecture presented in [29].

The polynomial $y\langle W | (yD + E)^{n-1} | V \rangle$ was already heavily studied.

**Proposition 1** For any $n \ge 1$ the following polynomials are equal:

* $y\langle W | (yD + E)^{n-1} | V \rangle$,

* the generating function for permutation tableaux of size $n$, the number of lines counted by $y$ and the number of superfluous 1's counted by $q$ [8, 28],

* the generating function for permutations of size $n$, the number of ascents counted by $y$ and the number of 13-2 patterns counted by $q$ [7, 20],

* the generating function for permutations of size $n$, the number of weak exceedances counted by $y$ and the number of crossings counted by $q$ [6, 20],

* the generating function of PDSAWs (partially directed self-avoiding walks) in the asymmetric wedge of length $n$ where the number of descents is counted by $y$ and the number of north steps is counted by $q$ [23],

* the $n^{th}$ moment of the Al-Salam-Chihara $q$-Laguerre polynomials [12, 23].

**Remark.** We can view the formula in Corollary 1 as an analog of the Touchard-Riordan formula [24] for the number of matchings of $2n$ according to the number of crossings:

$$ \sum_{M \text{ matching of } 2n} q^{\text{cr}(M)} = \frac{1}{(1-q)^n} \sum_{k=0}^{n} (-1)^k \left( \binom{2n}{n-k} - \binom{2n}{n-k-1} \right) q^{\frac{k(k+1)}{2}} $$

We remark that this formula also gives the $2n^{th}$ moment of the $q$-Hermite polynomials.

In [22], Penaud gave a combinatorial proof of this formula. By generalising Penaud's method we conjectured Theorem 1 and were hoping for a completely combinatorial proof thereof. However, at the time of writing the last step of this combinatorial proof is still missing.

This article is organised as follows: we first show how the Matrix Ansatz is naturally related to lattice paths. Then we give two proofs of our main Theorem, one based on lattice paths and the other one based on rook placements. We end with a discussion and some applications.

# 2 A first proof using lattice paths and functional equations

## 2.1 The Matrix Ansatz and lattice paths

We follow the ideas developed in [2, 3]. Looking for a solution of the system defined in Equation (1) we find:
**Proposition 2** Let $D = (D_{i,j})_{i,j \ge 0}$ and $E = (E_{i,j})_{i,j \ge 0}$ such that

$$D_{i,j} = \begin{cases} 1 + \dots + q^i & \text{if } i \text{ equals } j-1 \text{ or } j, \\ 0 & \text{otherwise,} \end{cases}$$

$$E_{i,j} = \begin{cases} 1 + \dots + q^i & \text{if } i \text{ equals } j \text{ or } j+1, \\ 0 & \text{otherwise,} \end{cases}$$

$$\langle W | = (1, 0, 0, \dots), \text{ and}$$

$$|V\rangle = (1, 0, 0, \dots)^T.$$

Then these matrices and vectors satisfy the Ansatz of Equation (1).

We can interpret $y\langle W | (yD + E)^{n-1} | V \rangle$ as the generating polynomial of paths of length $n-1$. The weight of a path is the product of the weight of its steps and the weight of the starting and ending points. If a path starts (resp. ends) at $(0, i)$ (resp. $(n-1, i)$) the weight of the starting (resp. ending) point is $W_i$ (resp. $V_i$). The weight of a step going from $(x, i)$ to $(x+1, j)$ is $D_{i,j} + E_{i,j}$. We call $i$ the starting height of the step. See [2, 3] for details.

Proposition 2 implies that the paths we are dealing with here are bi-coloured Motzkin paths, i.e., paths that start and end at height zero and consist of north-east, south-east and two types of east steps. Using a classical bijection we can transform these paths of length $n-1$ into Motzkin paths of length $n$ where east steps of type 2 can not appear at height zero.

**Proposition 3** $y\langle W | (yD + E)^{n-1} | V \rangle$ is the generating polynomial of weighted bi-coloured Motzkin paths of length $n$ such that the weight of steps starting at height $i$ is

* $y + yq + \dots + yq^i = y \frac{1-q^{i+1}}{1-q}$ for north-east steps and east steps of type 1, and

* $1 + q + \dots + q^{i-1} = \frac{1-q^i}{1-q}$ for south-east steps and east steps of type 2.

This can also be done combining results in [6, 8, 20].

## 2.2 The proof

The method used in this subsection is inspired by an article of Penaud [22]. We extract a factor of $(1-q)^n$ from the generating polynomial of the weighted bi-coloured Motzkin paths from Proposition 3 and obtain that

$$y\langle W | (yD + E)^{n-1} | V \rangle = \frac{1}{(1-q)^n} \sum_{p \in P(n)} w(p),$$

where $P(n)$ is the set of labelled bi-coloured Motzkin paths of length $n$ such that the weight of steps starting at height $i$ is either

* $y$ or $-yq^{i+1}$ for north-east steps or east steps of type 1,

* $1$ or $-q^i$ for south-east steps or east steps of type 2,

and $w(p)$ is the total weight of the path.

Let $M(n)$ be the subset of the paths in $P(n)$ such that the weight of any east step and the weight of any peak (a north-east step followed by a south-east step) is neither 1 nor $y$. Let $M_{n,k,j}$ be the number of left
factors of bi-coloured Motzkin paths of length $n$, final height $k$, and with $j$ south-east and east steps of type 1.

**Lemma 1** There is a bijection between paths in $P(n)$ and pairs of paths such that for some $k \in \{0, \dots, n\}$

* the first path is a left factor of a bi-coloured Motzkin path of length $n$ and final height $k$,

* the second path is in $M(k)$.

In particular, we have

$$ \sum_{p \in P(n)} w(p) = \sum_{k=0}^{n} \sum_{j=0}^{n-k} \mathcal{M}_{n,k,j} y^j \sum_{p \in M(k)} w(p). $$

**Proof:** Let $p$ be a path in $P(n)$. We decompose $p$ into a sequence $m_1q_1m_2q_2\dots m_kq_km_{k+1}$ such that

* the $m_i$ are maximal (but possibly empty) sub-paths of $p$ with all steps having weight 1 or $y$, and returning to their starting height,

* the $q_i$ are single steps.

It follows that $q_1q_2\dots q_k$ is a path in $M(k)$. Replacing in the sequence $m_1q_1m_2q_2\dots m_kq_km_{k+1}$ each step $q_i$ by a north-east step, and taking into account the number of south-east steps and east steps of type 1, we obtain a path in $\mathcal{M}_{n,k,j}$ of weight $y^j$. $\square$

It remains to compute $\mathcal{M}_{n,k,j}$ and $M_k = \sum_{p \in M(k)} w(p)$.

**Proposition 4** The number $\mathcal{M}_{n,k,j}$ of left factors of bi-coloured Motzkin paths of length $n$, final height $k$, and with $j$ south-east steps and east steps of type 1, is $\binom{n}{j}\binom{n}{j+k} - \binom{n}{j-1}\binom{n}{j+k+1}$.

**Proof:** We note that the formula can be seen as a $2 \times 2$ determinant. By the Lindström-Gessel-Viennot lemma, this equals the number of pairs of non-intersecting lattice paths taking north and east steps from $(1,0)$ to $(n-j, j)$ and $(0,1)$ to $(n-j-k, j+k)$ respectively.

We transform such a pair of paths step by step into a single Motzkin path according to the following translation table:

<table><thead><tr><th>$i^{\text{th}}$ step of</th><th>lower path</th><th>upper path</th><th>Motzkin path</th></tr></thead><tbody><tr><td></td><td>north</td><td>north</td><td>east type 1</td></tr><tr><td></td><td>east</td><td>east</td><td>east type 2</td></tr><tr><td></td><td>north</td><td>east</td><td>north-east</td></tr><tr><td></td><td>east</td><td>north</td><td>south-east.</td></tr></tbody></table>

It is easy to see that the condition that the two lattice paths do not intersect corresponds to the condition that the Motzkin path does not run below the x-axis. Furthermore, we see that the number of east and south-east steps equals $j$, the number of north steps of the lower path. $\square$

**Proposition 5** The generating polynomial $M_k$ equals $\sum_{i=0}^{k} y^i q^{i(k+1-i)}$.

**Proof:** We add an extra parameter on the paths in $M(n)$, that marks the number of steps that have a weight different from 1 and $y$. More precisely, the weight of steps starting at height $i$ is
• $y$ or $-yzq^{i+1}$ for north-east steps or east steps of type 1, and

• 1 or $-zq^i$ for south-east steps or east steps of type 2.

Let $M(z) = \sum_{n \ge 0} t^n \sum_{p \in M(n)} w(p)$. We can obtain a functional equation for $M(z)$ by considering the following decomposition: A path is either (a) empty, (b) a north-east step of weight 1, followed by a path, followed by a south east step of weight $-qyz$, followed by another path, (c) a north-east step of weight $-qz$, followed by a path, followed by a south east step of weight $-qyz$, followed by another path, (d) a north-east step of weight $-qz$, followed by a path, followed by a south east step of weight $y$, followed by another path, (e) a north-east step of weight 1, followed by a non-empty path, followed by a south east step of weight $y$, followed by another path, (f) an east step of type 1 followed by another path, or (g) an east step of type 2 followed by a path. The corresponding weight is (a) 1, (b) $-M(qz)qyzM(z)t^2$, (c) $qzM(qz)qyzM(z)t^2$, (d) $-qzM(qz)yM(z)t^2$, (e) $(M(qz) - 1)yM(z)t^2$, (f) $-qyzM(z)t$, or (g) $-zM(z)t$, respectively. Thus, we have:

$$M(z) = 1 - (qyzt + zt + yt^2)M(z) + yt^2(1 - qz)^2 M(z)M(qz).$$

Proceeding similar to [18], we use the linearising Ansatz

$$M(z) = \frac{1}{1-z} \frac{H(qz)}{H(z)}$$

to obtain

$$H(z) - (1 + yt^2)H(qz) + yt^2H(q^2z) = z(H(z) + (1 + qy)tH(qz) + qyt^2H(q^2z)).$$

Solving recursively for the coefficients $c_n$ of $H(z) = \sum_{n=0}^{\infty} c_n z^n$, we obtain a solution in terms of a basic hypergeometric series,

$$H(z) = {}_2\phi_1(-t, -tqy; t^2qy; q, z) = \sum_{n=0}^{\infty} \frac{(-t, -tqy; q)_n}{(t^2qy, q; q)_n} z^n.$$

Note that we are dealing with a series of the type ${}_2\phi_1(a, b; ab; q, z)$ where $a = -t$ and $b = -tqy$. In order to take the limit $z \to 1$, we need to transform using Heine's transformation

$${}_2\phi_1(a, b, ab; q, z) = \frac{(az, b; q)_{\infty}}{(ab, z; q)_{\infty}} {}_2\phi_1(a, z; az; q, b).$$

We find that

$$M(z) = \frac{1}{1 - az} \frac{{}_2\phi_1(a, qz; aqz; q, b)}{{}_2\phi_1(a, z, az; q, b)}$$

and therefore

$$M(1) = \frac{1}{1-a} {}_2\phi_1(a, q; aq; q, b) = \sum_{n=0}^{\infty} \frac{b^n}{1 - aq^n}.$$

Changing back to $a = -t$ and $b = -tqy$,

$$M_k = (-1)^k [t^k] M(1) = \sum_{m+n=k} y^n q^{n(m+1)} = \sum_{i=0}^{k} y^i q^{i(k-i+1)}.$$

Combining the previous results, we get a proof of Theorem 1.

□
## 3 A second proof using the Matrix Ansatz and rook placements

For further details about material in this section, see [11]. One of the ideas at the origin of this proof is the following. From $D$ and $E$ of the Matrix Ansatz, we define new operators $\hat{D}$ and $\hat{E}$ as

$$ \hat{D} = \frac{q-1}{q} D + \frac{1}{q}, \qquad \hat{E} = \frac{q-1}{q} E + \frac{1}{q}. $$

An immediate consequence is that

$$ \hat{D}\hat{E} - q\hat{E}\hat{D} = \frac{1-q}{q^2}, \qquad \langle W | \hat{E} = \langle W |, \quad \text{and} \quad \hat{D}|V\rangle = |V\rangle. \qquad (3) $$

This commutation relation is somewhat simpler than the one satisfied by $D$ and $E$, as it has no terms linear in $\hat{D}$ or $\hat{E}$. Moreover, we have $q(y\hat{D} + \hat{E}) + (1-q)(yD + E) = 1+y$, for any parameter $y$. Using this identity, we obtain the following inversion formulae between $(yD + E)^n$ and $(y\hat{D} + \hat{E})^n$:

$$ (1-q)^n (yD + E)^n = \sum_{k=0}^{n} \binom{n}{k} (1+y)^{n-k} (-1)^k q^k (y\hat{D} + \hat{E})^k, \quad \text{and} \qquad (4) $$

$$ q^n (y\hat{D} + \hat{E})^n = \sum_{k=0}^{n} \binom{n}{k} (1+y)^{n-k} (-1)^k (1-q)^k (D+E)^k. \qquad (5) $$

In particular, the first formula means that in order to compute the coefficients of the normal form of $(yD + E)^n$, it is sufficient to compute the ones of $(y\hat{D} + \hat{E})^k$ for all $0 \le k \le n$ (as taking the normal form is a linear operation).

Except for a factor $-q$, the operators $\hat{D}$ and $\hat{E}$ are also defined in [25] and [1]. In the first reference, Uchiyama, Sasamoto and Wadati used the commutation relation between $\hat{D}$ and $\hat{E}$ to find explicit matrices for these operators. They derive the eigenvalues and eigenvectors of $\hat{D} + \hat{E}$, and consequently the ones of $D + E$, in terms of orthogonal polynomials. In the second reference, Blythe, Evans, Colaiori and Essler also use these eigenvalues and obtain an integral form for $\langle W | (D + E)^n | V \rangle$. They also provide an exact integral-free formula of this quantity, somewhat complicated since it contains three summations and several $q$-binomial coefficients, but more general since it contains two other parameters.

In this article, instead of working on representations of $\hat{D}$ and $\hat{E}$ and their eigenvalues, we study the combinatorics of the rewriting in the normal form of $(\hat{D} + \hat{E})^n$, and more generally $(y\hat{D} + \hat{E})^n$ for some parameter $y$. In the case of $\hat{D}$ and $\hat{E}$, the objects that appear are the rook placements in Young diagrams, long-known by combinatorists since the results of Kaplansky, Riordan, Goldman, Foata and Schützenberger (see [19] and references therein). This method is described in [26], and is the same that the one leading to permutation tableaux or alternative tableaux in the case of $D$ and $E$.

**Definition 1** Let $\lambda$ be a Young diagram. A rook placement of shape $\lambda$ is a partial filling of the cells of $\lambda$ with rooks (denoted by a circle $\circ$), such that there is at most one rook per row (resp. per column).

For convenience, we distinguish with a cross (×) each cell of the Young diagram that is not below (in the same column) or to the left (in the same row) of a rook (we are using the French convention). The number of crosses is an important statistic on rook placements, which was introduced in [10] as a generalisation of the inversion number for permutations. Indeed, if $\lambda$ is a square of side length $n$, a rook placement $R$ with $n$ rooks may be visualised as the graph of a permutation $\sigma \in \mathfrak{S}_n$, and in this interpretation the number of crosses in $R$ is the inversion number of $\sigma$.
**Definition 2** The weight of a rook placement $R$ with $r$ rooks, $s$ crosses and $t$ columns is $w(R) = p^r q^s y^t$, where $p = \frac{1-q}{q^2}$.

With the definition of rook placements and their weights we can give the combinatorial interpretation of $\langle W | (y\hat{D} + \hat{E})^n | V \rangle$. This is similar to the $q$-Wick theorem given in [14], and our rook placements are equivalent to the Feynman diagram of this reference.

**Proposition 6** For any $n$, $\langle W | (y\hat{D} + \hat{E})^n | V \rangle$ is equal to the sum of weights of all rook placements of half-perimeter $n$.

The enumeration of rook placements leads to an evaluation of $\langle W | (y\hat{D}+\hat{E})^{n-1} | V \rangle$, hence of $\langle W | (yD+\hat{E})^{n-1} | V \rangle$ via the inversion formula (4).

## 3.1 Rook placements and involutions

Given a rook placement $R$ of half-perimeter $n$, we define an involution $\alpha(R)$ by the following construction: label the north-east boundary of $R$ with integers from 1 to $n$. This implies that each column or row has a label between 1 and $n$. If a column, or row, is labelled by $i$ and does not contain a rook, it is a fixed point of $\alpha(R)$. Also, if there is a rook at the intersection of column $i$ and row $j$, then $\alpha(R)$ sends $i$ to $j$ (and $j$ to $i$).

Given a rook placement $R$ of half-perimeter $n$, we also define a Young diagram $\beta(R)$ by the following construction: if we remove all rows and columns of $R$ containing a rook, the remaining cells form a Young diagram, which we denote by $\beta(R)$. We also define $\phi(R) = (\alpha(R), \beta(R))$. See Figure 1 for an example.

<figure><img src="image_1.png" /><figcaption>**Fig. 1:** Example of a rook placement and its image by the map $\phi$.</figcaption></figure>

**Proposition 7** The map $\phi$ is a bijection between rooks placements in Young diagrams of half-perimeter $n$, and ordered pairs $(I, \lambda)$ where $I$ is an involution on $\{1, \dots, n\}$ and $\lambda$ a Young diagram of half-perimeter $|Fix(I)|$. If $\phi(R) = (I, \lambda)$, the number of crosses in $R$ is the sum of $|\lambda|$ and some parameter $\mu(I)$.

**Proof:** This kind of bijection rather classical, see for instance [4, 13]. Note that the pairs $(I, \lambda)$ may be seen as involutions on $\{1, \dots, n\}$ with a weight 2 on each fixed point. For the second part of the proposition, we just have to distinguish different kinds of crosses in the rook placement $R$. For example, the crosses with no rook in the same line and column are enumerated by $|\lambda|$. $\square$

**Corollary 2** Let $T_{j,k,n}$ be the sum of weights of rook placements of half perimeter $n$, with $k$ lines and $j$ lines without rooks. Then for any $j,k,n$, we have:

$$ T_{j,k,n} = \begin{bmatrix} n-2k+2j \\ j \end{bmatrix}_q y^j T_{0,k-j,n}. \qquad (6) $$

**Proof:** The previous proposition means that the number of crosses is an additive parameter with respect to the decomposition $R \mapsto (I, \lambda)$. This naturally lead to a factorisation of the generating function. $\square$
## 3.2 The recurrence

**Proposition 8** We have the following recurrence relation:

$$T_{0,k,n} = T_{0,k,n-1} + py[n+1-2k]_q T_{0,k-1,n-1}. \quad (7)$$

**Proof:** We have the relation $T_{0,k,n} = T_{0,k,n-1} + pT_{1,k,n-1}$. Indeed, we can distinguish two cases, whether a rook placement enumerated by $T_{0,k,n}$ has a rook in its first column or not. These two cases give respectively the two terms of the previous identity. To end the proof we can apply identity (6) to the second term. □

The recurrence (7) is solved by the following formula.

**Proposition 9**

$$T_{0,k,n} = q^{-2k} \sum_{i=0}^{k} (-1)^i q^{\frac{i(i+1)}{2}} \begin{bmatrix} n-2k+i \\ i \end{bmatrix}_q \left( \begin{pmatrix} n \\ k-i \end{pmatrix} - \begin{pmatrix} n \\ k-i-1 \end{pmatrix} \right). \quad (8)$$

It is worth noticing that we can get the Touchard-Riordan formula as a special case when $n$ is even and $k = \frac{n}{2}$. Actually there is also a bijective proof of (8), which generalizes Penaud's bijective proof of the Touchard-Riordan formula [22].

From this proposition, identity (6), and a $q$-binomial identity, we derive a formula for $T_{j,k,n}$.

**Proposition 10**

$$\sum_{j=0}^{k} T_{j,k,n} = \sum_{j=0}^{k} \binom{n}{j} - \binom{n}{j-1} \left( \frac{q^{\frac{(k+1-j)(n-k-j)}{2}} - q^{\frac{(k-j)(n-k-j)}{2}} + q^{\frac{(k-j)(n+1-k-j)}{2}} - q^{\frac{(k+1-j)(n+1-k-j)}{2}}}{(1-q)q^n} \right).$$

Summing this identity over $k$ gives the following result.

**Proposition 11**

$$\langle W | (y\hat{D} + \hat{E}) | V \rangle = (1+y)G(n) - G(n+1), \quad (9)$$

$$\text{where } G(n) = \sum_{j=0}^{\lfloor \frac{n}{2} \rfloor} \binom{n}{j} - \binom{n}{j-1} \sum_{i=0}^{n-2j} y^{i+j-1} q^{i(n+1-2j-i)}.$$

This formula is a linear combination of the polynomials $P_k = \sum_{i=0}^{k} y^i q^{i(k+1-i)}$, the coefficients being polynomials in $y$, just as in Theorem 1. With this result and the inversion formula (4), we can prove Theorem 1: the last step is an elementary binomial simplification.

## 4 Applications

Among all the objects of the list in Proposition 1, the most studied are probably permutations and the pattern 13-2, see for example [5, 7, 20, 21, 15]. In particular, in [5, 21] we can find methods for obtaining, as a function of $n$ for a given $k$, the number of permutations of size $n$ with exactly $k$ occurrences of pattern 13-2. By taking the Taylor series of (1), we obtain direct and quick proofs for these results. As an illustration we give the formulae for $k \le 3$ in the following proposition.
**Proposition 12** The order 3 Taylor series of $\langle W|(D + E)^{n-1}|V \rangle$ is:

$$ \langle W|(D + E)^{n-1}|V \rangle = C_n + \binom{2n}{n-3}q + \frac{n}{2}\binom{2n}{n-4}q^2 + \frac{(n+1)(n+2)}{6}\binom{2n}{n-5}q^3 + O(q^4), $$

where $C_n$ is the nth Catalan number.

More generally, a computer algebra system can provide higher order terms, for example it takes no more than a few seconds to obtain the following closed formula for $[q^{10}]\langle W|(D + E)^{n-1}|V \rangle$:

$$ \frac{(2n)!}{10!(n+12)!(n-8)!} \left( \begin{aligned} & n^{13} + 70n^{12} + 2093n^{11} + 32354n^{10} + 228543n^9 - 318990n^8 \\ & -17493961n^7 - 104051458n^6 - 6828164n^5 + 2022876520n^4 \\ & +6310831968n^3 + 5832578304n^2 + 14397419520n + 5748019200 \end{aligned} \right), $$

which is quite an improvement compared to the methods of [21]. In addition to exact formula, we can give asymptotic estimates, for example for the number of permutations with a given number of occurrences of pattern 13-2.

**Theorem 2** For any fixed $m \ge 0$,

$$ [q^m] \langle W | (D + E)^{n-1} | V \rangle \sim \frac{4^n n^{m-\frac{3}{2}}}{\sqrt{\pi m!}} \quad \text{as } n \to \infty. $$

**Proof:** When $n \to \infty$, the numbers $\binom{2n}{n-k} - \binom{2n}{n-k-2}$ are dominated by the Catalan number $\frac{1}{n+1}\binom{2n}{n}$. This implies that in $(1-q)^n \langle W|(D+E)^{n-1}|V \rangle$, each higher order term grows at most as fast as the constant term $C_n$. On the other side, the coefficient of $q^m$ in $(1-q)^{-n}$ is asymptotically $n^m/m!$. $\square$

Since any occurrence of the pattern 13-2 in a permutation is also an occurrence of the pattern 1-3-2, a permutation with $k$ occurrences of the pattern 1-3-2 has at most $k$ occurrences of the pattern 13-2. So we get the following corollary. This could also be obtained with the methods of [15], which gives an algorithm to obtain the generating functions of permutations with a given number of occurrences of 1-3-2.

**Corollary 3** Let $\psi_k(n)$ be the number of permutations in $S_n$ with at most $k$ occurrences of the pattern 1-3-2. For any constant $C > 1$ and $k \ge 0$, we have

$$ \psi_k(n) \le C \frac{4^n n^{k-\frac{3}{2}}}{\sqrt{\pi k!}} $$

when $n$ is sufficiently large.

So far we have only used Corollary 1. Now we illustrate what can be done with the refined formula given in Theorem 1. For example, when $q = 0$ then the coefficient of $y^m$ is given by the expression $\sum_{k=0}^{n} (-1)^k \left( \binom{n}{m} \binom{n}{m+k} - \binom{n}{m-1} \binom{n}{m+k+1} \right)$. This is equal to the Narayana number $N(n, m) = \frac{1}{n} \binom{n}{m} \binom{n}{m-1}$ (see [29] for a combinatorial proof).

We can also get the coefficients for higher powers of $q$. For example it is conjectured in [29] that the coefficient of $qy^m$ in $\langle W|y(yD+E)^{n-1}|V \rangle$ is equal to $\binom{n}{m+1}\binom{n}{m-2}$. Applying our results we can prove:
**Proposition 13** The coefficients of $qq^m$ and $q^2y^m$ in $\langle W|y(yD + E)^{n-1}|V \rangle$ are respectively:

$$ \binom{n}{m+1} \binom{n}{m-2} \quad \text{and} \quad \binom{n+1}{m-2} \binom{n+1}{m+2} \frac{nm + m - m^2 - 4}{2(n+1)}. $$

**Proof:** A naive expansion of the Taylor series in $q$ gives a lengthy formula, which is simplified easily after noticing that it is the product of $\binom{n}{m}^2$ and a rational fraction of $n$ and $m$. $\square$

## Acknowledgements

The authors want to thank Lauren Williams for her interesting discussions and suggestions.

## References

[1] R. A. Blythe, M. R. Evans, F. Colaiori and F. H. L. Essler, Exact solution of a partially asymmetric exclusion model using a deformed oscillator algebra, J. Phys. A: Math. Gen. Vol. 33 (2000), 2313-2332.

[2] R. Brak, S. Corteel, J. Essam, R. Parviainen and A. Rechnitzer, A combinatorial derivation of the PASEP stationary state. Electron. J. Combin. 13 (2006), no. 1, 108, 23 pp.

[3] R. Brak, and J.W. Essam, Asymmetric exclusion model and weighted lattice paths. J. Phys. A 37 (2004), no. 14, 4183-4217.

[4] A. Burstein, On some properties of permutation tableaux, Ann. Combin. 11(3-4) (2007), 355-368.

[5] A. Claesson, T. Mansour, Counting Occurrences of a Pattern of Type (1,2) or (2,1) in Permutations, Adv. in App. Maths. 29 (2002), 293-310.

[6] S. Corteel, Crossings and alignments of permutations, Adv. in App. Maths. 38(2) (2007), 149-163.

[7] S. Corteel and P. Nadeau, Bijections for permutation tableaux, Eur. Jour. of Comb 30(1) (2009), 295-310.

[8] S. Corteel and L. K. Williams, Tableaux combinatorics for the asymmetric exclusion process, Adv. in App. Maths. 39(3) (2007), 293-310.

[9] B. Derrida, M. Evans, V. Hakim, V. Pasquier, Exact solution of a 1D asymmetric exclusion model using a matrix formulation, J. Phys. A: Math. Gen. 26 (1993), 1493-1517.

[10] A. Garsia and J. Remmel, q-Counting rook configurations and a formula of Frobenius. J. Combin. Theory, Ser. A 41 (1986), 246-275.

[11] M. Josuat-Vergès, Rook placements in Young diagrams and permutation enumeration, submitted (2008). arXiv:0811.0524

[12] A. Kasraoui, D. Stanton, J. Zeng, The combinatorics of Al-Salam-Chihara $q$-Laguerre polynomials, preprint (2008). arXiv:0810.3232v1.
[13] S. Kerov, Rooks on Ferrers Boards and Matrix Integrals, Zapiski. Nauchn. Semin. POMI, v.240 (1997), 136-146.

[14] T. Mansour, M. Schork, S. Severini, Wick's theorem for $q$-deformed boson operators, J. Phys. A: Math. Theor. Vol. 40 (2007), 8393-8401.

[15] T. Mansour, A. Vainshtein, Counting occurrences of 132 in a permutation, Adv. Appl. Math. 28(2) (2002), 185-195.

[16] J.C. Novelli, J-Y. Thibon and L.K. Williams, Combinatorial Hopf algebras, noncommutative Hall-Littlewood functions, and permutation tableaux, preprint (2008). arXiv:0804.0995

[17] A. Postnikov, Total positivity, Grassmannians, and networks, Preprint (2006). arxiv:math.CO/0609764.

[18] T. Prellberg and R. Brak, Critical Exponents from Non-Linear Functional Equations for Partially Directed Cluster Models, J. Stat. Phys., Vol. 78 (1995), 701-730.

[19] R. P. Stanley, Enumerative combinatorics Vol. 1, Cambridge university press (1986).

[20] E. Steingrímsson, L. K. Williams, Permutation tableaux and permutation patterns, J. Combin. Theory Ser. A, Vol. 114(2) (2007), 211-234.

[21] R. Parviainen, Lattice path enumeration of permutations with $k$ occurrences of the pattern 2-13, Journal of Integer Sequences, Vol. 9 (2006), Article 06.3.2.

[22] J.-G. Penaud, A bijective proof of a Touchard-Riordan formula, Disc. Math., Vol. 139 (1995), 347-360.

[23] M. Rubey, Nestings of Matchings and Permutations and North Steps in PDSAWs, FPSAC 2008 (2008). arXiv:0712.2804

[24] J. Touchard, Sur un problème de configurations et sur les fractions continues, Can. Jour. Math., Vol. 4 (1952), 2-25.

[25] M. Uchiyama, T. Sasamoto, M. Wadati, Asymmetric simple exclusion process with open boundaries and Askey-Wilson polynomials, J. Phys. A: Math. Gen. 37 (2004), 4985-5002.

[26] A. Varvak, Rook numbers and the normal ordering problem, J. Combin. Theory Ser. A, Vol. 112(2) (2005), 292-307.

[27] X.G. Viennot, Alternative tableaux and permutations, in preparation (2008).

[28] X.G. Viennot, Alternative tableaux and partially asymmetric exclusion process, in preparation (2008).

[29] L. K. Williams, Enumeration of totally positive Grassmann cells, Adv. Math., Vol. 190(2) (2005), 319-342.