Appendix A
Useful notions and facts
In this appendix we introduce most of the statistics on permutations and words ap- pearing in this book, as well as several well-known sequences of numbers and certain lattice paths. Also, we state in Table A.7 several classes of restricted permutations together with references and initial values of the corresponding sequences.
A.1 Statistics on permutations and words
Definition A.1.1. In a permutation π = π1π2 . . . πn, πi is a left-to-right maximum (resp., left-to-right minimum) if πi ≥ πj (resp., πi ≤ πj) for 1 ≤ j ≤ i. Also, πi is a right-to-left maximum (resp., right-to-left minimum) if πi ≥ πj (resp., πi ≤ πj) for i ≤ j ≤ n. Example A.1.2. If π = 3152647 then the left-to-right maxima are 3, 5, 6 and 7, the left-to-right minima are 3 and 1, the right-to-left maximum is 7, and the right-to-left minima are 7, 4, 2 and 1.
In Table A.1 we define all permutation statistics appearing in the book. The list of statistics is essentially taken from [259]. Note that many of the statistics defined make sense for words, though not all. For example, the statistic head .i, the position of the smallest letter, is not defined for words as we may have several instances of the smallest letter. The expression π∞ appearing in Table A.1 means the permutation beginning with π and ending with a letter that is larger that any letter in π. Remark A.1.3. Six statistics in Table A.1 have complex names like comp .r or last .i, which stands for respective compositions (see Definition 1.0.12 for meaning of the trivial bijections i and r). For example, to calculate the value of the statistic
S. Kitaev, Patterns in Permutations and Words, Monographs in Theoretical Computer Science. 387 An EATCS Series, DOI 10.1007/978-3-642-17333-2, © Springer-Verlag Berlin Heidelberg 2011 388 Appendix A. Useful notions and facts
Statistic Description asc # of ascents (letters followed by a larger letter = occurrences of 12) comp # of components (ways to factor π = στ so that each letter in non-empty σ is smaller than any letter in τ; the empty τ gives one such factorization) comp .r # of reverse components (ways to factor π = στso that each letter in non- empty σis larger than any letter in τ; the empty τgives one factorization) cyc # of cycles dasc # of double ascents (# of occurrences of the pattern 123) ddes # of double descents (# of occurrences of the pattern 321) des # of descents (letters followed by a smaller letter = occurrences of 21) exc # of excedances (positions i in π = π1π2 . . . πn such that πi > i) fp # of fixed points (positions i in π = π1π2 . . . πn such that πi = i) head the first (leftmost) letter head .i position of the smallest letter inv # of inversions (pairs i < j such that πi > πj in π = π1π2 . . . πn) last the last (rightmost) letter last .i position of the largest letter ldr length of leftmost decreasing run (largest i such that π1 > π2 > ··· > πi) lds length of the longest decreasing subsequence length # of letters lir length of leftmost increasing run (largest i such that π 1 < π2 < ··· < πi) lir .i = zeil.c, largest i such that 12 ··· i is a subsequence in π lis length of the longest increasing subsequence lmax # of left-to-right maxima lmin # of left-to-right minima maj sum of positions in which descents occur peak # of peaks (positions i in π such that πi−1 < πi > πi+1) peak .i #{ i | i is to the right of both i − 1 and i + 1} slmax largest i such that π1 ≥ π1, π1 ≥ π2,..., π1 ≥ πi (# of letters to the left of second left-to-right maximum in π∞) rank for π = π1π2 . . . πn, largest k such that πi > k for all i ≤ k (see [361]) rdr = lir.r, length of the rightmost decreasing run rmax # of right-to-left maxima rmin # of right-to-left minima rir = ldr.r, length of the rightmost increasing run valley # of valleys (positions i in π such that πi−1 > πi < πi+1) valley .i #{ i | i is to the left of both i − 1 and i + 1} zeil length of longest subsequence n(n − 1) ··· i in π of length n (see [815])
Table A.1: Definitions of permutation statistics appearing in the book. A.2 Numbers and lattice paths of interest 389
For π = 4523176 For π = 3265714 asc(π) = 3, comp(π) = 3, des(π) = 3 asc(π) = 3, comp(π) = 2, des(π) = 3 comp .r(π) = 1, exc(π) = 3, fp(π) = 0 comp .r(π) = 1, exc(π) = 4, fp(π) = 1 head(π) = 4, head .i(π) = 5, last(π) = 6 head(π) = 3, head .i(π) = 6, last(π) = 4 last .i(π) = 6, ldr(π) = 1, lds(π) = 3 last .i(π) = 5, ldr(π) = 2, lds(π) = 3 lir(π) = 2, lir .i(π) = 1, slmax(π) = 1 lir(π) = 1, lir .i(π) = 1, slmax(π) = 2 lmax(π) = 3, lmin(π) = 3, peak(π) = 3 lmax(π) = 3, lmin(π) = 3, peak(π) = 2 peak .i(π) = 1, lis(π) = 3, rdr(π) = 2 peak .i(π) = 2, lis(π) = 3, rdr(π) = 1 rmax(π) = 2, rmin(π) = 2, cyc(π) = 2 rmax(π) = 2, rmin(π) = 2, cyc(π) = 3 rir(π) = 1, valley .i(π) = 2, zeil(π) = 2 rir(π) = 2, valley .i(π) = 2, zeil(π) = 1 dasc(π) = 0, ddes(π) = 0, maj(π) = 12 dasc(π) = 0, ddes(π) = 0, maj(π) = 9 inv(π) = 9, valley(π) = 2, rank(π) = 2 inv(π) = 10, valley(π) = 3, rank(π) = 1
Table A.2: Values of permutation statistics introduced in Table A.1 on the permu- tations 4523176 and 3265714 (length(π) = 7 in both cases).
comp .r we can either follow the direct description of it in Table A.1, or we can take a permutation, apply to it the reverse operation r and calculate the value of the statistic comp on the obtained permutation. Similarly, a way to calculate last .i is to take a permutation, apply to it the inverse operation i, and to calculate the value of the statistic last on the obtained permutation.
Table A.2 provides examples supporting the definitions in Table A.1.
Remark A.1.4. As noted, not all permutation statistics can be translated into statistics for words. Similarly, not all word statistics can be translated into permu- tation statistics. For example, the statistic lev, which is the number of levels, is defined on words as the number of times two equal letters stay next to each other (e.g., lev(3114244333) = 4), is of interest in words, but has the trivial value zero on permutations.
A.2 Numbers and lattice paths of interest
In this section we collect definitions and some basic facts on selected numbers appear- ing in this book. For more information on particular objects of interest discussed below, one should consult other sources, such as standard texts in combinatorics (e.g., [743, 745]). 390 Appendix A. Useful notions and facts
A.2.1 Numbers involved
The Fibonacci numbers are named after Leonardo of Pisa (c. 1170 - c. 1250), who was known as Fibonacci. The Fibonacci numbers were known in ancient India, and there are many applications of these numbers. The n-th Fibonacci number is defined recursively as follows. F0 = 0, F1 = 1, and for n ≥ 2, Fn = Fn−1 + Fn−2. These numbers satisfy a countless number of identities. Letting √ 1 + 5 ϕ = ≈ 1.6180339887 ··· 2 denote the golden ratio, the n-th Fibonacci number is given by ϕn − (1 − ϕ)n ϕn − (−1/ϕ)n Fn = √ = √ . 5 5 √ n Thus, asymptotically Fn ∼ ϕ / 5. The generating function for the Fibonacci numbers is given by X x F (x) = F xn = . n 1 − x − x2 n≥0 The first few Fibonacci numbers, for n = 0, 1, 2,..., are
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144,....
The Catalan numbers are named after the Belgian mathematician Eug´ene Charles Catalan (1814–1894) and they appear in many counting problems. Catalan defined these numbers in [235] in 1838. For n ≥ 0, the n-th Catalan number is given by 1 2n (2n)! C = = . n n + 1 n (n + 1)!n!
A recursive way to define the Catalan numbers is as follows: C0 = 1 and Cn+1 = Pn i=0 CiCn−i for n ≥ 0, and asymptotically, the Catalan numbers grow as 4n C ∼ √ . n n3/2 π The generating function for the Catalan numbers is √ X 1 − 1 − 4x C(x) = C xn = . n 2x n≥0 The first few Catalan numbers, for n = 0, 1, 2,..., are
1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900,.... A.2 Numbers and lattice paths of interest 391
We refer the reader to www-math.mit.edu/~rstan/ec/catadd.pdf for an impres- sive collection by Stanley of different structures counted by the Catalan numbers. The Bell numbers are named after Eric Temple Bell (1883-1960). The n-th Bell number gives the number of partitions of a set with n elements. For example, there are five partitions for the 3-element set {a, b, c}: {{a}, {b}, {c}}, {{a}, {b, c}}, {{b}, {a, c}}, {{c}, {a, b}}, and {{a, b, c}}. The Bell numbers can be defined recur- sively as follows: B0 = B1 = 1 and n X n B = B . n+1 k k k=0 The exponential generating function of the Bell numbers is
X Bn x B(x) = xn = ee −1. n! n≥0 The (ordinary) generating function of the Bell numbers can be written as the fol- lowing continued fraction:
X 1 B xn = . n 1 · x2 n≥0 1 − 1 · x − 2 · x2 1 − 2 · x − 3 · x2 1 − 3 · x − . .. Asymptotically, these numbers grow as
1 n+ 1 λ(n)−n−1 B ∼ √ [λ(n)] 2 e , n n
W (n) n where λ(n) = e = W (n) and W is the Lambert W function. The first few Bell numbers, for n = 0, 1, 2,..., are 1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147, 115975,....
Stirling numbers of the first kind s(n, k) are the coefficients in the following expansion n X x(x − 1)(x − 2) ··· (x − n + 1) = s(n, k)xk. k=0 Unsigned Stirling numbers of the first kind n = |s(n, k)| = (−1)n−ks(n, k) k 392 Appendix A. Useful notions and facts count the number of permutations of n elements with k disjoint cycles. The unsigned Stirling numbers arise as coefficients in the following expansion:
n X n x(x + 1) ··· (x + n − 1) = xk. k k=0
See Table A.3 for the values of s(n, k) for 0 ≤ n ≤ 7 and 0 ≤ k ≤ 7. The following recurrence relation is well-known: n n − 1 n − 1 = (n − 1) + k k k − 1
0 n 0 for k > 0, with the initial conditions = 1 and = = 0. 0 0 n
n\k 0 1 2 3 4 5 6 7 0 1 1 0 1 2 0 -1 1 3 0 2 -3 1 4 0 -6 11 -6 1 5 0 24 -50 35 -10 1 6 0 -120 274 -225 85 -15 1 7 0 720 -1764 1624 -735 175 -21 1 Table A.3: The initial values for the Stirling numbers of the first kind.
A Stirling number of the second kind S(n, k) is the number of ways to partition a set of n objects into k groups. For example, given k = 2 and the 3-element set {a, b, c} there are three such partitions {{a}, {b, c}}, {{b}, {a, c}}, and {{c}, {a, b}}. The Stirling numbers of the second kind can be calculated using the following for- mula: k 1 X k S(n, k) = (−1)k−j jn. k! j j=0 See Table A.4 for the values of S(n, k) for 0 ≤ n ≤ 7 and 0 ≤ k ≤ 7. It follows Pn from definitions that Bn = k=0 S(n, k) providing a well-known relation between the Bell numbers and the Stirling numbers of the second kind. The Eulerian number A(n, m) (also denoted in some sources by E(n, m) or n ) is the number of n-permutations with m ascents (elements followed by m A.2 Numbers and lattice paths of interest 393
n\k 0 1 2 3 4 5 6 7 0 1 1 0 1 2 0 1 1 3 0 1 3 1 4 0 1 7 6 1 5 0 1 15 25 10 1 6 0 1 31 90 65 15 1 7 0 1 63 301 350 140 21 1 Table A.4: The initial values for the Stirling numbers of the second kind. larger elements). These numbers are coefficients of the Eulerian polynomials
n X n−m An(x) = A(n, m)x . m=0
An(x) appears as the numerator in an expression for the generating function of the sequence 1n, 2n, 3n,...:
∞ n X P A(n, m)xm+1 knxk = m=0 . (1 − x)n+1 k=1 The Eulerian numbers can be calculated using the recursion
A(n, m) = (n − m)A(n − 1, m − 1) + (m + 1)A(n − 1, m) with A(0, 0) = 1, or using a closed-form expression
m X n + 1 A(n, m) = (−1)k (m + 1 − k)n. k k=0
See Table A.5 for the values of A(n, m) for 0 ≤ n ≤ 7 and 0 ≤ m ≤ 7. Some of the properties of the Eulerian numbers, starting from two straightfor- ward ones, and one more related to the Bernoulli number Bn+1, are as follows:
A(n, m) = A(n, n − m − 1);
n−1 X A(n, m) = n!; m=0 394 Appendix A. Useful notions and facts
n\m 0 1 2 3 4 5 6 7 0 1 1 1 2 1 1 3 1 4 1 4 1 11 11 1 5 1 26 66 26 1 6 1 57 302 302 57 1 7 1 120 1191 2416 1191 120 1 Table A.5: The initial values for the Eulerian numbers.
n−1 n+1 n+1 X 2 (2 − 1)Bn+1 (−1)mA(n, m) = . n + 1 m=0 The Motzkin numbers are named after Theodore Motzkin (1908–1970). There are at least 14 equivalent different ways to combinatorially define the Motzkin num- bers. One way is to do it through the Motzkin paths defined in Subsection A.2.2 below. Another way is as follows. The n-th Motzkin number Mn is the number of different ways of drawing non-intersecting chords between n points on a circle. The generating function for the Motzkin numbers is √ X 1 − x − 1 − 2x − 3x2 1 M(x) = M xn = = n 2x2 x2 n≥0 1 − x − x2 1 − x − x2 1 − x − ... and these numbers begin as follows: 1, 1, 2, 4, 9, 21, 51, 127, 323, 835, 2188, 5798, 15511, 41835, 113634,....
The large Schr¨odernumbers, also called Schr¨odernumbers, are defined by the following recurrence relation:
n−1 X Sn = Sn−1 + SkSn−1−k, k=0 where S0 = 1. These numbers have the following generating function: √ 1 − x − 1 − 6x + x2 2x A.2 Numbers and lattice paths of interest 395 and they begin, for n = 0, 1, 2,... as 1, 2, 6, 22, 90, 394,.... The small Schr¨oder numbers have the following generating function √ 1 + x − 1 − 6x + x2 4x and they begin as 1, 1, 3, 11, 45, 197,.... It was discovered by David Hough and noted by Stanley [740] that the small Schr¨odernumbers were apparently known to Hipparchus over 2100 years ago. See Problem 6.39 in [745] for a list of 19 structures enumerated by the Schr¨odernum- bers, as well as for references for these numbers. We also refer to [717] and references therein, for discussions of several combinatorial objects counted by Schr¨odernum- bers. For n = 1, 2, 3,... and 1 ≤ k ≤ n, the Narayana numbers N(n, k) are defined as follows: 1 n n N(n, k) = . n k k − 1 These numbers are named after T. V. Narayana (1930–1987), a mathematician from India. It is known that N(n, 1) + N(n, 2) + ··· + N(n, n) = Cn linking the Narayana numbers to the Catalan numbers. The first eight rows of the Narayana triangle (presenting the non-zero numbers N(n, k)) are as in Table A.6.
n\k 1 2 3 4 5 6 7 8 1 1 2 1 1 3 1 3 1 4 1 6 6 1 5 1 10 20 10 1 6 1 15 50 50 15 1 7 1 21 105 175 105 21 1 8 1 28 196 490 490 196 28 1 Table A.6: The first eight rows of the Narayana triangle.
The Padovan numbers are named after Richard Padovan who attributed their discovery to Dutch architect Hans van der Lann in his 1994 essay Dom. Hans van der Laan : Modern Primitive. These numbers are defined recursively as follows: P (0) = P (1) = P (2) = 1 and P (n) = P (n − 2) + P (n − 3). The generating function for the Padovan numbers is X 1 + x P (x) = P (n)xn = . 1 − x2 − x3 n≥0 396 Appendix A. Useful notions and facts
The initial values of the Padovan numbers are as follows:
1, 1, 1, 2, 2, 3, 4, 5, 7, 9, 12, 16, 21, 28, 37, 49, 65, 86,....
The n-th harmonic number is the sum of reciprocals of the first n natural numbers: 1 1 1 H = 1 + + + ··· + . n 2 3 n Harmonic numbers were studied in antiquity and are important, e.g., in various branches of number theory. The following integral representation of Hn was given by Euler: Z 1 1 − xn Hn = dx. 0 1 − x The generating function for the harmonic numbers is
∞ X − ln(1 − x) H xn = . n 1 − x n=1
Asymptotically, Hn is given by ln(n). The study of Genocchi numbers goes back to Euler. The Genocchi numbers can be defined by the following generating function.
2t X t2n (A.1) = t + (−1)nG . et + 1 2n (2n)! n≥1
These numbers were studied intensively during the last three decades (see, e.g., [349] and references therein). Dumont [328] showed that the Genocchi number G2n is the number of permutations σ = σ1σ2 ··· σ2n+1 in S2n+1 such that
σi < σi+1 if σi is odd, σi > σi+1 if σi is even.
The first few Genocchi numbers are 1, 1, 3, 17, 155, 2073,....
A.2.2 Lattice paths involved
A lattice path for purposes of this book can be defined as a path in R2 all of whose coordinates are integers. A Dyck path of length 2n is a lattice path from (0, 0) to (2n, 0) with steps u = (1, 1) (“u” stands for “up”) and d = (1, −1) (“d” stands for “down”) that never A.2 Numbers and lattice paths of interest 397 goes below the x-axis. It is easy to see that if D denotes the set of all Dyck paths (of arbitrary length) then one has the following relation for D:
(A.2) D = 1 + udD + uDdD where 1 stands for a single point (0,0) which is a Dyck path by definition. In Figure A.1 one can find all Dyck paths of length 6.
Figure A.1: All Dyck paths of length 6.
The number of Dyck paths is given by the Catalan numbers. A Motzkin path of length n is a lattice path from (0, 0) to (n, 0) with steps u = (1, 1), d = (1, −1) and h = (1, 0) (“h” stands for “horizontal”) that never goes below the x-axis. It is easy to see that if M denotes the set of all Motzkin paths (of arbitrary length) then one has the following relation for M:
(A.3) S = 1 + hM + uMdM where 1 stands for a single point (0,0) which is a Motzkin path by definition. In Figure A.2 one can find all Motzkin paths of length 4.
Figure A.2: All Motzkin paths of length 4.
The number of Motzkin paths is given by the Motzkin numbers. A Schr¨oderpath of length 2n is a lattice path from (0, 0) to (2n, 0) with steps u = (1, 1), d = (1, −1) and h = (1, 0) that never goes below the x-axis and in which 398 Appendix A. Useful notions and facts runs of h-steps must be of even length. It is easy to see that if S denotes the set of all Schr¨oderpaths (of arbitrary length) then one has the following relation for S:
(A.4) S = 1 + hhS + uSdS where 1 stands for a single point (0,0) which is a Schr¨oderpath by definition. In Figure A.3 one can find all Schr¨oderpaths of length 4.
Figure A.3: All Schr¨oderpaths of length 4.
The number of Schr¨oderpaths is given by the large Schr¨odernumbers. These paths were introduced by Bonin et al. [152] in 1993.
A.3 Pattern-avoiding permutations
In this book we meet many classes of pattern-avoiding permutations. Some of the classes have attracted more attention in the literature, other less. In Table A.7 we collect selected classes of pattern-avoiding permutations that have attracted consid- erable attention in the literature. The table provides most of the relevant references and initial values for corresponding sequences. A.3 Pattern-avoiding permutations 399
Permutations Patterns Initial values Baxter [4, 98, 151] [167, 158, 272, 221, 257] 2413, 3142 1, 2, 6, 22, 92, 422, 2074, 10754,... [379, 250, 410, 326, 419] [436, 620, 581, 787] forest-like 1324, 21354 1, 2, 6, 22, 89, 379, 1661, 7405,... [160] = 1324, 2143 layered [140, 136] 231, 312 1, 2, 4, 8, 16, 32, 64, 128,... [132, 616, 661] Motzkin 132, 123 Motzkin numbers [359] 1, 2, 4, 9, 21, 51, 127, 323,... deque-restricted 1324, 2314 [540, 801, 73] large Schr¨odernumbers Schr¨oder 4231, 4132 1, 2, 6, 22, 90, 394, 1806, 8558,... [73, 546, 56, 679] separable [27, 338] 2413, 3142 [155, 469, 546, 734, 798] simple [25, 48, 22, 183] [188, 46, 94, 186, 189] no 1, 2, 0, 2, 6, 46, 338, 2926,... [187, 634, 714] smooth [706, 551, 807] 1324, 2143 1, 2, 6, 22, 88, 366, 1552, 6652,... [745, 130, 160, 444] vexillary 2143 1, 2, 6, 23, 103, 513, 2761, 15767,... [554, 742, 66, 764, 799] 2-stack sortable [799] 2341, 35241 [815, 323, 423, 156] 1, 2, 6, 22, 91, 408, 1938, 9614,... non-separable 2413, 41352 [324, 262] = 2413, 3142 Table A.7: Some pattern-avoiding classes of permutations appearing in the book together with several references and initial values of the corresponding sequences for 1 ≤ n ≤ 8. Note that one may need to apply trivial bijections to the prohibited patterns in order to get the patterns appearing under a particular reference. Appendix B
Some algebraic background
In this appendix we provide just a very few basic definitions related to the book, referring to more substantial sources on algebra related to combinatorics like [422] by Goulden and Jackson and [743] by Stanley, if needed. We discuss below the ring of formal power series (related to generating functions — an important notion for us) and Chebyshev polynomials of the second kind which appear several times in the book.
B.1 The ring of formal power series
Definition B.1.1. A ring is a set R equipped with two binary operations + from R × R to R and · from R × R to R, where × denotes the Cartesian product, called addition and multiplication, respectively. The set and two operations, (R, +, ·), must satisfy the following ring axioms:
• (R, +) is an abelian group under addition:
1. Closure under addition. For all a, b in R, the result of the operation a + b is also in R. 2. Associativity of addition. For all a, b, c in R, we have (a + b) + c = a + (b + c). 3. Existence of additive identity. There exists an element 0 in R, such that for all elements a in R, we have 0 + a = a + 0 = a. 4. Existence of additive inverse. For each a in R, there exists an element b in R such that a + b = b + a = 0. 5. Commutativity of addition. For all a, b in R, we have a + b = b + a.
401 402 Appendix B. Some algebraic background
• (R, ·) is required to be a monoid under multiplication: 1. Closure under multiplication. For all a, b in R, the result of the operation a · b is also in R. 2. Associativity of multiplication. For all a, b, c in R, we have (a·b)·c = a · (b · c). 3. Existence of multiplicative identity. There exists an element 1 in R, such that for all elements a in R, we have 1 · a = a · 1 = a. • The distributive laws: 1. For all a, b and c in R, we have a · (b + c) = (a · b) + (a · c). 2. For all a, b and c in R, we have (a + b) · c = (a · c) + (b · c). Definition B.1.2. A ring R is commutative if the multiplication operation is com- mutative, that is, if for all a, b in R, a · b = b · a.
In what follows, the term “formal” is used to indicate that convergence is not considered in the context, and thus formal power series need not represent functions on R. Definition B.1.3. Let R be a ring. We define the set R[[x]] of formal power series P n in the indeterminate x with coefficients from R to be all formal sums n≥0 anx . Further, we define addition and multiplication on formal power series, respectively, as follows: