Consecutive patterns in Catalan words and the descent distribution

In this paper, we compute the distribution of the descent statistic on the Catalan words avoiding a consecutive pattern of length at most three. Baril–Kirgizov–Vajnovszki began the study of patterns in Catalan words, focusing on the enumeration of those that avoid classical patterns of length 3. We make use of the symbolic method to associate functional equations satisfied by the counting generating functions. As a consequence we enumerate the set of Catalan words that avoid consecutive patterns of length 3, and we also provide the total number of descents on this set.

The cardinality of the set C n is given by the Catalan number c n = 1 n+1 2n n , see [19,Exercise 80].Catalan words have been studied in the context of exhaustive generation of Gray codes for growth-restricted words [12].Recently, Baril et al. [2,3] study the distribution of descents on the sets of Catalan words avoiding a pattern of length at most three and a pair of patterns of length 3. Additionally, in [8,13], the authors started the study of combinatorial statistics on the polyominoes associated with the set of Catalan words of a prescribed length.
A pattern p is a word p = p 1 p 2 • • • p k with p i ∈ {0, 1, . . ., k −1} for all i, such that if j > 0 appears in p, then j − 1 also appears in p.A Catalan word w = w 1 w 2 • • • w n contains the pattern p = p 1 p 2 • • • p k if there exists a subsequence which is order-isomorphic to p. Otherwise, we say that w avoids p.For example, the Catalan word 0123455543 avoids the pattern 001 and contains the pattern 210 three times.A Catalan word w = w 1 w 2 • • • w n contains the consecutive pattern p = p 1 p 2 • • • p k if there exists a consecutive subsequence (subword) w i w i+1 • • • w i+k−1 , where 1 ≤ i ≤ n − k + 1 which is order-isomorphic to p.The study of consecutive patterns in permutations was introduced by Elizalde and Noy [9].Simultaneously, Burstein and Mansour [5,6] studied this notion for words.After that several results have been appearing in the literature, like those in [1,14,15] and references therein.
Let C n ( p) denote the Catalan words of length n avoids the consecutive pattern p, c p (n) is the cardinality of C n ( p), and C( p) = n≥0 C n ( p).The consecutive patterns p 1 and p 2 are Wilf equivalent, denoted by By a descent within a word w = w 1 w 2 • • • w n over the set of non-negative integers, we mean an index 1 ≤ ≤ n − 1 such that w > w +1 .Let des(w) denote the number of descents of the word w.We introduce the bivariate generating function denote the total number of descents over all words in C n ( p).The generating function for the sequence d p (n) is given by The problem of computing the distribution of the descent statistic in permutations and words has been considered by several authors, see for example [1,2,4,11].
In this paper we compute the bivariate generating function C p (x, y) for each consecutive pattern of length three.The generating functions that we present throughout the paper, are given using the symbolic method (cf.[10]).These results are the natural continuation of the previous results by Baril,Kirgizov,and Vajnovszki [2,3].Notice that the generating functions obtained by Baril et al. [2] are all rational.However, the consecutive patterns that we count in this paper, give that the generating functions are all algebraic (non-rational).

Consecutive patterns of length 3
The goal of the current section is to enumerate Catalan words avoiding each given consecutive pattern of length 3. From definition, any Catalan word avoids the consecutive patterns 021 and 102.The first few values of the sequence c p (n) for the remaining 11 consecutive patterns of length 3 are provided in Table 1.
From the definition of a Catalan word w, we have that w is either the empty word , or w can be written as 0(w + 1)w , where w and w are Catalan words, and w + 1 is obtained from the word w by adding one to each of its entries.This recursive decomposition is called the first return decomposition of a Catalan word (cf.[2]).

The consecutive pattern 012
Theorem 2. 1 We have ∼ 110 1, 2, 5, 13, 36, 104, 311, 955, 2995, 9553 A087626 101 1, 2, 5, 13, 36, 105, 317, 982, 3105, 9981 A247333 210 1, 2, 5, 14, 41, 124, 385, 1220, 3929, 12822 This generating function coincides with the generating function of the Motzkin numbers Additionally, the generating function of the total number of descents on the set C( 012) is given by The sequence corresponds to A005775, that is, A Dyck path of semilength n is a lattice path of Z × Z running from (0, 0) to (2n, 0) that never passes below the x-axis and whose permitted steps are U = (1, 1) and D = (1, −1).The Dyck paths of semilength n are in bijection with the Catalan words of length n: record the heights above ground level of the initial points of the up steps U taken left to right.For example, in Using this bijection, it is clear that the sequence c 012 (n) also counts the number of all Dyck paths of semilength n that avoid UUU (see [17]).For a bijective proof of the above result, see [7].

The consecutive pattern 010
Theorem 2. 2 We have Proof Let w denote a non-empty Catalan word in C(010), and let w = 0(w +1)w be the first return decomposition, where w , w ∈ C(010).If w = and w is non empty, then the generating function for this case is x(C 010 (x, y) − 1).If w is empty, then the generating function is x C 010 (x, y).Finally, if w and w are non-empty, then w = 0, and the number of descents is given by des(w) = des(w ) + des(w ) + 1. Hence the generating function of this last case is x y(C 010 (x, y) − (1 + x))(C 010 (x, y) − 1).Therefore, we have the functional equation Solving this equation we obtain the desired result.
The generating function of the total number of elements in C( 010) is This generating function coincides with the generating function of the number of peakless Motzkin paths of length n such that the up steps come in two colors (A187256), that is The generating function of the total number of descents on the set C(010) is

