1 Introduction

Let \(\mathfrak {S}_n\) be the set of permutations of \([n]:=\{1,\dots ,n\}\), and \(\mathfrak {S}_*:=\bigcup _{n\geqslant 1}\mathfrak {S}_n\). If \(\sigma =\sigma _1\cdots \sigma _m\in \mathfrak {S}_m\) and \(\pi =\pi _1\cdots \pi _n\in \mathfrak {S}_n\), then an occurrence of \(\sigma \) in \(\pi \) is a subsequence \(\pi _{i_1}\cdots \pi _{i_m}\), with \(1\leqslant i_1<\dots <i_m\leqslant n\), that has the same order as \(\sigma \), i.e., \(\pi _{i_j}<\pi _{i_k} \iff \sigma _j<\sigma _k\) for all \(j,k\in [m]\). We let \(n_\sigma (\pi )\) be the number of occurrences of \(\sigma \) in \(\pi \), and note that

$$\begin{aligned} \sum _{\sigma \in \mathfrak {S}_m} n_\sigma (\pi ) = \left( {\begin{array}{c}n\\ m\end{array}}\right) , \end{aligned}$$
(1.1)

for every \(\pi \in \mathfrak {S}_n\). For example, an inversion is an occurrence of \({21}\), and thus \(n_{21}(\pi )\) is the number of inversions in \(\pi \).

We say that \(\pi \)avoids another permutation \(\tau \) if \(n_\tau (\pi )=0\); otherwise, \(\pi \)contains\(\tau \). Let

$$\begin{aligned} \mathfrak {S}_n(\tau ):= \{\pi \in \mathfrak {S}_n:n_\tau (\pi )=0\}, \end{aligned}$$
(1.2)

the set of permutations of length n that avoid \(\tau \). More generally, for any set \(T=\{\tau _1,\dots ,\tau _k\}\) of permutations, let

$$\begin{aligned} \mathfrak {S}_n(T)=\mathfrak {S}_n(\tau _1,\dots ,\tau _k):=\bigcap _{i=1}^k\mathfrak {S}_n(\tau _i), \end{aligned}$$
(1.3)

the set of permutations of length n that avoid all \(\tau _i\in T\). We also let \(\mathfrak {S}_*(T):=\bigcup _{n=1}^\infty \mathfrak {S}_n(T)\) be the set of T-avoiding permutations of arbitrary length.

The classes \(\mathfrak {S}_*(\tau )\) and, more generally, \(\mathfrak {S}_*(T)\) have been studied for a long time, see e.g. Knuth [16, Exercise 2.2.1–5], Simion and Schmidt [20], Bóna [3]. In particular, one classical problem is to enumerate the sets \(\mathfrak {S}_n(\tau )\), either exactly or asymptotically, see Bóna [3, Chapters 4–5]. We note the fact that for any \(\tau \) with length \(|\tau |=3\), \(\mathfrak {S}_n(\tau )\) has the same size \( |\mathfrak {S}_n(\tau )|=C_n:=\frac{1}{n+1}\left( {\begin{array}{c}2n\\ n\end{array}}\right) \), the nth Catalan number, see e.g. [16, Exercises 2.2.1–4,5], [20, 21, Exercise 6.19ee,ff], [3, Corollary 4.7]; furthermore, the cases when T consists of several permutations of length 3 are all treated by Simion and Schmidt [20]. (The situation for \(|\tau |\geqslant 4\) is more complicated.)

The general problem that concerns us is to take a fixed set T of one or several permutations and let \(\varvec{\pi }_{{T};n}\) be a uniformly random T-avoiding permutation, i.e., a uniformly random element of \(\mathfrak {S}_n(T)\), and then study the distribution of the random variable \(n_\sigma (\varvec{\pi }_{{T};n})\) for some other fixed permutation \(\sigma \). (Only \(\sigma \) that are themselves T-avoiding are interesting, since otherwise \(n_\sigma (\varvec{\pi }_{{T};n})=0\).) One instance of this problem was studied already by Robertson, Wilf and Zeilberger [18], who gave a generating function for \(n_{123}(\varvec{\pi }_{{132};n})\). The exact distribution of \(n_\sigma (\varvec{\pi }_{{\tau };n})\) for a given n was studied numerically in [15], where higher moments and mixed moments are calculated for small n. We are mainly interested in asymptotics of the distribution of \(n_\sigma (\varvec{\pi }_{{T};n})\), and of its moments, as \({n\rightarrow \infty }\), for some fixed T and \(\sigma \).

In the present paper we study the cases when T is a set of two or more permutations of length 3. We consider 8 different cases separately; by symmetries, see Sect. 2.2, these cover all 30 non-trivial cases of such forbidden sets T. (See Sect. 2.5 for the trivial cases.) These 8 cases are included (together with a few others for reference) in Table 1.

The cases when \(T=\{\tau \}\) for a single permutation \(\tau \) of length \(|\tau |=3\) were studied in [12, 13] (by symmetries, only two such cases have to be considered), and the cases when T contains a permutation of length \(\leqslant 2\) are trivial (there is then at most one permutation in \(\mathfrak {S}_n(T)\) for any n); hence the present paper completes the study of forbidding one or several permutations of length \(\leqslant 3\). The case of forbidding one or several permutations of length \(\geqslant 4\) seems much more complicated, but there are recent impressive results in some cases by Bassino et al. [2] and Bassino et al. [1].

The expectation \({\mathbb {E}{}}n_\sigma (\varvec{\pi }_{{T};n})\), or equivalently, the total number of occurences of \(\sigma \) in all T-avoiding permutations, has previously been treated in a number of papers for various cases, beginning with Bóna [5, 7] (with \(\tau ={132}\)). In particular, Zhao [23] has given exact formulas when \(|\sigma |=3\) for the (non-trivial) cases treated in the present paper, where T consists of two or more permutations of length 3.

Table 1 The table shows whether \(n_\sigma (\varvec{\pi }_{{T};n})\) has limits of type I (normal) or II (non-normal); furthermore, the exponent \(\alpha =\alpha (\sigma )\) such that \({\mathbb {E}{}}n_\sigma (\varvec{\pi }_{{T};n})\) is of order \(n^\alpha \) is given in the column for the type. The last column shows the exceptional cases, if any, where the asymptotic variance vanishes. \(C_n:=\frac{1}{n+1}\left( {\begin{array}{c}2n\\ n\end{array}}\right) \) is a Catalan number; \(F_{n+1}\) is a Fibonacci number (\(F_0=0\), \(F_1=1\)); \(s_{n-1}\) is a Schröder number; \(D(\sigma )\) is the number of descents and \(B(\sigma )\) is the number of blocks in \(\sigma \)

The cases studied here (except some trivial, degenerate cases), all have asymptotic distributions of one of the following two types. We denote convergence in distribution by \(\overset{\mathrm {d}}{\longrightarrow }\) and convergence in probability by \(\overset{\mathrm {p}}{\longrightarrow }\).

I. Normal Limits. For the non-restricted case of uniformly random permutations in \(\mathfrak {S}_n\), it is well-known that if \(\varvec{\pi }_n\) is a uniformly random permutation in \(\mathfrak {S}_n\), then \(n_\sigma (\varvec{\pi }_n)\) has an asymptotic normal distribution as \({n\rightarrow \infty }\) for every fixed permutation \(\sigma \); more precisely, if \(|\sigma |=m\geqslant 2\) then, as \({n\rightarrow \infty }\),

$$\begin{aligned} \frac{n_\sigma (\varvec{\pi }_n)-\frac{1}{m!}\left( {\begin{array}{c}n\\ m\end{array}}\right) }{n^{m-1/2}}\overset{\mathrm {d}}{\longrightarrow }N\bigl (0,\gamma ^2\bigr ) \end{aligned}$$
(1.4)

for some \(\gamma ^2>0\) depending on \(\sigma \); see Bóna [4, 6] and Janson, Nakamura and Zeilberger [15, Theorem 4.1]. We obtain below similar asymptotic normal results in several cases (Sects. 4568); note that the asymptotic normality in particular implies concentration in these cases, in the sense

$$\begin{aligned} \frac{ n_\sigma (\varvec{\pi }_{{T};n})}{{\mathbb {E}{}}n_\sigma (\varvec{\pi }_{{T};n})}\overset{\mathrm {p}}{\longrightarrow }1. \end{aligned}$$
(1.5)

II. Non-normal Limits Without Concentration. On the other hand, in other cases (Sects. 379, 1011) we find a different type of limit, where

$$\begin{aligned} \frac{n_\sigma (\varvec{\pi }_{{T};n})}{n^{\alpha }}\overset{\mathrm {d}}{\longrightarrow }W_\sigma , \end{aligned}$$
(1.6)

for some non-trivial positive random variable \(W_\sigma \) (also depending on T). The same holds in the case \(T=\{2413,3142\}\) studied by Bassino, Bouvel, Féray, Gerin and Pierrot [2].

We summarize the results of the present paper, together with some older results from [2, 4, 6, 12, 13, 15], in Table 1; for reference, we include the number \(|\mathfrak {S}_n(T)|\) of T-avoiding permutations of length n, see e.g. [16, Exercises 2.2.1-4,5], [21, Exercise 6.19ee,ff], [3, Corollary 4.7], [20], and [22]. We see no obvious pattern in the occurence of the two types of limits; nor do we know whether these are the only possibilities for a general set T of forbidden permutations.

Remark 1.1

In the present paper we consider for simplicity often only univariate limits; corresponding multivariate results for several \(\sigma _1,\dots ,\sigma _k\) follow by the same methods. In particular, (1.4) and all instances of normal limit laws below extend to multivariate normal limits, with covariance matrices that can be computed explicitly.

Remark 1.2

In the present paper we study only the numbers \(n_\sigma \) of occurences of some pattern in \(\varvec{\pi }_{{\tau };n}\). There is also a number of papers by various authors that study other properties of random \(\tau \)-avoiding permutations, see e.g. the references in [13]; such results will not be considered here.

2 Preliminaries

2.1 Notation

Let \(\iota =\iota _n\) be the identity permutation of length n. Let \(\bar{\iota }_n=n\cdots 21\) be its reversal.

Let \(\pi =\pi _1\cdots \pi _n\) be a permutation. We say that a value \(\pi _i\) is a maximum if \(\pi _i>\pi _j\) for every \(j<i\), and a minimum if \(\pi _i<\pi _j\) for every \(j<i\). (These are sometimes called LR maximum and LR minimum.) Note that \(\pi _1\) always is both a maximum and a minimum.

By joint convergence in distribution for an infinite family of random variables (depending on n) we mean convergence in the product topology, i.e., joint convergence for every finite subset.

2.2 Symmetries

There are many cases treated in the present paper, but the number is considerably reduced by three natural symmetries (used by many previous authors). For any permutation \(\pi =\pi _1\cdots \pi _n\), define its inverse\(\pi ^{-1}\) in the usual way, and its reversal and complement by

