Generating trees for permutations avoiding generalized patterns
Abstract
We construct generating trees with with one, two, and three labels for some classes of permutations avoiding generalized patterns of length 3 and 4. These trees are built by adding at each level an entry to the right end of the permutation, which allows us to incorporate the adjacency condition about some entries in an occurrence of a generalized pattern. We use these trees to find functional equations for the generating functions enumerating these classes of permutations with respect to different parameters. In several cases we solve them using the kernel method and some ideas of Bousquet-Mélou [2]. We obtain refinements of known enumerative results and find new ones.
Full text
GENERATING TREES FOR PERMUTATIONS AVOIDING GENERALIZED PATTERNS SERGI ELIZALDE Abstract. We construct generating trees with with one, two, and three labels for some classes of permutations avoiding generalized patterns of length 3 and 4. These trees are built by adding at each level an entry to the right end of the permutation, which allows us to incorporate the adjacency condition about some entries in an occurrence of a generalized pattern. We use these trees to find functional equations for the generating functions enumerating these classes of permutations with respect to different parameters. In several cases we solve them using the kernel method and some ideas of Bousquet-M´elou [2]. We obtain refinements of known enumerative results and find new ones. 1. Introduction 1.1. Generalized pattern avoidance. We denote by Snthe symmetric group on {1,2, . . . , n}. Let nand kbe two positive integers with k≤n, and let π=π1π2···πn∈ Snbe a permutation. A generalized pattern σis obtained from a permutation σ1σ2···σk∈ Skby choosing, for each j= 1, . . . , k −1, either to insert a dash - between σjand σj+1 or not. More formally, σ=σ1ε1σ2ε2···εk−1σk, where each εjis either the symbol - or the empty string. With this notation, we say that πcontains (the generalized pattern) σif there exist indices i1< i2< . . . < iksuch that (i) for each j= 1, . . . , k −1, if εjis empty then ij+1 =ij+ 1, and (ii) for every a, b ∈ {1,2, . . . , k},πia< πibif and only if σa< σb. In this case, πi1πi2···πikis called an occurrence of σin π. If πdoes not contain σ, we say that πavoids σ, or that it is σ-avoiding. For example, the permutation π= 3542716 contains the pattern 12-4-3 because it has the subsequence 3576. On the other hand, πavoids the pattern 12-43. We denote by Sn(σ) the set of permutations in Snthat avoid σ. More generally, if Σ = {σ1, σ2, . . .}is a collection of generalized patterns, we say that a permutation πis Σ-avoiding if it avoids all the patterns in Σ simultaneously. We denote by Sn(Σ) the set of Σ-avoiding permutations in Sn. 1
2SERGI ELIZALDE 1.2. Generating trees. Generating trees are a useful technique to enumerate classes of pattern-avoiding permutations (see for example [12, 13]). The nodes at each level of the generating tree are indexed by permutations of a given length. It is common in the literature to define the children of a permutation πof length nto be those permutations that are obtained by inserting the entry n+ 1 in π=π1π2···πnin such a way that the new permutation is still in the class. In this paper we consider a variation of this definition. Here, the children of a permutation πof length nare obtained by appending an entry to the right of π, and shifting up by one all the entries in πthat were greater than or equal to the new entry. For example, if the entry 3 is appended to the right of π= 24135, the child that we obtain is 251463. Adding the new entry to the right of the permutation makes these trees well-suited to enumerate permutations avoiding generalized patterns, as we will see in Sections 2, 3, and 4. We will refer to these trees as rightward generating trees. This kind of generating trees have been used in [1] to enumerate permutations avoiding sets of three generalized patterns of length three with one dash, such as {1-23,2-13,1-32}. For some classes of permutations, a label can be associated to each node of the tree in such a way that the number of children of a permutation and their labels depend only on the label of the parent. For example, in the tree for 1-2-3-avoiding permutations, we can label each node πwith m= min{πi:∃j < i with πj< πi}(or m=n+ 1 if π=n···21). Then, the children of a permutation with label (m) have labels (m+ 1),(2),(3), . . . , (m), corresponding to the appended entry being 1,2,3, . . . , m, respectively. This succession rule, together with the fact that the root (π= 1 ∈ S1) has label (2), completely determines the tree. From this rule one can derive a functional equation for the generating function that enumerates the permutations by their length and the label of the corresponding node in the tree. For generating trees with one label, these equations are well understood and their solutions are algebraic series. This is the case of the generating trees obtained in [1], for example. In other cases, however, one label is not enough to describe the generating tree in terms of a succession rule. In Section 3 we consider some classes of permutations avoiding generalized patterns where to describe the generating tree we need to assign two labels to each node. Generating trees with two labels were used in [2] to enumerate restricted permutations. In fact, the inspiration for the present paper and many of the ideas used come from Bousquet-M´elou’s work. One difference is that here trees are constructed by adding at each level an entry to the right end of the permutation, which
GENERATING TREES FOR PERMUTATIONS AVOIDING GENERALIZED PATTERNS 3 allows us to keep track of elements occurring in adjacent positions. In Section 4 we consider some classes of permutations whose rightward generating tree has three labels for each node. Given a permutation π∈ Sn, we will write r(π) = πnto denote the rightmost entry of π. In all our generating functions, the variable twill be used to mark the size of the permutation. 2. Generating trees with one label In this section we enumerate classes of pattern-avoiding permutations whose rightward generating trees can be described by a succession rule involving only one label for each node. For some of these classes, rightward generating trees are not the only way to obtain the results, but they are a tool that works in all these cases. The classes in this section avoid the pattern 2-1-3. Note that avoiding this pattern is equivalent to avoiding the generalized pattern 2-13. Indeed, if πcontains an occurrence of 2-1-3, say πiπjπkwith πj< πi< πk, then there must be some index lwith j≤l < k such that πl< πiand πl+1 > πi, so πiπlπl+1 is an occurrence of 2-13. For any class of permutations that avoid this pattern, the corresponding rightward generating tree has the property that the appended entry at each level can never be more than one unit larger than the entry appended at the previous level. 2.1. {2-1-3,2-31}-avoiding permutations. Recall that a permutation π is said to avoid the barred pattern 2-31 if every descent in π(an occurrence of 21) is part of an occurrence of 2-31; equivalently, for any index isuch that πi> πi+1 there is an index j < i such that πi> πj> πi+1. The bar indicates that the 2 is forced whenever a 31 occurs. For example, the permutation 4627513 avoids 2-31, but 2475613 does not. We use Mnto denote the n-th Motzkin number. Recall that Pn≥0Mn tn= 1−t−√1−2t−3t2 2t2. The next result seems to be a new interpretation of the Motzkin numbers. Proposition 2.1. The number of {2-1-3,2-31}-avoiding permutations of size nis Mn−1. Proof. Consider the rightward generating tree for {2-1-3,2-31}-avoiding permutations. Labeling each permutation with its rightmost entry r=r(π), this tree is described by the succession rule (1) (r)−→ (1) (2) ··· (r−1) (r+ 1).
4SERGI ELIZALDE Indeed, the new entry appended to the right of πcannot be greater than πn+ 1 in order for the new permutation to be 2-1-3-avoiding, and it cannot be πnbecause then it would create an occurrence of 21 that is not part of an occurrence of 2-31. Defining D(t, u) = Pn≥1Pπ∈Sn(2-1-3,2-31) ur(π)tn=Pr≥1Dr(t)ur, the succession rule above gives the following equation for the generating function: D(t, u) = tu +tX r≥1 Dr(t)(u+u2+···+ur−1+ur+1) =tu +t u−1[D(t, u)−uD(t, 1)] + tuD(t, u), which can be written as (1) µ1−t u−1−tu¶D(t, u) = tu −tu u−1D(t, 1). Now we apply the kernel method. The values of uas a function of tthat cancel the term multiplying D(t, u) on the left hand side are u0=u0(t) = 1+t±√1−2t−3t2 2t, of which the one with the minus sign is a well-defined formal power series in t. Substituting u=u0in (1) gives D(t, 1) = u0−1 = 1−t−√1−2t−3t2 2t, which is the generating function for the Motzkin numbers with the indices shifted by one. ¤ There is also a bijective proof of Proposition 2.1. Given a permutation π=π1π2···πn∈ Sn(2-1-3,2-31), we can construct a Dyck path of size n (i.e., a sequence of n U’s and n D’s so that no prefix contains more D’s than U’s) as follows. Recall that a right-to-left maximum of πis an entry πisuch that πi> πjfor all j > i. Let πi1, πi2, . . . , πimbe the right-to-left maxima of π, with i1< i2<··· < im=n. Consider the Dyck path Ui1Dπi1−πi2Ui2−i1Dπi2−πi3Ui3−i2···Dπim−1−πimUim−im−1Dπim, where exponentiation indicates repetition of a step. The condition that πis {2-1-3,2-31}-avoiding implies that this path contains no three consecutive steps UDU. It is not hard to see that this map is in fact a bijection between Sn(2-1-3,2-31) and UDU-free Dyck paths of size n. Such paths are in bijection with Motzkin paths of length n−1, as shown in [4]. The composition of these two bijections completes the bijective proof of Proposition 2.1.
GENERATING TREES FOR PERMUTATIONS AVOIDING GENERALIZED PATTERNS 5 2.2. {2-1-3,2o-31}-avoiding permutations. Extending the notion of barred patterns, we say that a permutation πavoids the pattern 2o-31 if every descent in πis the ‘31’ part of an odd number of occurrences of 2-31; equivalently, for any index isuch that πi> πi+1, the number of indices j < i such that πi> πj> πi+1 is odd. Proposition 2.2. The number of {2-1-3,2o-31}-avoiding permutations of size nis (2) |Sn(2-1-3,2o-31)|=(1 2k+1 ¡3k k¢if n= 2k, 1 2k+1 ¡3k+1 k+1 ¢if n= 2k+ 1. Proof. The rightward generating tree for {2-1-3,2o-31}-avoiding permutations is given by the succession rule (1) (r)−→ (r+ 1) (r−1) (r−3) ···, that is, the labels of the children of a node labeled rare the numbers 1 ≤j≤ r+1 such that r−jis odd. Let J(t, u) = Pn≥1Pπ∈Sn(2-1-3,2o-31) ur(π)tn= Pr≥1Jr(t)ur, and let Jo(t, u) = Prodd Jr(t)ur,Je(t, u) = Preven Jr(t)ur. The succession rule implies that J(t, u) = tu +tX rodd Jr(t)(u2+u4+···+ur−1+ur+1) +tX reven Jr(t)(u+u3+···+ur−1+ur+1) =tu +tu u2−1"X rodd Jr(t)(ur+2 −u) + X reven Jr(t)(ur+2 −1)# =tu +tu u2−1£u2Jo(t, u)−uJo(t, 1) + u2Je(t, u)−Je(t, 1)¤, so we get the following functional equation: (3) µ1−tu3 u2−1¶J(t, u) = tu −tu2 u2−1J(t, 1) + tu(u−1) u2−1Je(t, 1). The kernel 1 −tu3 u2−1as a function in the variable uhas three zeroes, two of which are complex conjugates. Denote them by u1=a(t) + b(t)iand u2= ¯u1=a(t)−b(t)i. Adding the equations 0 = u2 i−1−uiJ(t, 1)+(ui−1)Je(t, 1) for i= 1,2, we get a(t)J(t, 1) = a(t)2−b(t)2−1 + (a(t)−1)Je(t, 1), and subtracting them gives J(t, 1) = 2a(t) + Je(t, 1).
6SERGI ELIZALDE Solving this system of equations for J, we get that J(t, 1) = 2a(t)−a(t)2− b(t)2−1. Plugging the values of a(t) and b(t) yields the expression J(t, 1) = (2−3t)f(t)2+(9t−2−g(t))f(t)+(2 −6t)g(t)+54t2−18t−4 3tf(t)2, where g(t) = p3(27t2−4) and f(t) = [12tg(t)−108t2+ 8]1/3. It is easy to check that J=J(t, 1) is a root of the polynomial tJ3+(3t−2)J2+(3t−1)J+ t= 0. Using the Lagrange inversion formula, one sees that its coefficients are given by (2), which is sequence A047749 from the On-Line Encyclopedia of Integer Sequences [11]. Observe that we can also obtain an expression for J(t, u) using (3) and the fact that Je(t, 1) = −a(t)2−b(t)2−1. ¤ It is also possible to give a direct bijective proof of Proposition 2.2 that does not use rightward generating trees. A well-known combinatorial interpretation of the numbers (2) is that they enumerate lattice paths from (0,0) to (n, bn/2c) with steps E= (1,0) and N= (0,1) that never go above the line y=x/2. Here is a bijection from Sn(2-1-3,2o-31) to these paths. Let π=π1π2···πn∈ Sn(2-1-3,2o-31). Let πi1, πi2, . . . , πimbe the right- to-left maxima of π, with i1< i2<··· < im=n. The condition that π is {2-1-3,2o-31}-avoiding guarantees that all the differences πij−πij+1 are even. For j= 1, . . . , m −1, let aj= (πij−πij+1 )/2. Let am=bπim/2c. We map πto the following path from (0,0) to (n, bn/2c): Ei1Na1Ei2−i1Na2Ei3−i2Na3···Eim−im−1Nam. It can be checked that this map is a bijection. For example, if π= 4675123, we have πi1πi2πi3=π3π4π7= 753, so the corresponding path from (0,0) to (7,3) is EEENENEEEN. Analogously to the definition for the pattern 2o-31, we say that a permutation πavoids the pattern 2e-31 if every occurrence of 21 in πis part of an even number of occurrences of 2-31. We can also enumerate {2-1-3,2e-31}- avoiding permutations. Proposition 2.3. The number of {2-1-3,2e-31}-avoiding permutations of size nis 1 n bn/2c X k=0 ·2µn 2k¶µn−k k−1¶+n n−kµn 2k+ 1¶µn−k k¶¸. Proof. Let Q(t) = Pn≥1|Sn(2-1-3,2e-31)|tn. An argument similar to the proof of Proposition 2.2 shows that Q(t) equals (2 −4t)˜ f(t)2+ (−2 + 12t−7t2 −˜g(t)) ˜ f(t) + (2 −8t)˜g(t) + 8t3+ 46t2 −8t−4 3t˜ f(t)2,
GENERATING TREES FOR PERMUTATIONS AVOIDING GENERALIZED PATTERNS 7 where ˜g(t) = p3(−5t4+ 24t3−4t2+ 12t−4) and ˜ f(t) = [4(3t˜g(t)−11t3− 12t2−6t+ 2)]1/3. It follows that Q=Q(t) is a root of the polynomial tQ3+ (4t−2)Q2+ (4t−1)Q+t= 0. Applying Lagrange inversion we get the stated formula. ¤ 2.3. {2-1-3,2-3-41,3-2-41}-avoiding permutations. The rightward generating tree for this class of permutations has a simple succession rule. This allows us to enumerate them easily. Let K(t, u) = X n≥1X π∈Sn(2-1-3,2-3-41,3-2-41) ur(π)tn=X r≥1 Kr(t)ur. Proposition 2.4. The generating function for {2-1-3,2-3-41,3-2-41}- avoiding permutations where umarks the value of the rightmost entry is K(t, u) = 1−t−2tu −√1−2t−3t2 2t(1 u+1+u)−2. Proof. The succession rule for this class of permutations is (1) (r)−→ ((r−1) (r) (r+ 1) if r > 1, (r) (r+ 1) if r= 1. This translates into the functional equation (4) ·1−tµ1 u+ 1 + u¶¸K(t, u) = tu −tK1(t). Applying the kernel method we find that K1(t) = 1−t−√1−2t−3t2 2t, and substituting back into (4) we get the expression for K(t, u). ¤ The generating function K(t, 1) enumerates also {1-3-2,123-4}-avoiding permutations, as shown in [10, Example 2.6]. However, no direct bijection between Sn(2-1-3,2-3-41,3-2-41) and Sn(1-3-2,123-4) seems to be known. 3. Generating trees with two labels Here we enumerate some classes of permutations whose rightward generating tree has a succession rule that can be described using a pair of labels for each node. These trees give rise to functional equations with three variables. Even though no method is known to solve them in general, in this section we present special cases where we have been able to solve the corresponding equations. In a few cases, one of the two labels is the length of the permutation. When that happens, the functional equations have only two variables, but
8SERGI ELIZALDE the variable tappears multiplied by another variable, which makes these equations more difficult than the ones in Section 2. Note that for the classes that we consider in this section, the enumeration of the permutations by their length has already been done by different authors. Our contribution is a refined enumeration of these permutations by several parameters, and also the fact that our results are obtained using the unifying framework of rightward generating trees. 3.1. {2-1-3,12-3}-avoiding permutations. It was shown by Claesson [5] that |Sn(1-3-2,1-23)|=Mn. A bijection between Sn(1-3-2,1-23) and the set of Motzkin paths of length nwas given in [7]. Clearly the sets Sn(1-3-2,1-23) and Sn(2-1-3,12-3) are equinumerous, since a permutation π1π2···πnis {1-3-2,1-23}-avoiding exactly when (n+ 1 −πn)···(n+ 1 −π2)(n+ 1 − π1) is {2-1-3,12-3}-avoiding. In this section we recover the formula for |Sn(2-1-3,12-3)|using a generating tree with two labels. This method provides a refined enumeration of {2-1-3,12-3}-avoiding permutations by two new parameters: the value of the last entry and the smallest value of the top of an ascent. Let T1be the rightward generating tree for the set of {2-1-3,12-3}- avoiding permutations. Given any π∈ Sn, define the parameter (5) l(π) = (n+ 1 if π=n(n−1) ···21, min{πi:i > 1, πi−1< πi}otherwise. Let each permutation πbe labeled by the pair (l, r) = (l(π), r(π)). Note that if πavoids {2-1-3,12-3}, then necessarily l≥r. Lemma 3.1. The rightward generating tree T1for {2-1-3,12-3}-avoiding permutations is specified by the following succession rule on the labels: (2,1) (l, r)−→ ((l+ 1,1) (l+ 1,2) ··· (l+ 1, l)if l=r, (l+ 1,1) (l+ 1,2) ··· (l+ 1, r) (r+ 1, r + 1) if l > r. Proof. The permutation obtained by appending an entry to the right of π∈ Sn(2-1-3,12-3) is 2-1-3-avoiding if and only if the appended entry is at most r(π) + 1, and it is 12-3-avoiding if and only if the appended entry is at most l(π). The labels of the children are obtained by looking at how the values of (l, r) change when the new entry is added. ¤ We will use this generating rule to obtain a formula for the generating function M(t, u, v) := X n≥1X π∈Sn(2-1-3,12-3) ul(π)vr(π)tn.
GENERATING TREES FOR PERMUTATIONS AVOIDING GENERALIZED PATTERNS 9 For fixed land r, let Ml,r(t) = Pn≥1|{π∈ Sn(2-1-3,12-3) : l(π) = l, r(π) = r}| tn. Note that M(t, u, v) = Pl,r Ml,r(t)ulvr. Proposition 3.2. The generating function M(t, u, v)for {2-1-3,12-3}- avoiding permutations where uand vmark the parameters land rdefined above, respectively, equals [(1−u)v+c1t+c2t2+c3t3+c4t4−((1 −u)v+tu+t2u2v)√1−2t−3t2)]u2v 2(1 −u−tu(1 −u) + t2u2)(1 −uv +tuv +t2u2v2), where c1= 2 −u−v−uv + 2u2v,c2=u(−1 + (2 −u)v+ 2(u−1)v2), c3=u2v(−3 + 2v−2uv), and c4=−2u3v2. Substituting u=v= 1 in the above expression we recover the generating function for the Motzkin numbers. Proof. The coefficient of tnin M(t, u, v) is the sum of ulvrover all the pairs (l, r) of labels that appear at level nof the tree. By Lemma 3.1, the children of a node with labels (l, l) contribute ul+1v+ul+1v2+···+ul+1vlto the next level, and the children of a node with labels (l, r) with l > r contribute ul+1v+ul+1v2+···+ul+1vr+ur+1vr+1. It follows that M(t, u, v) = tu2v+tX l Ml,l(t)ul+1(v+v2+···+vl)(6) +tX l>r Ml,r(t)[ul+1(v+v2+···+vr) + ur+1vr+1]. It will be convenient to define M>(t, u, v) := X n≥1X π∈Sn(2-1-3,12-3) with l(π)>r(π) ul(π)vr(π)tn, M=(t, u, v) := X n≥1X π∈Sn(2-1-3,12-3) with l(π)=r(π) (uv)l(π)tn,
16 SERGI ELIZALDE Now we apply the kernel method again, this time taking w=1+t 1−2tto cancel the term multiplying ˜ H(t, w, 1). This gives the formula for ˜ H(t, 1,1), namely ˜ H(t, 1,1) = t(1 −t) 1−3t+t2. Substituting this expression back into (18) we get the formula for ˜ H(t, w, 1), which then we use in (17) to obtain ˜ H(t, w, v) = tw2[1 + (v−3)t+ (1 −v+v2)t2] v(1 −3t+t2)(1 −tw), and now we just use that H(t, u, v) = ˜ H(t, uv, v). ¤ 3.5. {12-34,2-1-3}-avoiding permutations.It was proved by Mansour [10] that the generating function for permutations avoiding {12-34,2-1-3}is 1−2t−t2−√1−4t+2t2+t4 2t2. Using the labels (l, r) defined as in (5), we can construct a generating tree with two labels for this class of permutations. The proof of the following lemma is straightforward and analogous to that of Lemma 3.1. Lemma 3.10. The rightward generating tree for {12-34,2-1-3}-avoiding permutations is specified by the following succession rule on the labels: (2,1) (l, r)−→ (l+1,1) (l+1,2) ··· (l+1, r) (r+1, r+1) if l > r, (l+1,1) (l+1,2) ··· (l+1, l) (l, l+1) if l=r, (l+1,1) (l+1,2) ··· (l+1, l) (l, l+1) (l, l+2) ··· (l, r) if l < r. Let F(t, u, v) := Pn≥1Pπ∈Sn(12-34,2-1-3)ul(π)vr(π)tn, and let F>(t, u, v), F=(t, u, v), and F<(t, u, v) be defined similarly, with the summation restricted to permutations with l(π)> r(π), l(π) = r(π), and l(π)< r(π), respectively. By definition, F(t, u, v) = F>(t, u, v)+F=(t, u, v)+F<(t, u, v). Proposition 3.11. The generating function for {12-34,2-1-3}-avoiding permutations where uand vmark the parameters land rdefined above is F(t, u, v) = u2v[p1(t, u, v) + p2(t, u, v)√1−4t+ 2t2+t4] 2[(1 + tuv)2−uv −t−uvt2][1 + (u+t)(tu −1)], where p1(t, u, v) = (1 −u)v+ (2 −u−4v+ 2uv +v2+ 2u2v−uv2)t+ (−4 + u+ 6v+uv −3v2−6u2v+ 3u2v2)t2+ (2 + u−4v−5uv + 3v2+ 4uv2−4u2v2−2u3v2+ 2u2v3−2v3u+ 4u2v)t3+ (−u+v+ 4uv −u2v2− 4uv2−2u3v3−v2+2u3v2+2v3u)t4−uv(v−1)(2uv −1)t5, and p2(t, u, v) = (u−1)v+ [(u−1)v(v−2) −u]t+ (u−v+v2−u2v2)t2+uv(1 −v)t3.
GENERATING TREES FOR PERMUTATIONS AVOIDING GENERALIZED PATTERNS 17 Note that this expression becomes much simpler if we ignore the parameter r, that is, F(t, u, 1) = u2(1 −2tu −t2−√1−4t+ 2t2+t4) 2[1 + (u+t)(tu −1)] , and coincides with the result from [10] if we ignore both parameters: F(t, 1,1) = 1−2t−t2−√1−4t+ 2t2+t4 2t2. Proof. From Lemma 3.10 we get the following functional equations defining F>,F=, and F<. F>(t, u, v) = tu2v+tuv v−1[F>(t, u, v)−F>(t, u, 1) + F=(t, u, v)(19) −F=(t, u, 1) + F<(t, uv, 1) −F<(t, u, 1)], F=(t, u, v) = tuvF>(t, 1, uv),(20) F<(t, u, v) = tvF=(t, u, v) + tv v−1[F<(t, u, v)−F<(t, uv, 1)].(21) We can introduce a variable w=uv in (21), and apply the kernel method with v=1 1−tto get that F<(t, w, 1) = t2wF>(t, 1, w) 1−t. Using this expression together with (20) in (19), we get an equation that involves only F>: µ1−tuv v−1¶F>(t, u, v)(22) =tu2v−tuv v−1·F>(t, u, 1) + tuv 1−tF>(t, 1, uv)−tu 1−tF>(t, 1, u)¸. Substituting u= 1, it becomes (23) (1 −v−t+ 2tv −vt2+v2t2) (1 −v)(1 −t)F>(t, 1, v) = tv +tv (1 −v)(1 −t)F>(t, 1,1). We apply the kernel method again, this time with v=1−2t+t2−√1−4t+2t2 +t4 2t2 to cancel the left hand side of (23), which yields F>(t, 1,1) = 1−3t+t2+t3+ (t−1)√1−4t+ 2t2+t4 2t2. Now we can use (23) to obtain a formula for F>(t, 1, v). Applying again the kernel method in (22), with v=1 1−tu , we get an expression for F>(t, u, 1) in terms ofF>(t, 1, u) and F>(t, 1,u 1−tu ), and therefore a formula forF>(t, u, 1).
18 SERGI ELIZALDE Substituting back into (22), we get a formula for F>(t, u, v). From this it is straightforward to obtain formulas for F<(t, u, v) and F=(t, u, v) as well, and the result follows. ¤ 3.6. 1-23-avoiding permutations. It was shown in [5] that the number of 1-23-avoiding permutations of size nis the n-th Bell number. In [9] the authors use an approach similar to ours to enumerate these permutations. Their so-called scanning-elements algorithm finds a system of recurrence relations for the number of permutations that start with a particular entry. Then, from these equations they obtain a functional equation satisfied by the generating function for 1-23-avoiding permutations. We show here how essentially the same functional equation is obtained using generating trees with two labels. The labels are particularly easy in this case because we can take one of them to be just the length nof the permutation. The labels of π∈ Snare then (r, n), where r=πnas usual. The advantage of having one of the labels be nis that we do not need an extra variable for this label in the generating function, since it is already encoded in the exponent of the variable t. Lemma 3.12. The rightward generating tree for 1-23-avoiding permutations is specified by the following succession rule on the labels: (1,1) (r, n)−→ ((1, n + 1) (2, n + 1) ··· (n+ 1, n + 1) if r= 1, (1, n + 1) (2, n + 1) ··· (r, n + 1) if r > 1. Proof. If the rightmost entry of πis 1, there is no restriction on the elements that can be appended to it. However, if the rightmost entry is greater than 1, then it cannot be smaller than the new appended entry. ¤ We define G(t, u) := Pn≥1Pπ∈Sn(1-23) ur(π)tn. For fixed r, let gn,r = |{π∈ Sn(1-23) : r(π) = r}|, and let Gr(t) = Pn≥1gn,rtn. Note that G(t, u) = PrGr(t)ur=Pn,r gn,rurtn. Proposition 3.13. The generating function G(t, u)for 1-23-avoiding permutations where umarks the value of the rightmost entry is 1−u 1−u+tu tu +t2u2+tu u−1X k≥1µtk+1uk+2 (1 −tu)(1 −2tu)···(1 −ktu) −(1 + tu)tk (1 −t)(1 −2t)···(1 −kt)¶¸.
GENERATING TREES FOR PERMUTATIONS AVOIDING GENERALIZED PATTERNS 19 Proof. Lemma 3.12 gives the following recurrence for G. G(t, u) = tu +t X r>1 Gr(t)ur+1 −u u−1+X n≥1 gn,1tnun+2 −u u−1 (24) =tu+tu u−1[(G(t, u)−uG1(t))−(G(t, 1)−G1(t))+uG1(tu)−G1(t)] . Since every node has exactly one child with r= 1, we have that G1(t) = t+t G(t, 1). Using this in (24) and collecting the terms with G(t, u), we get (25) µ1−tu u−1¶G(t, u) = tu +t2u2+tu u−1£tu2G(tu, 1) −(1 + tu)G(t, 1)¤. Applying the kernel method with u=1 1−tyields the functional equation G(t, 1) = t 1−tµ1 + G(t 1−t,1)¶, which agrees with [9]. By iterated application of this formula, G(t, 1) = t 1−tµ1 + t 1−2tµ1 + t 1−3tµ1 + t 1−4t(1 + ···)¶¶¶ =X k≥1 tk (1 −t)(1 −2t)···(1 −kt), which is the well-known ordinary generating function for the Bell numbers. Substituting this expression back into (25) we get the desired formula for G(t, u). ¤ 3.7. {1-23,3-12}-avoiding permutations. An argument very similar to the one in the previous section gives us the generating function for the number of {1-23,3-12}-avoiding permutations. These permutations were studied in [6], where they showed that if we let bn=|Sn(1-23,3-12)|, then these numbers satisfy the recurrence bn+2 =bn+1 +Pn k=0 ¡n k¢bk. Here we obtain a generating function without going through the recurrence. The labels that we assign to π∈ Snare again (r, n), where r=πn. The following lemma is analogous to Lemma 3.12. Lemma 3.14. The rightward generating tree for {1-23,3-12}-avoiding permutations is specified by the following succession rule on the labels: (1,1) (r, n)−→ ((1, n + 1) (n+ 1, n + 1) if r= 1, (1, n + 1) (2, n + 1) ··· (r, n + 1) if r > 1. Let P(t, u) := Pn≥1Pπ∈Sn(1-23,3-12) ur(π)tn=PrPr(t)ur.
20 SERGI ELIZALDE Proposition 3.15. The generating function P(t, 1) for {1-23,3-12}- avoiding permutations is X k≥1 t2k−1(1 −(k−1)t) (1 −t)2(1 −2t)2···(1 −kt)2. Proof. From Lemma 3.14 we get P(t, u)(26) =tu+tu u−1(P(t, u)−uP1(t)−P(t, 1)+P1(t))+tu(P1(t)+P1(tu)). Using that P1(t) = t+t P(t, 1) and collecting the terms with P(t, u), we get (27) µ1−tu u−1¶P(t, u)=tu+t2u2+t2u2P(tu, 1)+µt2u+tu(t−1−tu) u−1¶P(t, 1). Substituting u=1 1−tgives P(t, 1) = t (1 −t)2µ1 + tP(t 1−t,1)¶, and by iterated application of this formula, P(t, 1) = t (1 −t)2µ1 + t2(1 −t) (1 −2t)2µ1 + t2(1 −2t) (1 −t)(1 −3t)2 µ1 + t2(1 −3t) (1 −2t)(1 −4t)2(1 + ···)¶¶¶ =t (1 −t)2+t3 (1 −t)(1 −2t)2+t5 (1 −t)2(1 −2t)(1 −3t)2 +t7 (1 −t)2(1 −2t)2(1 −3t)(1 −4t)2+··· , which is the formula above. We could substitute this expression back into (27) we get the refined formula for P(t, u). ¤ 3.8. 123-avoiding permutations. Permutations avoiding the consecutive pattern 123 were studied in [8], where the authors give their exponential generating function. We can describe a generating tree with two labels for this class of permutations, where one label is just the length of the permutation. These labels are colored, meaning that a pair of labels consists of its two components plus one of two possible “colors”. To each π∈ Sn(123) we assign the pair (πn, n) if πn−1> πnor n= 1, and the pair (πn, n)0if πn−1< πn(some authors [1] call this a colored succession rule).
GENERATING TREES FOR PERMUTATIONS AVOIDING GENERALIZED PATTERNS 21 Lemma 3.16. The rightward generating tree for 123-avoiding permutations is specified by the following succession rule on the labels: (1,1) (r, n)−→ (1, n + 1) (2, n + 1) ···(r, n + 1) (r+ 1, n + 1)0(r+ 2, n + 1)0···(n+ 1, n + 1)0 (r, n)0−→ (1, n + 1) (2, n + 1) ···(r, n + 1). Proof. If πn−1> πn, we can append any entry to πwithout creating a 123. If πn−1< πn, the appended entry cannot be larger than r=πn.¤ Let A(t, u) := tu+X n≥2X π∈Sn(123) with πn−1>πn ur(π)tn, B(t, u) := X n≥2X π∈Sn(123) with πn−1<πn ur(π)tn, and let C(t, u) = A(t, u) + B(t, u). Lemma 3.16 provides these functional equations defining Aand B: A(t, u) = tu +tu u−1[C(t, u)−C(t, 1)], B(t, u) = tu u−1[uA(tu, 1) −A(t, u)]. The ideas in the rest of this proof are due by Mireille Bousquet-M´elou [3]. The second equation implies that C(t, u) = A(t, u)+ tu u−1[uA(tu, 1)−A(t, u)], and substituting this back into the first equation, we get (28) (1 −u)2+tu(1 −u) + t2u2 (u−1)2A(t, u) = tu+t2u3 (u−1)2A(tu, 1)−tu u−1C(t, 1). The kernel of this equation is (1 −u)2+t(u−u2) + t2u2. Solving for u, the two solutions are u1=1 1−αt, u2=1 1−¯αt,where α=1 + i√3 2,¯α=1−i√3 2. Substituting u=ujin (28), we get C(t, 1) = tu2 j uj−1A(tuj,1) + uj−1, for j= 1,2. We can use the equation for j= 1 to write A(x, 1) in terms of C(x/u1,1), and then substitute the result in the equation for j= 2. After simplifying, we get the following expression that involves only C(,1): C(t, 1) = 3 + i√3 2(3t−i√3) Cµt 1 + i√3t,1¶−3(2t+ 1 −i√3)t (2t−1−i√3)(3t−i√3).
22 SERGI ELIZALDE Extracting the coefficient of tnin both sides of the equation, we obtain a recurrence relation for the coefficients |Sn(123)|of C(t, 1). This recurrence can be translated into an equation for the exponential generating function of these coefficients. We get that X n≥0|Sn(123)|tn n!=√3 2 et/2 cos(√3 2t+π 6). 4. Generating trees with three labels In this section we include two instances of permutations avoiding generalized patterns where the rightward generating tree can be described by a succession rule with three labels. One of these labels is the length of the permutation, so that the functional equations that we obtain have three variables instead of four. However, the fact that the variable tappears multiplied by another variable adds some difficulty to the equations. To the best of our knowledge, the two classes of restricted permutations considered in this section have never been enumerated before. 4.1. {1-23,3-12,34-21}-avoiding permutations. Given a permutation π∈ Sn, let s(π) be defined as in (14). We associate to πthe triple of labels (s, r, n) = (s(π), r(π), n). Lemma 4.1. The rightward generating tree for {1-23,3-12,34-21}-avoiding permutations is specified by the following succession rule on the labels: (0,1) (s, r, n)−→ (s+1,1, n+1) (s+1,2, n+1) ··· (s+1, s, n+1) (s, s+1, n+1) (s, s+2, n+1) ··· (s, r, n+1) if s < r 6= 1, (0,1, n+1) (1, n+1, n+1) if (s, r) = (0,1), (s, n+1, n+1) if s > r = 1, ∅if s > r > 1. Proof. If r > 1, the appended entry has to be at most rfor the new permutation to avoid 1-23. If s > r, it has to be at least r+ 1 for the new permutation to avoid 34-21. Finally, if r= 1, the appended entry has to be n+ 1 for the permutation to avoid 3-12, unless s= 0, which means that π is the decreasing permutation. Combining these conditions we get the four possible cases and the new labels in each case. ¤
GENERATING TREES FOR PERMUTATIONS AVOIDING GENERALIZED PATTERNS 23 The four cases in the succession rule above suggest dividing the set Θ of values that the pair (s, r) can take into four disjoint sets: Θ1={(s, r) : s < r6= 1}, Θ2={(0,1)}, Θ3={(s, r) : s>r= 1}, Θ4={(s, r) : s > r > 1}. For i= 1,2,3,4, let Ri(t, u, v) := X n≥1X π∈Sn(1-23,3-12,34-21) with (s(π),r(π))∈Θi us(π)vr(π)tn, and let R(t, u, v) = R1(t, u, v) + R2(t, u, v) + R3(t, u, v) + R4(t, u, v). Proposition 4.2. The generating function for {1-23,3-12,34-21}-avoiding permutations where umarks the parameter sdefined above is (29) 1 + R(t, u, 1) = X k≥0 t2kuk(1 + ktu) (1 −(k+ 1)t)Qk−1 j=1 (1 −jt). Proof. Lemma 4.1 translates into the following equations for the generating functions Ri: R1(t, u, v) = tuvR2(tv, 1,1) + tvR3(tv, u, 1) +tv v−1[R1(t, u, v)−R1(t, uv, 1)], R2(t, u, v) = tv 1−t, R3(t, u, v) = tuvR1(t, u, 1),(30) R4(t, u, v) = tuv v−1[R1(t, uv, 1) −vR1(t, u, 1)].(31) Combining them we get an equation involving only R1: R1(t, u, v) = t2uv2 1−tv +t2uv2R1(tv, u, 1) + tv v−1[R1(t, u, v)−R1(t, uv, 1)]. If we collect on one side the terms with R1(t, u, v), the kernel of the equation is 1 −tv v−1. Introducing a new variable w=uv and then canceling the kernel with v=1 1−t, we obtain an expression that involves R1(t, w, 1) and R1(t 1−t,(1 −t)w, 1), which can be simplified to R1(t, w, 1) = tw2·1 1−2t+1 1−tR1µt 1−t,(1 −t)w, 1¶¸.
24 SERGI ELIZALDE By iterated application of this formula, R1(t, u, 1) = t2uµ1 1−2t+t2u 1−tµ1 1−3t+t2u 1−2tµ1 1−4t+···¶¶¶ =t2u 1−2t+(t2u)2 (1 −t)(1 −3t)+(t2u)3 (1 −t)(1 −2t)(1 −4t) +(t2u)4 (1 −t)(1 −2t)(1 −3t)(1 −5t)+··· =X k≥1 t2kuk (1 −(k+ 1)t)Qk−1 j=1 (1 −jt). Equation (30) gives now an expression for R3(t, u, 1), and (31) implies that R4(t, u, v) = X k≥1 t2k+1uk+1(v2+v3+···+vk) (1 −(k+ 1)t)Qk−1 j=1 (1 −jt). Adding up the four generating functions R(t, u, 1) = R1(t, u, 1)+R2(t, u, 1)+ R3(t, u, 1) + R4(t, u, 1) we get (29). ¤ The first coefficients of R(t, 1,1) are 1,2,4,8,19,47,125, . . . 4.2. {1-23,34-21}-avoiding permutations. The derivation of the generating function for this class of permutations is very similar to the previous subsection. The labels that we associate to a permutation are again (s, r, n). The proof of the next lemma is analogous to that of Lemma 4.1. Lemma 4.3. The rightward generating tree for {1-23,34-21}-avoiding permutations is specified by the following succession rule on the labels: (0,1) (s, r, n)−→ (s+ 1,1, n + 1) (s+ 1,2, n + 1) ··· (s+ 1, s, n + 1) (s, s + 1, n + 1) (s, s + 2, n + 1) ··· (s, r, n + 1) if s < r 6= 1, (0,1, n + 1) (1,2, n + 1) (1,3, n + 1) ··· (1, n + 1, n + 1) if (s, r) = (0,1), (s+ 1,2, n + 1) (s+ 1,3, n + 1) ··· (s+ 1, s, n + 1) (s, s + 1, n + 1) (s, s + 2, n + 1) ··· (s, n + 1, n + 1) if s > r = 1, ∅if s > r > 1.
GENERATING TREES FOR PERMUTATIONS AVOIDING GENERALIZED PATTERNS 25 Divide the set Θ of values that the pair (s, r) can take into four disjoint sets Θi,i= 1,2,3,4 as before, and let Ti(t, u, v) := X n≥1X π∈Sn(1-23,34-21) with (s(π),r(π))∈Θi us(π)vr(π)tn and T(t, u, v) = T1(t, u, v) + T2(t, u, v) + T3(t, u, v) + T4(t, u, v). Proposition 4.4. The generating function for {1-23,34-21}-avoiding permutations where umarks the parameter sdefined above is (32) T(t, u, 1) = X k≥0 tk+1uk(1 + ktu) (1 + tu)k(1 −kt)(1 −(k+ 1)t). Proof. The equations that follow from Lemma 4.3 are now T1(t, u, v) = tuv v−1[T2(tv, 1,1) −T2(t, 1,1)] +tv v−1[vT3(tv, u, 1) −T3(t, uv, 1)] +tv v−1[T1(t, u, v)−T1(t, uv, 1)], T2(t, u, v) = tv 1−t, T3(t, u, v) = tuvT1(t, u, 1),(33) T4(t, u, v) = tuv v−1[T1(t, uv, 1) + T3(t, uv, 1)(34) −vT1(t, u, 1) −vT3(t, u, 1)]. From them we can get an equation involving only T1: T1(t, u, v)= t2uv2 v−1µv 1−tv −1 1−t¶+t2uv2 v−1[vT1(tv, u, 1)−T1(t, uv, 1)] +tv v−1[T1(t, u, v)−T1(t, uv, 1)]. Letting w=uv and canceling the kernel multiplying T1(t, u, v) with v=1 1−t, we get that T1(t, w, 1) = tw (1 + tw)(1 −t)·t 1−2t+T1µt 1−t,(1 −t)w, 1¶¸. Iterating this formula, we see that T1(t, u, 1) = X k≥1 tk+1uk (1 + tu)k(1 −kt)(1 −(k+ 1)t).