The consecutive patterns 001 and 011
In this section we prove that consecutive patterns 001 and 011 are Wilf equivalent, that is, 001 ∼ 011.
Theorem 2. 3 We have Proof Let w denote a non-empty Catalan word in C(001).From the first return decomposition w = 0 k (k ≥ 1) or w = 0(w + 1)w , where w , w ∈ C(001) and w is non-empty.If w = , then the number of descents in w is the same as that of w ; otherwise, we have des(w) = des(w ) + des(w ) + 1.From this decomposition we have the functional equation Solving this equation we obtain the desired result.

Theorem 2.4
There is a bijection between the sets C(001) and C(011).
Proof Let w be any Catalan word in C n (011).We define a word f (w) on C n (001) recursively, as follows.By reading the symbols of w from left to right, any subword 0 j 1 ( j ≥ 2) of w is replaced by the word 01 j .From the word obtained in the last step, we repeat the search and replace the subword 1 j 2 by the word 12 j , and so on.This algorithm defines a bijection and preserves the number of descents.For example, for w = 0001232223 ∈ C 10 (011), we have f (w) = 0123332333 ∈ C 10 (001).Indeed, we have the following transformation: The generating function of the total number of elements in C( p) for p ∈ {001, 011} is Using the bijection between Catalan words and Dyck path, the sequence c 011 (n) counts the Dyck paths of semilength n avoiding UU DU and c 001 (n) counts the Dyck paths of semilength n avoiding U DUU (sequence A105633).Therefore, we have the combinatorial expression (cf.[17]) Additionally, the generating function of the total number of descents on the set C( p) for p ∈ {001, 011} is

The consecutive pattern 201
Theorem 2. 5 We have Proof Let w denote a non-empty Catalan word in C( 201), and let w = 0(w 1)w be the first return decomposition, where w , w ∈ C(201).If w = and w is non empty, then the associated generating function is x(C 201 (x, y) − 1).If w is empty, then the generating function is x C 201 (x, y).Finally, if w and w are non-empty, then w can not finish with the symbol j for j ≥ 1 and w can not start with 01.Note that in this case des(w) = des(w ) + des(w ) + 1.By counting the complement, the generating function for this case is given by , where C 201,≥1 (x, y) is the bivariate generating function of the Catalan words in C(201), whose last symbol is greater than or equal to 1. Notice that the factor (a) corresponds to the generating function of the Catalan words in C(201) that starts with 01.Therefore, we have the functional equation If we denote by C 201,0 (x, y) the bivariate generating function of the Catalan words in C( 201), whose last symbol is equal to 0, then The Catalan words w enumerated by C 201,0 (x, y) can be decomposed as 0, 0w 1 , or 0w 2 , where w 1 , w 2 ∈ C(201), and w 1 ends with 0 and w 2 ends with a symbol greater than or equal to 1. Notice that des(w) = des(w 1 ) and des(w) = des(w 2 ) + 1, respectively.Therefore we have the functional equation Solving the system of equations we obtain the desired result.The generating function of the total number of elements in C( 201) is The sequence c 201 (n) coincides with the sequence A159769, and it is related to the enumeration of trees avoiding a consecutive pattern [16].Finally, the generating function of the total number of descents on the set C( 201) is ) .

The consecutive patterns 120, 100, and 110
Theorem 2.6 For p ∈ {120, 100, 110} we have Proof Let w denote a non-empty Catalan word in C(120), and let w = 0(w + 1)w be the first return decomposition, where w , w ∈ C(120).If w = and w is non empty, then the generating function for this case is x(C 120 (x, y) − 1).If w is empty, then the generating function is x C 120 (x, y).Finally, if w and w are non-empty, then w can not finish with an ascent a(a + 1).Moreover, des(w) = des(w ) + des(w ) + 1.By counting the complement, the generating function for this case is given by x y(C 120 (x, y) − 1) 2 − x 2 y(C 120 (x, y) − 1) 2 .Therefore, we have the functional equation Solving this equation we obtain the desired result.For the cases 100 and 110 we can follow a similar argument.
The Catalan words corresponding to the bold coefficient in the above series are .
This generating function corresponds with the sequence A087626.This is a new combinatorial interpretation for this sequence.Additionally, the generating function of the total number of descents on the set C( p) is

The consecutive pattern 101
Theorem 2. 7 We have Proof Let w denote a non-empty Catalan word in C(101), and let w = 0(w + 1)w be the first return decomposition, where w , w ∈ C(101 The generating function of the total number of elements in C( 101) is given by This generating function coincides with the sequence A114465.Moreover, the generating function of the total number of descents on the set C(101) is where

The consecutive pattern 000
Theorem 2. 8 We have Proof Let w denote a non-empty Catalan word in C(000), and let w = 0(w +1)w be the first return decomposition, where w , w ∈ C(000).If w = , then the generating function for this case is x C 000 (x, y).If w is empty, then the generating function is x(C 000 (x, y) − 1 − C 000,00 (x, y)), where C 000,00 (x, y)) is the generating function for the words in C(000), whose last symbols are 00.Finally, if w w are non-empty then des(w) = des(w )+des(w )+1, and the generating function is x y(C 000 (x, y)− 1) 2 .Therefore, we have the functional equation Moreover, Solving this equation we obtain the desired result.
The generating function of the total number of elements in C(000) is Using the bijection between Catalan words and Dyck path, the sequence c 000 (n) counts the Dyck paths of semilength n avoiding U DU DU (sequence A247333).Therefore, we have the combinatorial expression (cf.[17]), that is where m k is the k-th Motzkin number.The generating function of the total number of descents on the set C(000) is The generating function of the total number of elements in C( 210) is This generating function coincides with the generating function of the sequence A159771, then Finally, the generating function of the total number of descents on the set C(210) is given by

Fig. 1
Fig. 1 Dyck path of the Catalan word 0110012343201 Fig. ef 1 we show the Dyck path associated to the Catalan word 0110012343201 ∈ C 14 .