$$\begin{aligned} \pi ^{\mathsf r}&:=\pi \circ \bar{\iota }=\pi _n\cdots \pi _1,\end{aligned}$$
(2.1)
$$\begin{aligned} \pi ^{\mathsf c}&:=\bar{\iota }\circ \pi =(n+1-\pi _1)\cdots (n+1-\pi _n). \end{aligned}$$
(2.2)

These three operations are all involutions, and they generate a group \(\mathfrak G\) of 8 symmetries (isomorphic to the dihedral group \(D_4\)). It is easy to see that, for any permutations \(\sigma \) and \(\pi \),

$$\begin{aligned} n_{\sigma ^{-1}}(\pi ^{-1})= n_{\sigma ^{\mathsf r}}(\pi ^{\mathsf r}) = n_{\sigma ^{\mathsf c}}(\pi ^{\mathsf c}) = n_{\sigma }(\pi ), \end{aligned}$$
(2.3)

and consequently, for any symmetry \({\mathsf s}\in \mathfrak G\),

$$\begin{aligned} n_{\sigma ^{\mathsf s}}(\pi ^{\mathsf s}) = n_{\sigma }(\pi ). \end{aligned}$$
(2.4)

For a set T of permutations we define \(T^{\mathsf s}:=\{\tau ^{\mathsf s}:\tau \in T\}\). It follows from (2.4) that

$$\begin{aligned} \mathfrak {S}_n(T^{\mathsf s})=\{\pi ^{\mathsf s}:\pi \in \mathfrak {S}_n(T)\}, \end{aligned}$$
(2.5)

and, furthermore, that for any permutation \(\sigma \),

$$\begin{aligned} n_{\sigma ^{\mathsf s}}(\varvec{\pi }_{{T^{\mathsf s}};n})\overset{\mathrm {d}}{=}n_\sigma (\varvec{\pi }_{{T};n}). \end{aligned}$$
(2.6)

We say that the sets of forbidden permutations T and \(T^{\mathsf s}\) are equivalent, and note that (2.6) implies that it suffices to consider one set T in each equivalence class \(\{T^{\mathsf s}:{\mathsf s}\in \mathfrak G\}\). We do this in the sequel without further comment. (We choose representatives T that we find convenient. One guide is that we choose T such that the identity permutation \(\iota _n\) avoids T.)

2.3 Compositions and Decompositions of Permutations

If \(\sigma \in \mathfrak {S}_m\) and \(\tau \in \mathfrak {S}_n\), their composition\(\sigma *\tau \in \mathfrak {S}_{m+n}\) (in the literature often denoted \(\sigma \oplus \tau \)) is defined by letting \(\tau \) act on \([m+1,m+n]\) in the natural way; more formally, \(\sigma *\tau =\pi \in \mathfrak {S}_{m+n}\) where \(\pi _i=\sigma _i\) for \(1\leqslant i\leqslant m\), and \(\pi _{j+m}=\tau _j+m\) for \(1\leqslant j\leqslant n\). It is easily seen that \(*\) is an associative operation that makes \(\mathfrak {S}_*\) into a semigroup (without unit, since we only consider permutations of length \(\geqslant 1\)). We say that a permutation \(\pi \in \mathfrak {S}_*\) is decomposable if \(\pi =\sigma *\tau \) for some \(\sigma ,\tau \in \mathfrak {S}_*\), and indecomposable otherwise; we also call an indecomposable permutation a block. Equivalently, \(\pi \in \mathfrak {S}_n\) is decomposable if and only if \(\pi :[m]\rightarrow [m]\) for some \(1\leqslant m<n\). See e.g. [8, Exercise VI.14].

It is easy to see that any permutation \(\pi \in \mathfrak {S}_*\) has a unique decomposition \(\pi =\pi _1*\dots *\pi _\ell \) into indecomposable permutations (blocks) \(\pi _1,\dots ,\pi _\ell \) (for some, unique, \(\ell \geqslant 1\)); we call these the blocks of\(\pi \).

We shall see that some (but not all) of the classes considered below can be characterized in terms of their blocks. (See [2] for another, more complicated, example.)

2.4 \(U\)-statistics

An (asymmetric) \(U\)-statisticis a random variable of the form

$$\begin{aligned} U_n = \sum _{1\leqslant i_1<\dots <i_d\leqslant n} f\bigl (X_{i_1},\dots ,X_{i_d}\bigr ), \qquad n\geqslant 0, \end{aligned}$$
(2.7)

where \(X_1,X_2,\dots \) is an i.i.d. sequence of random variables and f is a given function of \(d\geqslant 1\) variables. These were (in the symmetric case) introduced by Hoeffding [9]; see further e.g. [14] and the references there. We say that d is the order of the \(U\)-statistic.

We shall use the central limit theorem for \(U\)-statistics, originally due to Hoeffding [9], in the asymmetric version given in [10, Theorem 11.20] and [14, Corollary 3.5 and (moment convergence) Theorem 3.15]. Let, with X denoting a generic \(X_i\),

$$\begin{aligned} \mu&:={\mathbb {E}{}}f(X_1,\dots ,X_d), \end{aligned}$$
(2.8)
$$\begin{aligned} f_i(x)&:={\mathbb {E}{}}\bigl (f(X_1,\dots ,X_d)\mid X_i=x\bigr ), \end{aligned}$$
(2.9)
$$\begin{aligned} \beta _{ij}&:=\mathrm{Cov}\bigl (f_i(X),f_j(X)\bigr ), \end{aligned}$$
(2.10)
$$\begin{aligned} \beta ^2&:= \sum _{i,j=1}^d \frac{(i+j-2)!\,(2d-i-j)!}{(i-1)!\,(j-1)!\,(d-i)!\,(d-j)!\,(2d-1)!}\beta _{ij} . \end{aligned}$$
(2.11)

Note that \(f_i(x)\) in [14] is \(f_i(x)-\mu \) in the present notation.

Proposition 2.1

[10, 14] Suppose that \(f(X_1,\dots ,X_d)\in L^2\). Then, with the notation in (2.8)–(2.11), as \({n\rightarrow \infty }\),

$$\begin{aligned} \frac{U_n-\left( {\begin{array}{c}n\\ d\end{array}}\right) \mu }{n^{d-1/2}} \overset{\mathrm {d}}{\longrightarrow }N\bigl (0,\beta ^2\bigr ). \end{aligned}$$
(2.12)

Furthermore, \(\beta ^2>0\) unless \(f_i(X)=\mu \) a.s. for \(i=1,\dots ,d\).

Moreover, if \(f(X_1,\dots ,X_d)\in L^p\) for some \(p\geqslant 2\), the (2.12) holds with convergence of all moments of order \(\leqslant p\). \(\square \)

Example 2.2

A uniformly random permutation \(\varvec{\pi }_n\) of length n (without other restrictions) can be constructed as the relative order of \(X_1,\dots ,X_n\), where \(X_i\) are i.i.d. with, for example, a uniform distribution \(\mathsf U(0,1)\). For any given permutation \(\sigma \in \mathfrak {S}_m\), we can then write \(n_\sigma (\varvec{\pi }_n)\) as a \(U\)-statistic (2.7) for a suitable indicator function f. Then Proposition 2.1 yields a limit theorem showing that \(n_\sigma (\varvec{\pi }_n)\) is asymptotically normal. See [15] for details.

We shall also use a renewal theory version of Proposition 2.1. With the notations above, assume (for simplicity) that \(X_i\geqslant 0\). Define \(S_n:=\sum _{i=1}^nX_i\), and let for each \(x>0\)

$$\begin{aligned} N_{-}(x)&:=\sup \{n:S_n< x\}, \end{aligned}$$
(2.13)
$$\begin{aligned} N_{+}(x)&:=\inf \{n:S_n\geqslant x\}=N_{-}(x)+1. \end{aligned}$$
(2.14)

Remark 2.3

The definitions (2.13)–(2.14) differ slightly from the ones in [14], where instead \(S_n\leqslant x\) and \(S_n>x\) are used. This does not affect the asymptotic results used here. Note that the event \(\{S_k=n \text { for some }k\geqslant 0\}\) equals \(\{S_{N_{+}(n)}=n\}\) in the present notation.

The following results are special cases of [14, Theorems 3.11, 3.13(iii) and 3.18] (with somewhat different notation). \(N_{\pm }(x)\) means either \(N_{-}(x)\) or \(N_{+}(x)\); the results holds for both.

Proposition 2.4

[14] Suppose that \(f(X_1,\dots ,X_d)\in L^2\), \(X\in L^2\), \(X\geqslant 0\) a.s., and \(\nu :={\mathbb {E}{}}X>0\). Then, with notations as above, as \({x\rightarrow \infty }\),

$$\begin{aligned} \frac{U_{N_{\pm }(x)}-{\nu }^{-d}{\mu }{d!}^{-1}x^{d}}{x^{d-1/2}} \overset{\mathrm {d}}{\longrightarrow }N\bigl (0,\gamma ^2\bigr ), \end{aligned}$$
(2.15)

where

$$\begin{aligned} \gamma ^2&:= {\nu }^{1-2d} \beta ^2-2\frac{{\nu }^{-2d}\mu }{(d-1)!\,d!}\sum _{i=1}^{d} \mathrm{Cov}\bigl (f_i(X),X\bigr ) + \frac{{\nu }^{-2d-1}\mu ^2}{(d-1)!^2}\mathrm{Var}\bigl (X\bigr ). \end{aligned}$$
(2.16)

Moreover, \(\gamma ^2>0\) unless \(f_i(X)=\frac{\mu }{\nu } X\) a.s. for \(i=1,\dots ,d\). \(\square \)

Proposition 2.5

[14] Suppose in addition to the hypotheses in Proposition 2.4 that X is integer-valued. Then (2.15) holds also conditioned on \(S_{N_{+}(x)}=x\) (cf. Remark 2.3) for integers \(x\rightarrow \infty \). \(\square \)

Proposition 2.6

[14] Suppose in addition to the hypotheses in Proposition 2.4 or 2.5 that \(f(X_1,\dots ,X_d)\in L^p\) and \(X\in L^p\) for every \(p<\infty \). Then the conclusion (2.15) holds with convergence of all moments. \(\square \)

2.5 Trivial Cases

We consider in the present paper sets \(T\subseteq \mathfrak {S}_3\). Then, see [20], the following cases are trivial in the sense that for all \(n\geqslant 5\), \(|\mathfrak {S}_n(T)|=0\), 1 or 2.

  1. (i)

    \(T=\{123,321\}\),

  2. (ii)

    \(|T|=3\) and \(T\supset \{123,321\}\),

  3. (iii)

    \(|T|\geqslant 4\).

We ignore these cases in the sequel. This leaves 6 cases with \(|T|=1\) (Sect. 3), 14 cases with \(|T|=2\) (Sects. 47), and 16 cases with \(|T|=3\) (Sects. 811). Symmetries reduce these to the \(2+4+4=10\) non-equivalent cases discussed below.

3 Avoiding a Single Permutation of Length 3

There are 6 cases where a single permutation of length 3 is avoided, but by the symmetries in Sect. 2.2 these reduce to 2 non-equivalent cases, for example 132 (equivalent to 231, 213, 312) and 321 (equivalent to 123). These cases are treated in detail in [12] and [13], respectively. Both analyses are based on bijections with binary trees and Dyck paths, and the well-known convergence in distribution of random Dyck paths to a Brownian excursion, but the details are very different, and so are in general the resulting limit distributions.

