String pattern avoidance in generalized non-crossing trees

The problem of string pattern avoidance in generalized non-crossing trees is studied. The generating functions for generalized non-crossing trees avoiding string patterns of length one and two are obtained. The Lagrange inversion formula is used to obtain the explicit formulas for some special cases. A bijection is also established between generalized non-crossing trees with special string pattern avoidance and little Schr¨oder paths.


Introduction
A non-crossing tree (NC-tree for short) is a tree drawn on n vertices in {1, 2, • • • , n} arranged in counterclockwise order along a circle such that the edges lie entirely within the circle and do not cross.Noncrossing trees have been investigated by Chen and Yan [1], Deutsch and Noy [3], Flajolet and Noy [4], Gu, et al. [5], Hough [6], Noy [7], Panholzer and Prodinger [8].Recently, some problems of pattern avoidance in NC-trees have been studied by Sun and Wang [14].It is well known that the set of NC-trees with n + 1 vertices is counted by the generalized Catalan number 1 2n+1 3n n [12, A001764].A generalized non-crossing tree (GNC-tree for short) is a generalization of ordinary non-crossing tree such that the vertices along the circle are not necessarily labelled by 1, 2, . . ., n, but only weakly increasing, beginning with 1 and without "gaps".See Figure 2 for an example.
In the sequel, we are concerned with rooted GNC-trees where the first 1 is the root.Let GNC n denote the set of rooted GNC-trees of n + 1 vertices.It is easy to prove that GNC n is counted by |GNC n | = 2 n 2n+1 3n n [12, A153231].A descent (an ascent, a level) is an edge (i, j) such that i > j (i < j, i = j) and i is on the path from the root to the vertex j.If encoding an ascent by u, a level by h and a descent by d, then each path in a GNC-tree can be represented by a ternary word on {u, h, d} by reading the path from the root.In analogy with the well-established permutation patterns [11,15], we propose a definition of patterns in GNC-trees.However, it should be pointed out that in the present paper we are dealing with "string pattern avoidance" (only consecutive letters are considered), which is thus different from "pattern avoiding" as defined in [11,15].Definition 1.1 Let w = w 1 w 2 . . .w n and σ = σ 1 σ 2 . . .σ k be two ternary words on {u, h, d}.Then w contains the string pattern σ if it has a subword w i+1 w i+2 . . .w i+k equal to σ for some 0 ≤ i ≤ n − k; otherwise w is called σ-avoiding.A GNC-tree T is called σ-avoiding if T has no subpath (viewed from the root) encoded by σ.
Let P k denote the set of ternary words of length k on {u, h, d}.For any σ ∈ P k , let GNC m n (σ) denote the set of GNC-trees in GNC n which contain the pattern σ exactly m times.For any nonempty subset P ⊂ P k , GNC n (P ) denotes the set of GNC-trees in GNC n which avoid all the patterns in P .A counterpart for GNC-trees to the analogous question for restricted permutations is the following question: Question 1.2 Determine the cardinalities of GNC n (P ) for P ⊂ P k and GNC m n (σ) for σ ∈ P k .In the literature, two kinds of special NC-trees have been considered, namely non-crossing increasing trees and non-crossing alternating trees.Both of them are counted by the Catalan numbers 2n n [12, A000108].A non-crossing increasing (alternating) tree is an NC-tree with the vertices on the path from the root 1 to any other vertex appearing in increasing (alternating) order.By our notation, a non-crossing increasing tree is a d-avoiding NC-tree and a non-crossing alternating tree is a {uu, dd}avoiding NC-tree.Bijections between non-crossing alternating trees and Dyck paths have been presented in [13].But for GNC-trees, it seems to be shed little light on this subject.
The contents of the paper (and also the methods used) are much closer to studies of "peaks, valleys, etc." in Motzkin paths or Dyck paths [9,10].In this paper, we deal with several patterns and find the corresponding generating functions for GNC-trees.More precisely, we investigate the patterns in P 1 in Section 2 and the patterns in P 2 in Section 3. The Lagrange inversion formula is used to obtain explicit formulas for some special cases.A bijection is also established between GNC-trees with special pattern avoidance and little Schröder paths.