For comparison with the results in later sections, we quote the main results of [12] and [13], referring to these papers for further details and proofs. Recall that the standard Brownian excursion \(\mathbf {e}(x)\) is a random non-negative function on \([0,1]\).

First, for 132, let

$$\begin{aligned} \lambda (\sigma ):=|\sigma |+D(\sigma ) \end{aligned}$$
(3.1)

where \(D(\sigma )\) is the number of descents in \(\sigma \), i.e., indices i such that \(\sigma _i>\sigma _{i+1}\) or (as a convenient convention) \(i=|\sigma |\). Note that \(1\leqslant D(\sigma )\leqslant |\sigma |\), and thus

$$\begin{aligned} |\sigma |+1\leqslant \lambda (\sigma )\leqslant 2|\sigma |, \end{aligned}$$
(3.2)

with the extreme values \(\lambda (\sigma )=|\sigma |+1\) if and only if \(\sigma =1\cdots k\), and \(\lambda (\sigma )=2|\sigma |\) if and only if \(\sigma =k\cdots 1\), for some \(k=|\sigma |\).

Theorem 3.1

[12] There exist strictly positive random variables \(\Lambda _\sigma \) such that

$$\begin{aligned} n_\sigma (\varvec{\pi }_{{{132}};n})/ n^{\lambda (\sigma )/2} \overset{\mathrm {d}}{\longrightarrow }\Lambda _\sigma , \end{aligned}$$
(3.3)

as \({n\rightarrow \infty }\), jointly for all \(\sigma \in \mathfrak {S}_*({132})\). Moreover, this holds with convergence of all moments.

For a monotone decreasing permutation \(k\cdots 1\), \(\Lambda _{k\cdots 1}=1/k!\) is deterministic, but not for any other \(\sigma \). \(\square \)

The limit variables \(\Lambda _\sigma \) in Theorem 3.1 can be expressed as functionals of a Brownian excursion \(\mathbf {e}(x)\), see [12]; the description is, in general, rather complicated, but some cases are simple.

Example 3.2

In the special case \(\sigma =12\), \(\Lambda _{12}=\sqrt{2}\int _0^1\mathbf {e}(x)\,\mathrm {d}x\), see [12, Example 7.6]; this is (apart from the factor \(\sqrt{2}\)) the well-known Brownian excursion area, see e.g. [11] and the references there.

For the number \(n_{21}\) of inversions, we thus have

$$\begin{aligned} \frac{\left( {\begin{array}{c}n\\ 2\end{array}}\right) - n_{21}(\varvec{\pi }_{{{132}};n})}{n^{3/2}} = \frac{n_{12}(\varvec{\pi }_{{{132}};n})}{n^{3/2}} \overset{\mathrm {d}}{\longrightarrow }\Lambda _{12} =\sqrt{2}\int _0^1\mathbf {e}(x)\,\mathrm {d}x. \end{aligned}$$
(3.4)

By Sect. 2.2, the left-hand side can also be seen as the number of inversions \(n_{21}(\varvec{\pi }_{{231};n})\) or \(n_{21}(\varvec{\pi }_{{312};n})\), normalized by \(n^{3/2}\), where we instead avoid 231 or 312.

Theorem 3.3

[13] Let \(\sigma \in \mathfrak {S}_*({321})\). Let \(m:=|\sigma |\), and suppose that \(\sigma \) has \(\ell \) blocks of lengths \(m_1,\dots ,m_\ell \). Then, as \({n\rightarrow \infty }\),

$$\begin{aligned} n_\sigma (\varvec{\pi }_{{{321}};n})/n^{(m+\ell )/2}\overset{\mathrm {d}}{\longrightarrow }W_\sigma \end{aligned}$$
(3.5)

for a positive random variable \(W_\sigma \) that can be represented as

$$\begin{aligned} W_\sigma = w_\sigma \int _{0<t_1<\dots<t_\ell <1} \mathbf {e}(t_1)^{m_1-1}\cdots \mathbf {e}(t_\ell )^{m_\ell -1}\,\mathrm {d}t_1\cdots \,\mathrm {d}t_\ell , \end{aligned}$$
(3.6)

where \(w_\sigma \) is positive constant.

Moreover, the convergence (3.5) holds jointly for any set of \(\sigma \in \mathfrak {S}_*({321})\), and with convergence of all moments.

Example 3.4

Let \(\sigma ={21}\). Then \(w_{21}=2^{-1/2}\), see [13], and thus (3.5)–(3.6), with \(\ell =1\) and \(m_1=m=2\), yield for the number of inversions,

$$\begin{aligned} \frac{ n_{21}(\varvec{\pi }_{{{321}};n})}{ n^{3/2}}\overset{\mathrm {d}}{\longrightarrow }2^{-1/2}\int _0^1\mathbf {e}(x)\,\mathrm {d}x. \end{aligned}$$
(3.7)

Note that the limit in (3.7) differs from the one in (3.4) by a factor 2.

4 Avoiding \(\{{132}, {312}\}\)

In this section we avoid \(T=\{{132}, {312}\}\). Equivalent sets are \(\{132,231\}\), \(\{213, 231\}\), \(\{213, 312\}\).

It was shown by Simion and Schmidt [20] that \(|\mathfrak {S}_n({132}, {312})|=2^{n-1}\), together with the following characterization (in an equivalent formulation).

Proposition 4.1

[20, Proposition 12] A permutation \(\pi \) belongs to the class \(\mathfrak {S}_*({132}, {312})\) if and only if every entry \(\pi _i\) is either a maximum or a minimum. \(\square \)

We encode a permutation \(\pi \in \mathfrak {S}_n({132}, {312})\) by a sequence \(\xi _2,\dots ,\xi _n\in \{\pm 1\}^{n-1}\), where \(\xi _j=1\) if \(\pi _j\) is a maximum in \(\pi \), and \(\xi _j=-1\) if \(\pi _j\) is a minimum. This is by Proposition 4.1 (and its proof in [20]) a bijection, and hence the code for a uniformly random \(\varvec{\pi }_{{{132}, {312}};n}\) has \(\xi _2,\dots ,\xi _n\) i.i.d. with the symmetric Bernoulli distribution \({\mathbb {P}{}}(\xi _j=1)={\mathbb {P}{}}(\xi _j=-1)=\frac{1}{2}\). We let \(\xi _1\) have the same distribution and be independent of \(\xi _2,\dots ,\xi _n\).

Let \(\sigma \in \mathfrak {S}_m({132}, {312})\) have the code \(\eta _2,\dots ,\eta _m\). Then \(\pi _{i_1}\cdots \pi _{i_m}\) is an occurrence of \(\sigma \) in \(\pi \) if and only if \(\xi _{i_j}=\eta _j\) for \(2\leqslant j\leqslant m\). Consequently, cf. Sect. 2.4, \(n_\sigma (\varvec{\pi }_{{{132}, {312}};n})\) is a \(U\)-statistic

$$\begin{aligned} n_\sigma (\varvec{\pi }_{{{132}, {312}};n})=\sum _{i_1<\dots <i_m}f\bigl (\xi _{i_1},\dots ,\xi _{i_m}\bigr ), \end{aligned}$$
(4.1)

where

$$\begin{aligned} f\bigl (\xi _1,\dots ,\xi _m\bigr ):=\prod _{j=2}^m\varvec{1}\{\xi _j=\eta _j\}. \end{aligned}$$
(4.2)

Note that f does not depend on the first argument. It follows that, with the notation (2.8)–(2.11),