The patterns in P 1
For any T ∈ GNC n , let u(T ), h(T ), d(T ) denote the number of ascents, levels and descents of T respectively, then u(T ) + h(T ) + d(T ) = n.Let GNC * n be the set of GNC-trees T in GNC n such that T has only one vertex with label 1, that is, only the root has the label 1 and all other vertices have labels greater than 1.Define Close relations between T x,y,z (t) and T * x,y,z (t) can be established using the "butterfly" decomposition (introduced by Flajolet and Noy [4]) of GNC-trees in Figure 1.It is obvious that the decomposition is only used for n ≥ 1 and that the case n = 0 leads to the additional 1.Find the first and minimal label i, denoted by i , of T ∈ GNC n in counterclockwise order such that the root 1 and i form an edge, then T can be partitioned into three parts.where not all vertices are labeled by 1.The edge (1, 1) contributes a weight of yt, Part I contributes T 0,y,0 (t) and Part II contributes T x,y,z (t) − T 0,y,0 (t).For Part III, except for the one point case, by decreasing all the labels (excluding the root) by j − 2 units (if k = j) or j − 1 units (if k = j + 1), one can obtain two GNC-trees in GNC * n for some n ≥ 1.Part III contributes 2T * x,y,z (t) − 1.
Case(iii): i ≥ 2, j ≥ i and k = j or j + 1.The edge (1, i ) contributes a weight of xt.Note that the ascents and descents are exchanged in Part I, and the labels are lying in {1, 2, . . ., i} or {2, 3, . . ., i}, so Part I contributes 2T z,y,x (t) − T 0,y,0 (t) for i ≥ 2. Part II still forms a GNC-tree after reducing the labels {i, . . ., j} to In summary, we have + ytT 0,y,0 (t) T x,y,z (t) − T 0,y,0 (t) 2T * x,y,z (t) − 1 (2.1) For any T ∈ GNC * n , by a similar decomposition, one can derive that Now we solve (2.2) for T * x,y,z (t) and substitute into (2.1) to obtain Multiplying on both sides of (2.3) by T 0,y,0 (t) and using (2.4), after some routine computations, one can deduce that T x,y,z (t) = 1 + (y − x)tT 0,y,0 (t) 2 T x,y,z (t) + 2xtT x,y,z (t) 2 T z,y,x (t). (2.5) The evaluation n via generating functions.By solving (2.5) for T x,y,z (t), we have where is the generating function for Catalan numbers.Exchanging x and z in (2.6), one can compute T z,y,x (t).If one substitutes the result in (2.6), one arrives at the following proposition.

Proposition 2.1
The generating function T x,y,z (t) for GNC-trees solves the third order equation By the Lagrange inversion formula and some series expansions, one can obtain the coefficient of t n of T x,y,z (t), but it seems to be somewhat complicated.Now we will consider several special cases which lead to interesting results.

u-avoiding GNC-trees
Note that T 0,y,z (t) is the generating function for GNC-trees with no ascent.By setting x = 0 in (2.5), one can find T 0,y,z (t) = 1 + ytT 0,y,0 (t) 2 T 0,y,z (t), from which, together with (2.4), and using the Lagrange inversion formula, one can deduce that In fact, the above relation can be easily derived from the definition of GNC-tree: since a u-avoiding GNC-tree must also avoid the pattern d, such GNC-trees can be obtained by changing each label of the underlying NC-trees to the label 1.

h-avoiding GNC-trees
Note that T x,0,z (t) is the generating function for GNC-trees with no level.By setting y = 0 in (2.4) and (2.5), one can find which, when x = z = 1, yields , using the Lagrange inversion formula [16], one can deduce for n ≥ 1 that This leads to the following result.

d-avoiding GNC-trees
Note that T x,y,0 (t) is the generating function for GNC-trees with no descent.By setting z = 0 in (2.6), we can find where we used the relation T 0,y,x (t) = T 0,y,0 (t) = T 0,1,0 (yt).

Case i
Setting x = y = 1 in (2.7), one gets Taking the coefficient t n of T 1,1,0 (t), one gets This leads to the following results.