$$\begin{aligned} \mu&= {\mathbb {E}{}}f\bigl (\xi _1,\dots ,\xi _m\bigr )=2^{-(m-1)}, \end{aligned}$$
(4.3)
$$\begin{aligned} f_i(\xi )&= {\left\{ \begin{array}{ll} 0, &{} i=1, \\ 2^{-(m-2)}\varvec{1}\{\xi =\eta _i\}, &{} 2\leqslant i\leqslant m, \end{array}\right. } \end{aligned}$$
(4.4)
$$\begin{aligned} \beta _{ij}&=\mathrm{Cov}\bigl (f_i(\xi ),f_j(\xi )\bigr ) = 2^{2-2m}\eta _i\eta _j, \qquad i,j\geqslant 2, \end{aligned}$$
(4.5)
$$\begin{aligned} \beta ^2&= 2^{2-2m} \sum _{i,j=2}^m \frac{(i+j-2)!\,(2m-i-j)!}{(i-1)!\,(j-1)!\,(m-i)!\,(m-j)!\,(2m-1)!}\eta _i\eta _j . \end{aligned}$$
(4.6)

Proposition 2.1 yields:

Theorem 4.2

For any \(m\geqslant 2\) and \(\sigma \in \mathfrak {S}_m({132}, {312})\), as \({n\rightarrow \infty }\),

$$\begin{aligned} \frac{n_\sigma (\varvec{\pi }_{{{132}, {312}};n})-2^{1-m} n^{m}/m!}{n^{m-1/2}} \overset{\mathrm {d}}{\longrightarrow }N\bigl (0,\beta ^2\bigr ), \end{aligned}$$
(4.7)

with \(\beta ^2>0\) given by (4.6).

Moreover, (4.7) holds with convergence of all moments.

Example 4.3

For the number of inversions, we have \(\sigma =21\) and \(m=2\), \(\eta _2=-1\). Thus, (4.4) yields \(f_1(\xi )=0\) and \(f_2(\xi )=\varvec{1}\{\xi =-1\}\). We find, from (4.3)–(4.6), \(\mu =\frac{1}{2}\), \(\beta _{22}=\frac{1}{4}\) and \(\beta ^2=\frac{1}{12}\), and thus Theorem 4.2 yields

$$\begin{aligned} \frac{n_{21}(\varvec{\pi }_{{{132}, {312}};n})- n^{2}/4}{n^{3/2}} \overset{\mathrm {d}}{\longrightarrow }N\bigl (0,\tfrac{1}{12}\bigr ), \end{aligned}$$
(4.8)

Remark 4.4

It is easily seen from (4.1)–(4.2) that the expected number of occurrences \({\mathbb {E}{}}n_\sigma (\varvec{\pi }_{{{132}, {312}};n}) =2^{1-m}\left( {\begin{array}{c}n\\ m\end{array}}\right) \), for every \(\sigma \in \mathfrak {S}_m({132}, {312})\); hence the expectation depends only on the length \(m=|\sigma |\).

The variance depends not only on \(|\sigma |\), not even asymptotically, by (4.6).

5 Avoiding \(\{{231}, {312}\}\)

In this section we consider \(T=\{{231}, {312}\}\). The only equivalent set is \(\{132, 213\}\).

It was shown by Simion and Schmidt [20] that \(|\mathfrak {S}_n({231}, {312})|=2^{n-1}\), together with the following characterization (in an equivalent form).

Proposition 5.1

[20, Proposition 12] A permutation \(\pi \) belongs to the class \(\mathfrak {S}_*({231}, {312})\) if and only if every block in \(\pi \) is decreasing, i.e., of the type \(\ell (\ell -1)\cdots 21\) for some \(\ell \). \(\square \)

Hence there exists exactly one block of each length \(\ell \geqslant 1\), and a permutation \(\pi \in \mathfrak {S}_*({231}, {312})\) is uniquely determined by the sequence of block lengths. In this section, let \(\pi _{\ell _1,\dots ,\ell _b}\) denote the permutation in \(\mathfrak {S}_*({231}, {312})\) with block lengths \(\ell _1,\dots ,\ell _b\), i.e.,

$$\begin{aligned} \pi _{\ell _1,\dots ,\ell _b}:=\bar{\iota }_{\ell _1}*\cdots *\bar{\iota }_{\ell _b}. \end{aligned}$$
(5.1)

If \(\sigma ,\pi \in \mathfrak {S}_*({231}, {312})\), then in an occurrence of \(\sigma \) in \(\pi \), each block in \(\sigma \) has to be mapped into a block in \(\pi \), and distinct blocks have to be mapped into distinct blocks. Conversely, any such increasing map \([m]\rightarrow [n]\) defines an occurence of \(\sigma \). It follows that if \(\sigma =\pi _{\ell _1,\dots ,\ell _b}\), then

$$\begin{aligned} n_\sigma \bigl (\pi _{L_1,\dots ,L_B}\bigr ) = \sum _{1\leqslant i_1<\dots <i_b\leqslant B} \prod _{j=1}^b \left( {\begin{array}{c}L_{i_j}\\ \ell _i\end{array}}\right) . \end{aligned}$$
(5.2)

This is similar to a \(U\)-statistic (2.7), but note that if we write \(\varvec{\pi }_{{{231}, {312}};n}\) as \(\pi _{L_1,\dots ,L_B}\), then the block lengths \(L_1,\dots ,L_B\) are not independent (since their sum is fixed \(=n\)), and the number of blocks B is random. However, we can analyze this variable using the renewal theory in Sect. 2.4 as follows.

First, mark each endpoint of the blocks in \(\pi \in \mathfrak {S}_n({231}, {312})\) by 1, and mark all other indices in [n] by 0. Thus \(\pi \) defines a string \(\xi _1,\dots ,\xi _n\in \{0,1\}^n\), where necessarily \(\xi _n=1\) but \(\xi _1,\dots ,\xi _{n-1}\) are arbitrary. This yields a bijection between \(\mathfrak {S}_n({231}, {312})\) and the \(2^{n-1}\) such strings; hence, we obtain a uniformly random \(\varvec{\pi }_{{{231}, {312}};n}\) by letting \(\xi _1,\dots ,\xi _{n-1}\) be i.i.d. \(\mathrm{Be}(\frac{1}{2})\), i.e., with \({\mathbb {P}{}}(\xi _i=0)={\mathbb {P}{}}(\xi _i=1)=\frac{1}{2}\).

We change notation a little, to avoid problems at the endpoint, and define \(\xi '_1,\xi '_2,\dots \) as an infinite i.i.d. sequence with \(\xi '_i\sim \mathrm{Be}(\frac{1}{2})\). Regard each i with \(\xi '_i=1\) as the end of a block, and let \(X_1,X_2,\dots \), be the successive lengths of these (infinitely many) blocks. Then \(X_i\) are i.i.d. with

$$\begin{aligned} X_i\sim \mathrm{Ge}(\tfrac{1}{2}). \end{aligned}$$
(5.3)

Given n, we then may let \(\xi _i:=\xi '_i\) for \(1\leqslant i<n\), and \(\xi _n:=1\); this determines \(\xi _1,\dots ,\xi _n\) as above, and thus a uniformly random \(\varvec{\pi }_{{{231}, {312}};n}\). With this construction, the number of blocks in \(\varvec{\pi }_{{{231}, {312}};n}\) is, recalling (2.13)–(2.14), \(B=N_{+}(n)\), and the block lengths are

$$\begin{aligned} L_i= {\left\{ \begin{array}{ll} X_i,&{} i<N_{+}(n) \\ n-\sum \nolimits _{i<N_{+}(n)}X_i \leqslant X_{N_{+}(n)}, &{} i=N_{+}(n). \end{array}\right. } \end{aligned}$$
(5.4)

Consequently, if \(\sigma =\pi _{\ell _1,\dots ,\ell _b}\) and we define

$$\begin{aligned} f(x_1,\dots ,x_b):=\prod _{j-1}^b\left( {\begin{array}{c}x_i\\ \ell _i\end{array}}\right) , \end{aligned}$$
(5.5)

then (5.2) and (2.7) show that

$$\begin{aligned} U_{N_{-}(n)}\leqslant n_\sigma (\varvec{\pi }_{{{231}, {312}};n}) \leqslant U_{N_{+}(n)}. \end{aligned}$$
(5.6)

Consequently, the asymptotic result in (2.15), which holds for both \(U_{N_{-}(n)}\) and \(U_{N_{+}(n)}\), holds also for \(n_\sigma (\varvec{\pi }_{{{231}, {312}};n})\).

Remark 5.2

Alternatively, we can obtain \((\xi _i)\) from \((\xi '_i)\) by conditioning on \(\xi '_n=1\), and note that this holds when \(S_{N_{+}(n)}=n\) (see Remark 2.3), and then \(n_\sigma (\varvec{\pi }_{{{231}, {312}};n}) = U_{N_{+}(n)}\). The result then follows from Proposition 2.5.

To calculate the parameters, note that, by (5.3), X has the probability generating function

$$\begin{aligned} g(z):= {\mathbb {E}{}}z^X = \sum _{k=0}^\infty 2^{-k}z^k=\frac{z}{2-z}=\frac{2}{2-z}-1 \end{aligned}$$
(5.7)

and it follows that for any integers \(k,l\geqslant 0\) with \((k,l)\ne (0,0)\),

$$\begin{aligned} {\mathbb {E}{}}\left( \left( {\begin{array}{c}X\\ k\end{array}}\right) \left( {\begin{array}{c}X\\ \ell \end{array}}\right) \right)&=[z^kw^\ell ]{\mathbb {E}{}}\bigl ((1+z)^X(1+w)^X\bigr ) \end{aligned}$$
(5.8)
$$\begin{aligned}&=[z^kw^\ell ]g\bigl ((1+z)(1+w)\bigr ) \end{aligned}$$
(5.9)
$$\begin{aligned}&=[z^kw^\ell ]\frac{2}{2-(1+z)(1+w)} \end{aligned}$$
(5.10)
$$\begin{aligned}&=[z^kw^\ell ]\frac{2}{1-z-w-zw} \end{aligned}$$
(5.11)
$$\begin{aligned}&=2D(k,\ell ) =2\sum _{i=0}^{k\wedge \ell }\frac{(k+\ell -i)!}{(k-i)!\,(\ell -i)!\,i!} \end{aligned}$$
(5.12)

where \(D(k,\ell )\) denotes the Delannoy numbers. (\(D(k,\ell )\) is, e.g., the number of lattice paths from (0, 0) to \((k,\ell )\) with steps (1, 0), (0, 1) or (1, 1); see [21, Example 6.3.8] and [19, A008288 and A001850] and the references there.) Simple calculations then yield

$$\begin{aligned} \nu&={\mathbb {E}{}}X = 2, \end{aligned}$$
(5.13)
$$\begin{aligned} \mathrm{Var}(X)&=2. \end{aligned}$$
(5.14)
$$\begin{aligned} \mu&={\mathbb {E}{}}\prod _{j=1}^b\left( {\begin{array}{c}X\\ \ell _i\end{array}}\right) = \prod _{j=1}^b{\mathbb {E}{}}\left( {\begin{array}{c}X\\ \ell _i\end{array}}\right) = 2^b, \end{aligned}$$
(5.15)
$$\begin{aligned} f_i(X)&=2^{b-1}\left( {\begin{array}{c}X\\ \ell _i\end{array}}\right) , \end{aligned}$$
(5.16)
$$\begin{aligned} \beta _{ij}&=\mathrm{Cov}\bigl (f_i(X),f_j(X)\bigr ) =2^{2b-1}D(\ell _i,\ell _j)-2^{2b}, \end{aligned}$$
(5.17)
$$\begin{aligned} \mathrm{Cov}\bigl (f_i(X),X\bigr )&=2^bD(\ell _i,1)-2^{b+1}=(2\ell _i-1)2^b . \end{aligned}$$
(5.18)

Consequently, we obtain by Propositions 2.4 and 2.6 asymptotic normality in the following form.

Theorem 5.3

Let \(\sigma \in \mathfrak {S}_m({231}, {312})\) have block lengths \(\ell _1,\dots ,\ell _b\). Then, as \({n\rightarrow \infty }\),

$$\begin{aligned} \frac{n_\sigma (\varvec{\pi }_{{{231}, {312}};n})-n^b/b!}{n^{b-1/2}} \overset{\mathrm {d}}{\longrightarrow }N\bigl (0,\gamma ^2\bigr ), \end{aligned}$$
(5.19)

where \(\gamma ^2\) can be calculated by (2.16) and (5.13)–(5.18).

Moreover, (5.19) holds with convergence of all moments. \(\square \)

Example 5.4

For the number of inversions, we have \(\sigma =21\) and \(b=1\), \(\ell _1=2\). A calculation yields \(\gamma ^2=6\), and Theorem 5.3 yields

$$\begin{aligned} \frac{n_{21}(\varvec{\pi }_{{{231}, {312}};n})-n}{n^{1/2}}\overset{\mathrm {d}}{\longrightarrow }N(0,6). \end{aligned}$$
(5.20)

Remark 5.5

Theorem 5.3 shows that the typical order of \(n_\sigma (\varvec{\pi }_{{{231}, {312}};n})\) depends only on the number of blocks b in \(\sigma \) (but not on the length \(|\sigma |\)); more precisely, the asymptotic mean depends only on b. (Cf. the different situation when avoiding \(\{{132}, {312}\}\) in Sect. 4, see Remark 4.4.) Calculations (assisted by Maple) show, however, that the asymptotic variance \(\gamma ^2\) depends not only on m and b; for example \(\sigma =2143=\bar{\iota }_2*\bar{\iota }_2\) has \(\gamma ^2=6\) while \(\sigma =3214=\bar{\iota }_3*\bar{\iota }_1\) has \(\gamma ^2=52/3\).

Remark 5.6

The asymptotic variance \(\gamma ^2=0\) when \(\sigma =\iota _m=1\cdots m\), in which case \(b=m\) and all blocks have length 1. This can be seen directly, since all other patterns occur only \(O_{\mathrm {p}}(n^{m-1})\) times (by Theorem 5.3), and thus \(\iota _m\) occurs \(\left( {\begin{array}{c}n\\ m\end{array}}\right) - O_{\mathrm {p}}(n^{m-1})\) times. This argument also shows that the asymptotic variance of \(n_{1\cdots m}(\varvec{\pi }_{{{231}, {312}};n})\) is of the order \(n^{2m-3}\).

It follows from Proposition 2.4 that \(\gamma ^2>0\) for any other \(\sigma \in \mathfrak {S}_*({231}, {312})\).

6 Avoiding \(\{{231}, {321}\}\)

In this section we consider \(T=\{{231}, {321}\}\). Equivalent sets are \(\{123, 132\}\), \(\{123, 213\}\), \(\{312, 321\}\).

It was shown by Simion and Schmidt [20] that \(|\mathfrak {S}_n({231}, {321})|=2^{n-1}\), together with the following characterization (in an equivalent form).

Proposition 6.1

([20, Proposition 12]) A permutation \(\pi \) belongs to the class \(\mathfrak {S}_*({231}, {321})\) if and only if every block in \(\pi \) is of the type \(\ell 12\cdots (\ell -1)\) for some \(\ell \). \(\square \)

Thus, as in Sect. 5, a permutation in \(\mathfrak {S}_*({231}, {321})\) is determined by its sequence of block lengths, and these can be arbitrary. In this section, let \(\pi _{\ell _1,\dots ,\ell _b}\) denote the permutation in \(\mathfrak {S}_*({231}, {321})\) with block lengths \(\ell _1,\dots ,\ell _b\).

Again, in an occurrence of \(\sigma \) in \(\pi \), each block in \(\sigma \) has to be mapped into a block in \(\pi \). However, this time, several consecutive blocks in \(\sigma \) may be mapped to the same block in \(\pi \), provided they have length 1. Moreover, if a block of length \(\ell \geqslant 2\) in \(\sigma \) is mapped to a block in \(\pi \), then the first element has to be mapped to the first element. Hence, we obtain instead of (5.2), if \(\sigma =\pi _{\ell _1,\dots ,\ell _b}\),

$$\begin{aligned} n_\sigma \bigl (\pi _{L_1,\dots ,L_B}\bigr ) = \sum _{1\leqslant i_1<\dots <i_b\leqslant B} \prod _{j=1}^b h_{\ell _i}(L_{i_j})+R, \end{aligned}$$
(6.1)

where

$$\begin{aligned} h_\ell (x):= {\left\{ \begin{array}{ll} x, &{} \ell =1, \\ \left( {\begin{array}{c}x-1\\ \ell -1\end{array}}\right) ,&\ell \geqslant 2, \end{array}\right. } \end{aligned}$$
(6.2)

and R counts the occurrences where less than b different blocks in \(\pi _{L_1,\dots ,L_B}\) are used. We represent the block lengths as in Sect. 5, in particular (5.3)–(5.4), again using an infinite i.i.d. sequence \(X_i\sim \mathrm{Ge}(\frac{1}{2})\). Then, the main term in (6.1) is sandwiched between U-statistics as in (5.6), and we can apply Proposition 2.4 to it. (Alternatively, we can use Proposition 2.5 as in Remark 5.2.)

By (5.7), \({\mathbb {E}{}}z^{X-1}=(2-z)^{-1}\), and calculations similar to (5.8) yield

$$\begin{aligned} {\mathbb {E}{}}\left( \left( {\begin{array}{c}X-1\\ k\end{array}}\right) \left( {\begin{array}{c}X-1\\ \ell \end{array}}\right) \right) =D(k,\ell ), \qquad k,\ell \geqslant 0. \end{aligned}$$
(6.3)

Hence

$$\begin{aligned} {\mathbb {E}{}}h_\ell (X)= {\left\{ \begin{array}{ll} D(\ell -1,0)=1, &{} \ell \geqslant 2, \\ 2, &{} \ell =1. \end{array}\right. } \end{aligned}$$
(6.4)

Simple calculations then yield, in addition to (5.13)–(5.14), letting \(b_1\) be the number of blocks of length 1,

$$\begin{aligned}&\mu = \prod _{j=1}^b{\mathbb {E}{}}h_{\ell _i}(X) = 2^{b_1}, \end{aligned}$$
(6.5)
$$\begin{aligned}&f_i(X)= {\left\{ \begin{array}{ll} 2^{b_1}\left( {\begin{array}{c}X-1\\ \ell _i-1\end{array}}\right) , \qquad \ell _i\geqslant 2,\\ 2^{b_1-1}X,\qquad \ell _i=1, \end{array}\right. } \end{aligned}$$
(6.6)
$$\begin{aligned}&\beta _{ij}=\mathrm{Cov}\bigl (f_i(X),f_j(X)\bigr ) = {\left\{ \begin{array}{ll} 2^{2b_1}D(\ell _i-1,\ell _j-1)-2^{2b_1}, &{} \ell _i,\ell _j\geqslant 2, \\ 2^{2b_1}\bigl (\ell _i-1\bigr ), &{} \ell _i\geqslant 2>\ell _j=1,\\ 2^{2b_1-1},&{} \ell _i=\ell _j=1 \end{array}\right. }\nonumber \\ \end{aligned}$$
(6.7)
$$\begin{aligned}&\mathrm{Cov}\bigl (f_i(X),X\bigr )= {\left\{ \begin{array}{ll} 2^{b_1+1}\bigl (\ell _i-1\bigr ), &{} \ell _i\geqslant 2,\\ 2^{b_1},&{} \ell _i=1. \end{array}\right. } \end{aligned}$$
(6.8)

Consequently, we obtain by Propositions 2.4 and 2.6 asymptotic normality in the following form.

Theorem 6.2

Let \(\sigma \in \mathfrak {S}_m({231}, {321})\) have block lengths \(\ell _1,\dots ,\ell _b\). Then, as \({n\rightarrow \infty }\),

$$\begin{aligned} \frac{n_\sigma (\varvec{\pi }_{{{231}, {321}};n})-2^{b_1-b}n^b/b!}{n^{b-1/2}} \overset{\mathrm {d}}{\longrightarrow }N\bigl (0,\gamma ^2\bigr ), \end{aligned}$$
(6.9)

where \(\gamma ^2\) can be calculated by (2.16) and (6.56.66.7)–(6.8).

Moreover, (6.9) holds with convergence of all moments.

Proof

The argument above yields the stated limit for the first (main) term on the right-hand side of (6.1). We show that the remainder term R is negligible.

The term R can be split up as a sum \(\sum _{d=1}^{b-1} R_d\), where \(R_d\) counts the occurences that use d blocks in \(\pi =\pi _{L_1,\dots ,L_B}\). Each \(R_d\) may be written as a sum over d-tuples of blocks, and thus bounded as in (5.6) by some \(U\)-statistics \(U^{(d)}_{N_{+}(n)}\) of order d. Applying Proposition 2.4 (or Proposition 2.1, together with \(N_{+}(n)\leqslant n\)) to the latter, we find \(R_d=O_{\mathrm {p}}(n^d)=O_{\mathrm {p}}(n^{b-1})\), and thus \(R_d/n^{b-1/2}\overset{\mathrm {p}}{\longrightarrow }0\). For moments, we similarly have by Proposition 2.6 or 2.1\({\mathbb {E}{}}|R_d|^p = O\bigl (n^{pd}\bigr )=O\bigl (n^{p(b-1)}\bigr )=o\bigl (n^{p(b-1/2)}\bigr )\). Hence, each \(R_d\) is negligible in the limit (6.9), and the result follows. \(\square \)

Example 6.3

For the number of inversions, we have \(\sigma =21\) and \(b=1\), \(\ell _1=2\), \(b_1=0\). A calculation yields \(\gamma ^2=1/4\), and Theorem 6.2 yields

$$\begin{aligned} \frac{n_{21}(\varvec{\pi }_{{{231}, {321}};n})-n/2}{n^{1/2}}\overset{\mathrm {d}}{\longrightarrow }N\left( 0,\tfrac{1}{4}\right) . \end{aligned}$$
(6.10)

In fact, we have the exact distribution

$$\begin{aligned} n_{21}(\varvec{\pi }_{{{231}, {321}};n})\sim \mathrm{Bi}\bigl (n-1,\tfrac{1}{2}\bigr ). \end{aligned}$$
(6.11)

To see this, note that, by Proposition 6.1, if we define \(\xi _2,\dots ,\xi _n\) by

$$\begin{aligned} \xi _i:=\varvec{1}\{\text {no block begins at position }i\}, \end{aligned}$$
(6.12)

then every sequence \(\xi _2,\dots ,\xi _n\in \{0,1\}^{n-1}\) occurs for exactly one permutation in \(\mathfrak {S}_n({231}, {321})\), and thus \(\xi _2,\dots ,\xi _n\) are i.i.d. \(\mathrm{Be}(\frac{1}{2})\). (This is a minor variation of the similar argument in Sect. 5.) Furthermore, for each \(j\geqslant 2\), the number of inversions ij with \(i<j\) equals \(\xi _j\), so the total number is \(\sum _2^n\xi _i\sim \mathrm{Bi}(n-1,\frac{1}{2})\).

Remark 6.4

Unlike in Sect. 5, here the asymptotic mean depends not only on the number of blocks in \(\sigma \), but also on their lengths.

Remark 6.5

As in Sect. 5, the asymptotic variance \(\gamma ^2=0\) when \(\sigma =\iota _m=1\cdots m\), in which case \(b=m\) and all blocks have length 1, but \(\gamma ^2>0\) for any other \(\sigma \in \mathfrak {S}_*({231}, {321})\).

7 Avoiding \(\{{132}, {321}\}\)

In this section we consider \(T=\{{132}, {321}\}\). Equivalent sets are \(\{123, 231\}\), \(\{123, 312\}\), \(\{213, 321\}\).

It was shown by Simion and Schmidt [20] that \(|\mathfrak {S}_n({132}, {321})|=\left( {\begin{array}{c}n\\ 2\end{array}}\right) +1\). (The case \(\mathfrak {S}_n({132}, {321})\) is thus more degenerate than the cases considered above, in the sense that the allowed set of permutations is much smaller; \(|\mathfrak {S}_n({132}, {321})|\) grows polynomially as (roughly) \(n^2\), compared to \(2^{n-1}\) in the previous cases forbidding two permutations of length 3.) [20] gave also the following characterization. Given \(k,\ell \geqslant 1\) and \(m\geqslant 0\), let, in this section,

$$\begin{aligned} \pi _{k,\ell ,m}:= (\ell +1,\dots ,\ell +k,1,\dots ,\ell ,k+\ell +1,\dots ,k+\ell +m)\in \mathfrak {S}_{k+\ell +m}.\nonumber \\ \end{aligned}$$
(7.1)

Thus \(\pi _{k,\ell ,m}\) consists of three increasing runs of lengths k, \(\ell \), m (where the third run is empty when \(m=0\)).

Proposition 7.1

([20, Proposition 13])

$$\begin{aligned} \mathfrak {S}_n({132}, {321})=\bigl \{\pi _{k,\ell ,n-k-\ell }:k,\ell \geqslant 1,\, k+\ell \leqslant n\bigr \} \cup \{\iota _n\}. \end{aligned}$$
(7.2)

\(\square \)

For asymptotic results, we may ignore the case when \(\varvec{\pi }_{{{132}, {321}};n}=\iota _n\), which has probability \(1/(\left( {\begin{array}{c}n\\ 2\end{array}}\right) +1)=o(1)\). Conditioning on \(\varvec{\pi }_{{{132}, {321}};n}\ne \iota _n\), we see by Proposition 7.1 that \(\varvec{\pi }_{{{132}, {321}};n}=\pi _{K,L,n-K-L}\), where K and L are random with (KL) uniformly distributed over the set \(\{K,L\geqslant 1:K+L\leqslant n\}\). As \({n\rightarrow \infty }\), we thus have \((K/n,L/n)\overset{\mathrm {d}}{\longrightarrow }(X,Y)\) with (XY) uniformly distributed on the triangle \(\{(X,Y)\in \mathbb {R}_+^2:X+Y\leqslant 1\}\). Equivalently, letting \(Z:=1-X-Y\),

$$\begin{aligned} \Bigl (\frac{K}{n},\frac{L}{n},\frac{n-K-L}{n}\Bigr )\overset{\mathrm {d}}{\longrightarrow }(X,Y,Z)\sim \mathrm{Dir}(1,1,1), \end{aligned}$$
(7.3)

where we recall that the Dirichlet distribution \(\mathrm{Dir}(1,1,1)\) is the uniform distribution on the simplex \(\{(x,y,z)\in \mathbb {R}_+^3: x+y+z=1\}\).

If \(\sigma =\pi _{i,j,p}\) for some ijp, then it is easily seen that an occurrence of \(\sigma \) in \(\pi _{k,\ell ,m}\) is obtained by selecting i, j and p elements from the three runs of \(\pi _{k,\ell ,m}\), and thus

$$\begin{aligned} n_{\sigma }(\pi _{k,\ell ,m})=\left( {\begin{array}{c}k\\ i\end{array}}\right) \left( {\begin{array}{c}\ell \\ j\end{array}}\right) \left( {\begin{array}{c}m\\ p\end{array}}\right) . \end{aligned}$$
(7.4)

Similarly, if \(\sigma =\iota _i\), then an occurrence of \(\sigma \) in \(\pi _{k,\ell ,m}\) is obtained by selecting i elements from either the union of the first and last run, or from the union of the two last. Hence, by inclusion-exclusion,

$$\begin{aligned} n_{\sigma }(\pi _{k,\ell ,m})=\left( {\begin{array}{c}k+m\\ i\end{array}}\right) +\left( {\begin{array}{c}\ell +m\\ i\end{array}}\right) -\left( {\begin{array}{c}m\\ i\end{array}}\right) . \end{aligned}$$
(7.5)

These exact formulas together with the description of \(\varvec{\pi }_{{{132}, {321}};n}\) above and (7.3) yield the following asymptotic result.

Theorem 7.2

Let \(\sigma \in \mathfrak {S}_*({132}, {321})\). Then the following hold as \({n\rightarrow \infty }\).

  1. (i)

    If \(\sigma =\pi _{i,j,p}\) for some ijp, then

    $$\begin{aligned} n^{-(i+j+p)}n_\sigma (\varvec{\pi }_{{{132}, {321}};n}) \overset{\mathrm {d}}{\longrightarrow }W_{i,j,p}:=\frac{1}{i!\,j!\,p!} X^i Y^jZ^p, \end{aligned}$$
    (7.6)

    where \((X,Y,Z)\sim \mathrm{Dir}(1,1,1)\).

  2. (ii)

    If \(\sigma =\iota _{i}\), then

    $$\begin{aligned} n^{-i}n_\sigma (\varvec{\pi }_{{{132}, {321}};n}) \overset{\mathrm {d}}{\longrightarrow }W_i:=\frac{1}{i!}\bigl ((X+Z)^i+(Y+Z)^i-Z^i\bigr ), \end{aligned}$$
    (7.7)

    with \((X,Y,Z)\sim \mathrm{Dir}(1,1,1)\) as in (i).

Moreover, these hold jointly for any set of such \(\sigma \), and with convergence of all moments. In particular, in case (i),

$$\begin{aligned} n^{-(i+j+p)}{\mathbb {E}{}}n_\sigma (\varvec{\pi }_{{{132}, {321}};n}) \overset{\mathrm {d}}{\longrightarrow }{\mathbb {E}{}}W_{i,j,p}=\frac{2}{(i+j+p+2)!} \end{aligned}$$
(7.8)

and in case (ii),

$$\begin{aligned} n^{-i}{\mathbb {E}{}}n_\sigma (\varvec{\pi }_{{{132}, {321}};n}) \overset{\mathrm {d}}{\longrightarrow }{\mathbb {E}{}}W_{i}=\frac{4i+2}{(i+2)!} \end{aligned}$$
(7.9)

Proof

The limits in distribution (7.6) and (7.7) hold (with joint convergence) by the discussion before the theorem. Moment convergence holds because the normalized variables in (7.6) and (7.7) are bounded (by 1). Finally, the expectation in (7.8) is easily computed using the multidimensional extension of the beta integral [17, (5.14.2)], which implies

$$\begin{aligned} {\mathbb {E}{}}X^a Y^b Z^c = \frac{2\Gamma (a+1)\Gamma (b+1)\Gamma (c+1)}{\Gamma (a+b+c+3)}, \qquad a,b,c>-1. \end{aligned}$$
(7.10)

For the expectation in (7.9), we note also that \(X+Z\overset{\mathrm {d}}{=}Y+Z \sim B(2,1)\), a Beta distribution; the result follows by a short calculation. \(\square \)

Higher moments of \(W_{i,j,p}\) follow also from (7.10).

Corollary 7.3

The number of inversions has the asymptotic distribution

$$\begin{aligned} n^{-2}n_{{{21}}}(\varvec{\pi }_{{{132}, {321}};n}) \overset{\mathrm {d}}{\longrightarrow }W:=X Y, \end{aligned}$$
(7.11)

with (XY) as above; the limit variable W has density function

$$\begin{aligned} 2\log \bigl (1+\sqrt{1-4x}\bigr ) - 2\log \bigl (1-\sqrt{1-4x}\bigr ) , \qquad 0<x<1/4, \end{aligned}$$
(7.12)

and moments

$$\begin{aligned} {\mathbb {E}{}}W^r = 2\frac{r!^2}{(2r+2)!}, \qquad r>0. \end{aligned}$$
(7.13)

Proof

We have \(21=\pi _{1,1,0}\), and thus (7.6) yields (7.11). The formula (7.13) for the moments \({\mathbb {E}{}}W^r={\mathbb {E}{}}X^rY^r\) follow by (7.10). Finally, for \(0<t<1/4\), \({\mathbb {P}{}}(W>t)={\mathbb {P}{}}(XY>t)\) equals 2 times the area of the set \(\{(x,y)\in \mathbb {R}_+^2:x+y\leqslant 1,\,xy> t\}\). A differentiation and a simple calculation yield (7.12). \(\square \)

Example 7.4

For the four allowed patterns of length 3, we find

$$\begin{aligned} n^{-3}{\mathbb {E}{}}n_{123}(\varvec{\pi }_{{{132}, {321}};n})&\rightarrow {\mathbb {E}{}}W_{3} =\frac{7}{60}, \end{aligned}$$
(7.14)
$$\begin{aligned} n^{-3}{\mathbb {E}{}}n_{213}(\varvec{\pi }_{{{132}, {321}};n})&\rightarrow {\mathbb {E}{}}W_{1,1,1} =\frac{1}{60}, \end{aligned}$$
(7.15)
$$\begin{aligned} n^{-3}{\mathbb {E}{}}n_{231}(\varvec{\pi }_{{{132}, {321}};n})&\rightarrow {\mathbb {E}{}}W_{2,1,0} =\frac{1}{60}, \end{aligned}$$
(7.16)
$$\begin{aligned} {\mathbb {E}{}}n_{312}(\varvec{\pi }_{{{132}, {321}};n})&= {\mathbb {E}{}}W_{1,2,0} =\frac{1}{60}. \end{aligned}$$
(7.17)

(See Zhao [23] for exact formulas for finite n.) Note that by (7.8), all \(W_{i,j,q}\) with the same \(i+j+q\) have the same expectation; their distributions differ, however, in general, as is shown by higher moments. For example, in the present example, by (7.10), \({\mathbb {E}{}}W_{1,1,1}^2=2/7!\) and \({\mathbb {E}{}}W_{2,1,0}^2=3/7!\).

The expected number of occurrences of \(\sigma \) can also easily be found exactly for finite n, as follows. As noted above, (7.8) shows that all \(\sigma \) in (i) of the same length occur in \(\varvec{\pi }_{{{132}, {321}};n}\) with asymptotically equal frequencies. In fact, this holds also exactly, for any n. (Note also that (7.8) is an immediate consequence of (7.18).)

Theorem 7.5

Let \(\sigma =\pi _{i,j,p}\), with \(i,j\geqslant 1\) and \(p\geqslant 0\). Then, for any n,

$$\begin{aligned} {\mathbb {E}{}}n_\sigma (\varvec{\pi }_{{{132}, {321}};n})=\frac{\left( {\begin{array}{c}n+2\\ i+j+p+2\end{array}}\right) }{\left( {\begin{array}{c}n\\ 2\end{array}}\right) +1}. \end{aligned}$$
(7.18)

Proof

By (7.4) and the discussion before it, for any given \(k,\ell ,m\), the number of occurences of \(\sigma \) in \(\pi _{k,\ell ,m}\) equals the number of sequences \(q_1,\dots ,q_i,q'_1,\dots ,q'_j,q''_1,\dots ,q''_p\) such that

$$\begin{aligned} 1\leqslant q_1< \dots<q_i \leqslant k< q'_1<\cdots< q'_j \leqslant \ell<q''_1<\dots <q''_m\leqslant n. \end{aligned}$$
(7.19)

Since \(\sigma \) does not occur in \(\iota _n\), the total number of occurences of \(\sigma \) in all elements of \(\mathfrak {S}_n({132}, {321})\) is thus, recalling (7.2), equal to the number of all sequences \((q_1, \dots ,q_i , k , q'_1,\dots ,q'_j,\ell ,q''_1,\dots ,q''_m)\) of integers satisfying (7.19). By increasing k and all \(q'_r\) by 1, and \(\ell \) and all \(q''_s\) by 2, we obtain a bijection with the collection of all subsets of \(i+j+q+2\) elements of \(\{1,\dots ,n+2\}\). Hence, the total number of occurrences is \(\left( {\begin{array}{c}n+2\\ i+j+p+2\end{array}}\right) \), and (7.18) follows. \(\square \)

8 Avoiding \(\{{231},{312}, {321}\}\)

We proceed to avoiding sets of three permutations. In this section we avoid \(T=\{{231},{312}, {321}\}\). An equivalent set is \(\{123,132,213\}\).

It was shown by Simion and Schmidt [20] that \(|\mathfrak {S}_n({231},{312}, {321})|=F_{n+1}\), the \((n+1)\hbox {th}\) Fibonacci number (with the initial conditions \(F_0=0\), \(F_1=1\)); they also gave the following characterization (in an equivalent form).

Proposition 8.1

[20, Proposition \(15^*\)] A permutation \(\pi \) belongs to the class \(\mathfrak {S}_*({231},{312}, {321})\) if and only if every block in \(\pi \) is decreasing and has length \(\leqslant 2\), i.e., every block is 1 or 21. \(\square \)

Cf. Proposition 5.1; we have here added the restriction that block lengths are 1 or 2. With this restriction in mind, we use again the notation (5.1) and note that (5.2) holds. A permutation \(\pi \in \mathfrak {S}_n({231},{312}, {321})\) is thus of the form \(\pi _{L_1,\dots ,L_B}\) for some sequence \(L_1,\dots ,L_B\) of \(\{1,2\}\) with sum n; furthermore, this yields a bijection with all such sequences.

Define p to be the (inverse) golden ratio:

$$\begin{aligned} p:= \frac{\sqrt{5}-1}{2}, \end{aligned}$$
(8.1)

so that \(p+p^2=1\). Let X be a random variable with the distribution

$$\begin{aligned} {\mathbb {P}{}}(X=1)=p,\qquad {\mathbb {P}{}}(X=2)=p^2. \end{aligned}$$
(8.2)

Consider an i.i.d. sequence \(X_1,X_2,\dots \) of copies of X, and let \(S_n:=\sum _{i=1}^nX_i\). Then for any sequence \(\ell _1,\dots ,\ell _b\) with \(b\geqslant 1\), \(\ell _i\in \{1,2\}\) and \(\sum _{1}^b\ell _i=n\),

$$\begin{aligned} {\mathbb {P}{}}\bigl (X_i=\ell _i,\, i=1,\dots ,b\bigr ) =\prod _{i=1}^b p^{\ell _i} =p^n. \end{aligned}$$
(8.3)

This probability is thus the same for all such sequences, which means that, conditioned on the event that \(S_b=n\) for some (unspecified) \(b\geqslant 1\), the sequence \((X_1,\dots ,X_b)\) is equidistributed over all \(\{1,2\}\)-sequences with sum n; we have seen above that this equals the distribution of the sequence of block lengths \((L_1,\dots ,L_B)\) of a random permutation \(\varvec{\pi }_{{{231},{312}, {321}};n}\) in \(\mathfrak {S}_n({231},{312}, {321})\). Consequently, recalling (2.14) and Remark 2.3,

$$\begin{aligned} (L_1,\dots ,L_B) \overset{\mathrm {d}}{=}\bigl ((X_1,\dots ,X_{N_{+}(n)})\mid S_{N_{+}(n)}=n\bigr ) . \end{aligned}$$
(8.4)

It follows from this and (5.2) that if \(\sigma =\pi _{\ell _1,\dots ,\ell _b}\in \mathfrak {S}_*({231},{312}, {321})\), and f is defined by (5.5), then \(n_\sigma (\varvec{\pi }_{{{231},{312}, {321}};n})\) has the same distribution as \(U_{N_{+}(n)}\) conditioned on \(S_{N_{+}(n)}=n\). Consequently, Proposition 2.5 applies and yields asymptotic normality of \(n_\sigma (\varvec{\pi }_{{{231},{312}, {321}};n})\), and Proposition 2.6 adds moment convergence.

To find the parameters, let \(\sigma \) have \(b_1\) blocks of length 1 and \(b_2\) blocks of length 2 (so \(b_1+b_2=b\) and \(b_1+2b_2=|\sigma |\)). Then, noting \(\left( {\begin{array}{c}X\\ 2\end{array}}\right) =X-1\),

$$\begin{aligned} \nu&={\mathbb {E}{}}X=p+2p^2=2-p=\frac{5-\sqrt{5}}{2}, \end{aligned}$$
(8.5)
$$\begin{aligned} \mathrm{Var}\,X&=p^3=2p-1=\sqrt{5}-2, \end{aligned}$$
(8.6)
$$\begin{aligned} {\mathbb {E}{}}\left( {\begin{array}{c}X\\ 2\end{array}}\right)&={\mathbb {P}{}}(X=2)=p^2=1-p, \end{aligned}$$
(8.7)
$$\begin{aligned} \mu&= (2-p)^{b_1}(1-p)^{b_2} = \Bigl (\frac{5-\sqrt{5}}{2}\Bigr )^{b_1}\Bigl (\frac{3-\sqrt{5}}{2}\Bigr )^{b_2}, \end{aligned}$$
(8.8)
$$\begin{aligned} f_i(X)&= {\left\{ \begin{array}{ll} (2-p)^{b_1-1}(1-p)^{b_2} X, &{} \ell _i=1,\\ (2-p)^{b_1}(1-p)^{b_2-1}(X-1), &{} \ell _i=2, \end{array}\right. } \end{aligned}$$
(8.9)
$$\begin{aligned} \beta _{ij}&= {\left\{ \begin{array}{ll} (2-p)^{2b_1-2}(1-p)^{2b_2}(2p-1), &{} \ell _i=\ell _j=1,\\ (2-p)^{2b_1-1}(1-p)^{2b_2-1}(2p-1), &{} \ell _i=1< \ell _j=2,\\ (2-p)^{2b_1}(1-p)^{2b_2-2}(2p-1), &{} \ell _i=\ell _j=2. \end{array}\right. } \end{aligned}$$
(8.10)
$$\begin{aligned} \mathrm{Cov}&\bigl (f_i(X),X\bigr )= {\left\{ \begin{array}{ll} (2-p)^{b_1-1}(1-p)^{b_2}(2p-1), &{} \ell _i=1, \\ (2-p)^{b_1}(1-p)^{b_2-1}(2p-1), &{} \ell _i=2. \end{array}\right. } \end{aligned}$$
(8.11)

We summarize.

Theorem 8.2

Let \(\sigma \in \mathfrak {S}_m({231},{312}, {321})\) have block lengths \(\ell _1,\dots ,\ell _b\). Then, as \({n\rightarrow \infty }\),

$$\begin{aligned} \frac{n_\sigma (\varvec{\pi }_{{{231},{312}, {321}};n})-\mu n^b/b!}{n^{b-1/2}} \overset{\mathrm {d}}{\longrightarrow }N\bigl (0,\gamma ^2\bigr ), \end{aligned}$$
(8.12)

where \(\mu \) is given by (8.8) and \(\gamma ^2\) can be calculated by (2.16) and (8.5)–(8.11).

Moreover, (8.12) holds with convergence of all moments. \(\square \)

Example 8.3

For the number of inversions, \(\sigma =21\), \(b=1=b_2\) and \(b_1=0\). Hence, \(\mu =1-p=(3-\sqrt{5})/2\) and, by a calculation, \(\gamma ^2=(2-p)^{-3}\mathrm{Var}\,X= 5^{-3/2}\). Consequently,

$$\begin{aligned} \frac{n_{21}(\varvec{\pi }_{{{231},{312}, {321}};n})-\frac{3-\sqrt{5}}{2} n}{n^{1/2}} \overset{\mathrm {d}}{\longrightarrow }N\bigl (0,5^{-3/2}\bigr ). \end{aligned}$$
(8.13)

Remark 8.4

Again, \(\gamma ^2>0\) unless \(\sigma =\iota _m\).

9 Avoiding \(\{{132},{231}, {312}\}\)

In this section we avoid \(\{{132},{231}, {312}\}\). Equivalent sets are \(\{132,213,231\}\), \(\{132,213,312\}\), \(\{213,231,312\}\).

It was shown by Simion and Schmidt [20] that \(|\mathfrak {S}_n({132},{231}, {312})|=n\), together with the following characterization (in an equivalent form). In this section, let

$$\begin{aligned} \pi _{k,\ell }:=\bar{\iota }_k*\iota _{l}=(k,\dots ,1,k+1,\dots ,k+\ell ) \in \mathfrak {S}_{k+\ell }, \qquad k\geqslant 1,\,\ell \geqslant 0. \end{aligned}$$
(9.1)

Note that \(\pi _{1,\ell }=\iota _{1+\ell }\).

Proposition 9.1

[20, Proposition \(16^*\)]

$$\begin{aligned} \mathfrak {S}_n({132},{231}, {312})=\{\pi _{k,n-k}:1\leqslant k\leqslant n\}. \end{aligned}$$

\(\square \)

Cf. Propositions 4.1 and 5.1, which characterize supersets. (Equivalently, \(\pi \in \mathfrak {S}_*({132},{231}, {312})\) if the first block is decreasing and all other blocks have length 1.)

Hence, the random \(\varvec{\pi }_{{{132},{231}, {312}};n}=\pi _{K,n-K}\), where \(K\in [n]\) is uniformly random. As \({n\rightarrow \infty }\),

$$\begin{aligned} K/n\overset{\mathrm {d}}{\longrightarrow }U\sim \mathsf U(0,1). \end{aligned}$$
(9.2)

Furthermore, if \(\sigma =\pi _{k,\ell }\), then it is easy to see that

$$\begin{aligned} n_\sigma \bigl (\pi _{K,n-K}\bigr )= {\left\{ \begin{array}{ll} \left( {\begin{array}{c}K\\ k\end{array}}\right) \left( {\begin{array}{c}n-K\\ \ell \end{array}}\right) , &{} k\geqslant 2, \\ K\left( {\begin{array}{c}n-K\\ \ell \end{array}}\right) +\left( {\begin{array}{c}n-K\\ \ell +1\end{array}}\right) ,&k=1. \end{array}\right. } \end{aligned}$$
(9.3)

Theorem 9.2

Let \(\sigma \in \mathfrak {S}_*({132},{231}, {312})\). Then the following hold as \({n\rightarrow \infty }\), with \(U\sim \mathsf U(0,1)\).

  1. (i)

    If \(\sigma =\pi _{k,m-k}\) with \(2\leqslant k\leqslant m\), then

    $$\begin{aligned} n^{-m}n_\sigma (\varvec{\pi }_{{{132},{231}, {312}};n}) \overset{\mathrm {d}}{\longrightarrow }W_{k,m-k}:=\frac{1}{k!\,(m-k)!} U^k (1-U)^{m-k}. \end{aligned}$$
    (9.4)
  2. (ii)

    If \(\sigma =\pi _{1,m-1}=\iota _{m}\), then

    $$\begin{aligned} \begin{aligned} n^{-m}n_\sigma (\varvec{\pi }_{{{132},{231}, {312}};n}) \overset{\mathrm {d}}{\longrightarrow }W_{1,m-1}&:=\frac{1}{(m-1)!}U(1-U)^{m-1}+\frac{1}{m!}(1-U)^m\\&\phantom {:} =\frac{1}{m!}\bigl (1+(m-1)U\bigr )(1-U)^{m-1}. \end{aligned} \end{aligned}$$
    (9.5)

Moreover, these hold jointly for any set of such \(\sigma \), and with convergence of all moments. In particular, in case (i),

$$\begin{aligned} n^{-m}{\mathbb {E}{}}n_\sigma (\varvec{\pi }_{{{132},{231}, {312}};n}) \overset{\mathrm {d}}{\longrightarrow }{\mathbb {E}{}}W_{k,m-k}=\frac{1}{(m+1)!}, \qquad k\geqslant 2, \end{aligned}$$
(9.6)

and in case (ii),

$$\begin{aligned} n^{-m}{\mathbb {E}{}}n_\sigma (\varvec{\pi }_{{{132},{231}, {312}};n}) \overset{\mathrm {d}}{\longrightarrow }{\mathbb {E}{}}W_{1,m-1}=\frac{2}{(m+1)!}. \end{aligned}$$
(9.7)

Proof

The limits in distribution (9.4) and (9.5) hold (with joint convergence) by (9.3) and (9.2). Moment convergence holds because the normalized variables in (9.4) and (9.5) are bounded (by 1). Finally, the expectations in (9.6)–(9.7) are computed by standard beta integrals. \(\square \)

Corollary 9.3

The number of inversions has the asymptotic distribution

$$\begin{aligned} n^{-2}n_{{{21}}}(\varvec{\pi }_{{{132},{231}, {312}};n}) \overset{\mathrm {d}}{\longrightarrow }W:=U^2/2 \end{aligned}$$
(9.8)

with \(U\sim \mathsf U(0,1)\). Thus, \(2W\sim B(\frac{1}{2},1)\), and W has moments

$$\begin{aligned} {\mathbb {E}{}}W^r = \frac{1}{2^r(2r+1)}, \qquad r>0. \end{aligned}$$
(9.9)

Proof

We have \(21=\pi _{2,0}\) by (9.1), and (9.4) yields (9.8). The remaining statements follow by simple calculations. \(\square \)

10 Avoiding \(\{{132},{231}, {321}\}\)

In this section we avoid \(\{{132},{231}, {321}\}\). Equivalent sets are \(\{123,132,231\}\), \(\{123,213,312\}\), \(\{213,312,321\}\), \(\{123,132,312\}\), \(\{123,213,231\}\), \(\{132,312,321\}\), \(\{213,231,321\}\).

It was shown by Simion and Schmidt [20] that \(|\mathfrak {S}_n({132},{231}, {321})|=n\), together with the following characterization (in an equivalent form). In this section, let

$$\begin{aligned} \pi _{k,\ell }:=(k,1,\dots ,k-1,k+1,\dots ,k+\ell )\in \mathfrak {S}_{k+\ell }, \qquad k\geqslant 1,\,\ell \geqslant 0. \end{aligned}$$
(10.1)

Note that \(\pi _{k,\ell }\) equals \(\pi _{1,k-1,\ell }\) in the notation (7.1) of Sect. 7 if \(k\geqslant 2\), and \(\iota _{1+\ell }\) if \(k=1\).

Proposition 10.1

[20, Proposition \(16^*\)]

$$\begin{aligned} \mathfrak {S}_n({132},{231}, {321})=\{\pi _{k,n-k}:1\leqslant k\leqslant n\}. \end{aligned}$$

\(\square \)

Cf. Proposition 7.1, which characterizes a superset.

Hence, the random \(\varvec{\pi }_{{{132},{231}, {321}};n}=\pi _{K,n-K}\), where \(K\in [n]\) is uniformly random. Obviously, as \({n\rightarrow \infty }\), (9.2) holds in this case too. Furthermore, if \(\sigma =\pi _{k,\ell }\), then it is easy to see, e.g. by (7.4)–(7.5), that

$$\begin{aligned} n_\sigma \bigl (\pi _{K,n-K}\bigr )= {\left\{ \begin{array}{ll} \left( {\begin{array}{c}K-1\\ k-1\end{array}}\right) \left( {\begin{array}{c}n-K\\ \ell \end{array}}\right) , &{} k\geqslant 2, \\ \left( {\begin{array}{c}n-1\\ \ell +1\end{array}}\right) +\left( {\begin{array}{c}n-K\\ \ell \end{array}}\right) ,&k=1. \end{array}\right. } \end{aligned}$$
(10.2)

Theorem 10.2

Let \(\sigma \in \mathfrak {S}_*({132},{231}, {321})\). Then the following hold as \({n\rightarrow \infty }\), with \(U\sim \mathsf U(0,1)\).

  1. (i)

    If \(\sigma =\pi _{k,m-k}\) with \(2\leqslant k\leqslant m\), then

    $$\begin{aligned} n^{-(m-1)}n_\sigma (\varvec{\pi }_{{{132},{231}, {321}};n}) \overset{\mathrm {d}}{\longrightarrow }W_{k,m-k}:=\frac{1}{(k-1)!\,(m-k)!} U^{k-1} (1-U)^{m-k}.\nonumber \\ \end{aligned}$$
    (10.3)
  2. (ii)

    If \(\sigma =\pi _{1,m-1}=\iota _{m}\), then

    $$\begin{aligned} \begin{aligned} n^{-m}n_\sigma (\varvec{\pi }_{{{132},{231}, {321}};n}) =\frac{1}{m!}+O\bigl (n^{-1}\bigr ) \overset{\mathrm {p}}{\longrightarrow }\frac{1}{m!}. \end{aligned} \end{aligned}$$
    (10.4)

Moreover, these hold jointly for any set of such \(\sigma \), and with convergence of all moments. In particular, in case (i),

$$\begin{aligned} n^{-(m-1)}{\mathbb {E}{}}n_\sigma (\varvec{\pi }_{{{132},{231}, {321}};n}) \overset{\mathrm {d}}{\longrightarrow }{\mathbb {E}{}}W_{k,m-k}=\frac{1}{m!}, \qquad k\geqslant 2. \end{aligned}$$
(10.5)

Proof

By (10.2) and (9.2), similarly to the proof of Theorem 9.2. \(\square \)

Corollary 10.3

The number of inversions \(n_{21}(\varvec{\pi }_{{{132},{231}, {321}};n})\) has a uniform distribution on \(\{0,\dots ,n-1\}\), and thus the asymptotic distribution

$$\begin{aligned} n^{-1}n_{21}(\varvec{\pi }_{{{132},{231}, {321}};n}) \overset{\mathrm {d}}{\longrightarrow }U\sim \mathsf U(0,1). \end{aligned}$$
(10.6)

Proof

By (10.1), \(12=\pi _{2,0}\), and thus (10.2) yields \(n_{21}(\pi _{K,n-K})=K-1\). \(\square \)

11 Avoiding \(\{{132},{213}, {321}\}\)

In this section we avoid \(\{{132},{213}, {321}\}\). An equivalent sets is \(\{123,231,312\}\).

It was shown by Simion and Schmidt [20] that \(|\mathfrak {S}_n({132},{213}, {321})|=n\), together with the following characterization (in an equivalent form). In this section, let

$$\begin{aligned} \pi _{k,\ell }:=(\ell +1,\dots ,\ell +k,1,\dots ,\ell )\in \mathfrak {S}_{k+\ell }, \qquad k\geqslant 1,\,\ell \geqslant 0. \end{aligned}$$
(11.1)

Note that \(\pi _{k,\ell }\) equals \(\pi _{k,\ell ,0}\) in the notation (7.1) of Sect. 7 if \(\ell \geqslant 1\), and \(\iota _{k}\) if \(\ell =0\).

Proposition 11.1

([20, Proposition \(16^*\)])

$$\begin{aligned} \mathfrak {S}_n({132},{213}, {321})=\{\pi _{k,n-k}:1\leqslant k\leqslant n\}. \end{aligned}$$

\(\square \)

Cf. Proposition 7.1, which again characterizes a superset.

Hence, the random \(\varvec{\pi }_{{{132},{213}, {321}};n}=\pi _{K,n-K}\), where \(K\in [n]\) is uniformly random, and (9.2) holds again. Furthermore, if \(\sigma =\pi _{k,\ell }\), then it is easy to see, e.g. by (7.4)–(7.5), that

$$\begin{aligned} n_\sigma \bigl (\pi _{K,n-K}\bigr )= {\left\{ \begin{array}{ll} \left( {\begin{array}{c}K\\ k\end{array}}\right) \left( {\begin{array}{c}n-K\\ \ell \end{array}}\right) , &{} \ell \geqslant 1, \\ \left( {\begin{array}{c}K\\ k\end{array}}\right) +\left( {\begin{array}{c}n-K\\ k\end{array}}\right) ,&\ell =0. \end{array}\right. } \end{aligned}$$
(11.2)

Theorem 11.2

Let \(\sigma \in \mathfrak {S}_*({132},{213}, {321})\). Then the following hold as \({n\rightarrow \infty }\), with \(U\sim \mathsf U(0,1)\).

  1. (i)

    If \(\sigma =\pi _{k,m-k}\) with \(1\leqslant k\leqslant m-1\), then

    $$\begin{aligned} n^{-m}n_\sigma (\varvec{\pi }_{{{132},{213}, {321}};n}) \overset{\mathrm {d}}{\longrightarrow }W_{k,m-k}:=\frac{1}{k!\,(m-k)!} U^{k} (1-U)^{m-k}. \end{aligned}$$
    (11.3)
  2. (ii)

    If \(\sigma =\pi _{m,0}=\iota _{m}\), then

    $$\begin{aligned} n^{-m}n_\sigma (\varvec{\pi }_{{{132},{213}, {321}};n}) \overset{\mathrm {d}}{\longrightarrow }W_{m,0}:=\frac{1}{m!} \bigl (U^{m}+ (1-U)^{m}\bigr ). \end{aligned}$$
    (11.4)

Moreover, these hold jointly for any set of such \(\sigma \), and with convergence of all moments. In particular, in case (i),

$$\begin{aligned} n^{-m}{\mathbb {E}{}}n_\sigma (\varvec{\pi }_{{{132},{213}, {321}};n}) \overset{\mathrm {d}}{\longrightarrow }{\mathbb {E}{}}W_{k,m-k}=\frac{1}{(m+1)!}, \qquad 1\leqslant k < m, \end{aligned}$$
(11.5)

and in case (ii),

$$\begin{aligned} n^{-m}{\mathbb {E}{}}n_\sigma (\varvec{\pi }_{{{132},{213}, {321}};n}) \overset{\mathrm {d}}{\longrightarrow }{\mathbb {E}{}}W_{m,0}=\frac{2}{(m+1)!}. \end{aligned}$$
(11.6)

Proof

By (11.2) and (9.2), similarly to the proof of Theorem 9.2. \(\square \)

Corollary 11.3

The number of inversions has the asymptotic distribution

$$\begin{aligned} n^{-2}n_{{{21}}}(\varvec{\pi }_{{{132},{213}, {321}};n}) \overset{\mathrm {d}}{\longrightarrow }W:=U(1-U), \end{aligned}$$
(11.7)

with \(U\sim \mathsf U(0,1)\). Thus, \(4W\sim B(1,\frac{1}{2})\), and W has moments

$$\begin{aligned} {\mathbb {E}{}}W^r = \frac{\Gamma (r+1)^2}{\Gamma (2r+2)}, \qquad r>0. \end{aligned}$$
(11.8)

Proof

We have \(21=\pi _{1,1}\) by (11.1), and thus (11.3) yields (11.7). The remaining statements follow by simple calculations, using \(4W=1-(2U-1)^2\) and a beta integral. \(\square \)