Case ii
Setting y = 1 in (2.7), by (2.4), one gets Taking the coefficient t n x k of T x,1,0 (t), one gets This leads to the following results.Theorem 2. 4 The set of d-avoiding GNC-trees of n + 1 vertices with k ascents is given by
Proof: For any T ∈ GNC n (h, d), traversing its edges from the root, when an edge (i, j) is first read, we have a U -step and mark the U -step by j; When an edge is read in the second time, we have a D-step.Then we get a little Schröder path with no H-step (In fact a Dyck path).For any U -step in the Dyck path, find the maximal segment of D-steps followed the U -step and mark all of the D-steps with the same label as the U -step.For any two consecutive steps DU (In fact a valley), if they have the same label, then replace them by an H-step and remove the remaining labels, which leads to the desired little Schröder path.It is clear that the above procedure is invertible, see Figure 2 for an example.✷ 3 The patterns in P 2 Define GNC * n (P ) to be the set of GNC-trees in GNC * n avoiding any σ in a set P of patterns.For any σ ∈ P 2 , define x u(T ) y h(T ) z d(T ) .
In this section, we deal with the patterns uu, dd, ud and du, the others can be investigated similarly.

The patterns uu and dd.
Close relations between T uu x,y,z (t) and T * uu x,y,z (t) can be established using the decomposition of GNC-trees in Figure 1.x,y,z (t) − T 0,y,0 (t).For Part III, except for the one point case, decreasing all the labels (excluding the root), by j − 2 units if k = j or by j − 1 units if k = j + 1, one can obtain two uu-avoiding GNC-trees in GNC * n (uu) for some n ≥ 1.Then Part III contributes 2T * uu x,y,z (t) − 1.
Case(iii): i ≥ 2, j ≥ i and k = j or j + 1.The edge (1, i ) contributes a weight of xt.Note that the ascents and descents are exchanged in Part I, and the labels are lying in {1, 2, . . ., i} or {2, 3, . . ., i}, so Part I contributes 2T dd z,y,x (t) − T 0,y,0 (t).But Part II can not begin with a u edge, i.e., all edges (if exist) starting form i are h edges, so we should further partition Part II into three parts, by finding the last vertex labeled i, which we denote by i * , in counterclockwise order such that ( i ,i * ) is an h edge which contributes a weight of yt, see Figure 3. Clearly, Part II 1 and II 2 both contribute T 0,y,0 (t), and Part II 3 contributes T uu x,y,z (t).Similar to (ii), Part III contributes 2T * uu x,y,z (t) − 1.In summary, we have

String Pattern Avoidance in Generalized Non-crossing Trees
For any T ∈ GNC * n (uu), by the similar decomposition, one can easily derive that Similarly, for the pattern dd, close relations between T dd x,y,z (t) and T * dd x,y,z (t) can be established using the decomposition of GNC-trees in Figure 1, the details are omitted.
Setting x = y = z = 1 in (3.5) and (3.6), we have Proposition 3.1 The generating functions for uu-avoiding and dd-avoiding GNC-trees are determined respectively by Remark 3. 3 Coker [2] proved that T dd 1,0,1 (t) is also the generating function for D n , the set of different lattice paths running from (0, 0) to (2n, 0) using steps from S = {(k, ±k) : k positive integer} that never go below x-axis, and provided several different expressions for |D n |.One may ask to find a bijection between D n and GNC n (dd, h).

The patterns ud and du
Similar to Subsection 3.1, close relations between T ud x,y,z (t) and T * ud x,y,z (t), and between T du x,y,z (t) and T * du x,y,z (t), can be derived using the decomposition of GNC-trees, see Figure 1, but the details are omitted.

Proposition 3.4
The generating functions for ud-avoiding and du-avoiding GNC-trees are given by When x = z = 1, y = 0, by T 0,0,0 (t) = 1, (3.13) and (3.14) generate Yidong Sun and Zhiping Wang from which, one can deduce that This leads to the following result.
Case(i): i = j = 1 and k = 1 or 2. Part I and II both avoid the patterns u and d, Part III still forms a uuavoiding GNC-tree.Then the edge (1, 1) contributes a weight of yt, each of Part I and II contributes T 0,y,0 (t), and Part III contributes T uu x,y,z (t).Case(ii): i = 1, j ≥ 2 and k = j or j + 1.Part I avoids the patterns u and d, Part II still forms a uu-avoiding GNC-tree, where not all vertices are labeled by 1. Then the edge (1, 1) contributes a weight of yt, Part I contributes T 0,y,0 (t) and Part II contributes T uu