Partial Motzkin paths with air pockets of the first kind avoiding peaks, valleys or double rises
Abstract
Motzkin paths with air pockets (MAP) of the first kind are defined as a generalization of Dyck paths with air pockets. They are lattice paths in starting at the origin made of steps , , and , where two down-steps cannot be consecutive. We enumerate MAP and their prefixes avoiding peaks (resp. valleys, resp. double rise) according to the length, the type of the last step, and the height of its end-point. We express our results using Riordan arrays. Finally, we provide constructive bijections between these paths and restricted Dyck and Motzkin paths.
1 Introduction
In a recent paper [2], the authors introduce, study, and enumerate special classes of lattice paths, called Dyck paths with air pockets (DAP for short). Such paths are non empty lattice paths in the first quadrant of starting at the origin, and consisting of up-steps and down-steps , , where two down-steps cannot be consecutive. These paths can be viewed as ordinary Dyck paths (i.e., paths in starting at the origin, ending on the -axis and consisting of and ), where each maximal run of down-steps is condensed into one large down-step. As mentioned in [2], they also correspond to a stack evolution with (partial) reset operations that cannot be consecutive (see for instance [6]). The authors enumerate these paths with respect to the length, the type (up or down) of the last step and the height of the end-point. Whenever the last point is on the -axis, they prove that the DAP of length are in one-to-one correspondence with the peak-less Motzkin paths of length . They also investigate the popularity of many patterns in these paths and they give asymptotic approximations. In a second work [3], the authors make a study for a generalization of these paths by allowing them to go below the -axis. They call these paths Grand Dyck paths with air pockets (GDAP), and they also yield enumerative results for these paths according to the length and several restrictions on the height. In a third paper, Baril and Barry [4] study two generalizations of DAP by allowing some horizontal steps with some conditions. They call them Motzkin paths with air pockets of the first and second kind.
In this paper we study Motzkin paths with air pockets of the first kind, which are defined as Motzkin paths (lattice paths in starting at the origin and made of , , and ), where each maximal run of down-steps is condensed into one large down-step. More precisely, we consider lattice paths in starting at the origin, consisting of steps , , and , , where two down-steps cannot be consecutive. We denote by (resp. , resp. ) the set of Dyck paths (resp. Motzkin paths, resp. Motzkin paths with air pockets of the first kind). Moreover, we denote by the set of partial Motzkin paths with air pockets (PMAP for short). The MAP of the first kind are enumerated by the sequence A114465. This sequence also counts the Dyck paths having no ascents of length 2 that start at an odd level.
Throughout the paper, we will use the following notations. For , we consider the generating function (resp. , resp. ), where the coefficient of in the series expansion is the number of partial Motzkin paths with air pockets of length ending at height with an up-step, (resp. with a down-step, resp. with a horizontal step ). We introduce the bivariate generating functions
For short, we also use the notation , and for these functions.
A Riordan array is an infinite lower triangular matrix whose -th column has generating function for all , for some formal power series and , with , , and . Such a Riordan array is denoted by . We refer to [16, 17] for more details on Riordan arrays. Several authors have used Riordan arrays to study lattice paths; see for example [10, 13, 14, 19, 20, 21].
The outline of this paper is the following. We present enumerative results for partial Motzkin paths with air pockets of the first kind avoiding peaks (resp. avoiding valleys, resp. avoiding double rises), knowing that a peak is an occurrence for some , a valley is an occurrence for some , and a double rise is an occurrence . For each avoidance, we provide bivariate generating functions that count the PMAP with respect to the length, the type of the last step (up, down or horizontal step) and the height of the end-point. All these results are obtained algebraically by using the famous kernel method for solving several systems of functional equations. We express our results using Riordan arrays and we deduce closed forms for PMAP of length ending at height . Finally, we provide constructive bijections between these paths and some restricted Dyck and Motzkin paths.
2 Partial peak-less Motzkin paths with air pockets
In this section, we study partial Motzkin paths with air pockets of the first kind avoiding occurrences of for all .
2.1 Enumerative results
Let be a length PMAP ending at height and avoiding the occurrences of for . If the last step of is , then and we have , where is a length MAP ending at height and avoiding the peaks ( can be the empty path). So, we obtain the first relation for , anchored with by considering the empty path. If the last step of is a down-step , , then we have , where is a length PMAP ending at height with no up- and down-steps at its end, and with no peaks. So, we obtain the second relation . If the last step of is a horizontal step , then we have , where is a length PMAP ending at height with no peaks, which implies that for .
Therefore, we have to solve the following system of equations:
(1) |
Multiplying by the recursions in (1) and summing over , we have:
Notice that we have by considering the difference of the first and third equations. Now, setting and solving these functional equations, we obtain
In order to compute , we use the kernel method (see [1, 11]) on . We can write the denominator (which is a polynomial in of degree 2), as with
Plugging (which has a Taylor expansion at ) in , we obtain the equation which implies that
Finally, after simplifying by the factor in the numerators and denominators, we obtain
which induces that
Theorem 1
The bivariate generating function for the total number of peak-less PMAP with respect to the length and the height of the end-point is given by
and we have
Finally, setting , we have for and ,
and setting , then we have
Proof. The first three equalities are immediately deduced from the previous results. Now, let us prove the last equality. Any length peak-less MAP is of the form () where is a MAP of length , or () , where are some MAP such that the length of lies into , or () , where , , and is a MAP of length lying into . The number of of a given length is the total number of peak-less MAP of length minus the number of peak-less MAP of length and ending with . Taking into account all these cases, we obtain the result.
Corollary 1
The generating function that counts all peak-less PMAP with respect to the length is given by
The first few terms of the series expansion of are
which corresponds to the sequence A152225 in [18] counting Dyck paths of semilength with no peaks of height (mod 3) and no valleys of height 2 (mod 3); see [7].
Corollary 2
The generating function that counts the peak-less MAP with respect to the length is given by
The first few terms of the series expansion of are
which corresponds to the sequence A152171 in [18] counting Dyck paths of length with no peaks of height (mod 3) and no valleys of height 1 (mod 3). In Section 2.2, we will exhibit a constructive bijection between these two classes of paths.
Let be the infinite matrix , where . The first few rows of the matrix are
In Figure 1 we show the peak-less PMAP counted by .

Corollary 3
The matrix is a Riordan array defined by
where is the generating function of the Catalan numbers .
Proof. Indeed, we directly deduce the result from the following.
Corollary 4
We have
where .
Proof. From the Lagrange Inversion Formula (cf. [8]), we know that
(2) |
From definition of Riordan arrays and Eq. (2) we have
If we take , then
In [15], Rogers gave an equivalent characterization of the Riordan arrays. That is, every element not belonging to row or column in a Riordan array can be expressed as a fixed linear combination of the elements in the preceding row. The -sequence is defined to be the sequence coefficients of this linear combination. Analogously, Merlini et al. [9] introduced the -sequence, that characterizes the elements in column , except for the top one.
An infinite lower triangular matrix is a Riordan array if and only if and there exist two sequences , with , and (called the -sequence and the -sequence, respectively), such that
(3) | |||||
(4) |
The product of two Riordan arrays and is defined by
(5) |
Under this operation, the set of all Riordan arrays is a group [16]. The identity element is and the inverse of is given by
(6) |
where denotes the compositional inverse of .
The generating functions for the -sequence and -sequence of the Riordan array , with inverse , are given by ([9, 5])
respectively.
From the definition of the -sequence and -sequence for the Riordan arrays we can give an additional recurrence relation for the sequence .
Corollary 5
We have
where for and . Moreover,
Proof. By Equation (6), the inverse of the matrix is given by , where
Therefore, the -sequence and -sequence of the Riordan array have generating functions
The generating function corresponds with the sequence A247162, where the explicit formula for can be found. From (3) we obtain the result.
The first few values of the sequence for are
2.2 A bijective approach
Corollary 2 proves that the set of peak-less Motzkin paths with air pockets of length (ending on the -axis) is equinumerous to the set of Dyck paths of length with no peak at height 2 (mod 3) and no valley at height 1 (mod 3).
Any non-empty peak-less Motzkin path with air pockets is either of the form (1) or (2) , where and are possibly empty peak-less MAP. We refer to the left part of Figure 2 for an illustration of this form.
Remember that denotes the set of Motzkin paths with air pockets of the first kind.
Definition 1
We recursively define the map from to as follows. For , we set:
We refer to Figure 3 for an illustration of the third case of the definition of .
Due to the recursive definition, the image of peak-less MAP of length under is a Dyck path of length . Moreover it is clear that the obtained path is a Dyck path in . For instance (see Figure 3 for an illustration of this example).

Theorem 2
For all , the map induces a bijection between and .
3 Partial valley-less Motzkin paths with air pockets
Using the same arguments we used for the system of the previous section, we study partial Motzkin paths with air pockets of the first kind avoiding occurrences of for all .
3.1 Enumerative results
In the same way as we done in Section 2.1, we have to solve the following system of equations:
(7) |
Multiplying by the recursions in (7) and summing over , we have:
Notice that we have by considering the first equation. Now, setting and solving these functional equations, we obtain
In order to compute , we use the kernel method (see [1, 11]) on . We can write the denominator (which is a polynomial in of degree 2), as with
Plugging (which has a Taylor expansion at ) in , we obtain the equation which implies that
Finally, after simplifying by the factor in the numerators and denominators, we obtain
which implies that
Theorem 3
The bivariate generating function for the total number of partial valley-less MAP with respect to the length and the height of the end-point is given by
and we have
Finally, setting , we have for , ,
and setting and , then we have for ,
Proof. The first three equalities are immediately deduced from the previous results. For the last equality, the term satisfies the same recurrence relation as in Theorem 1 (modulo shift of ) since the two sequences are equal modulo a shift.
Corollary 6
The generating function that counts the partial valley-less MAP with respect to the length is given by
Corollary 7
The generating function that counts the partial valley-less MAP with respect to the length is given by
The first few terms of the series expansion of are
which corresponds to a shift of the sequence A152171 in [18] counting Dyck paths of length with no peaks of height (mod 3) and no valleys of height 1 (mod 3) (see also Section 3.1).
Let be the infinite matrix . The first few rows of the matrix are
In Figure 4 we show the valley-less PMAP counted by .

Corollary 8
The matrix is a Riordan array defined by
where is the generating function of the Catalan numbers .
Proof. Indeed, we directly deduce the result from the following.
From a similar argument as in Corollary 4 we obtain the following result.
Corollary 9
We have
where .
3.2 A bijective approach
Corollary 7 and Corollary 2 prove that the set of valley-less Motzkin paths with air pockets of length (ending on the -axis) is equinumerous to the set of peak-less Motzkin paths with air pockets of length , which is in one-to-one correspondence with the set of Dyck paths of length with no peak at height 2 (mod 3) and no valley at height 1 (mod 3) (see a constructive bijection in Section 2.2). Below, we provide a bijection between valley-less MAP of length and peak-less MAP of length .
Any valley-less Motzkin path with air pockets is either of the form () , () , () , () , () , or () , where are valley-less MAP (possibly empty), and is a valley-less MAP. According to all these cases, we define the map .
Definition 2
We recursively define the map from valley-less MAP of length to peak-less MAP of length . Let be a valley-less MAP, we set:
where the -operator maps a peak-less MAP of the form into the peak-less MAP .
Due to the recursive definition, the image of valley-less MAP of length under is a peak-less MAP of length . The recursive definition naturally induces that is a bijection. Using the bijection presented above, we can easily obtain a constructive bijection between valley-less MAP of length and Dyck paths of length with no peak at height 2 (mod 3) and no valley at height 1 (mod 3).
4 Partial -less Motzkin paths with air pockets
In this section, we study partial Motzkin paths with air pockets of the first kind avoiding occurrences of .
4.1 Enumerative results
In the same way as we done in the previous section, we have to solve the following system of equations:
(8) |
Multiplying by the recursions in (8) and summing over , we have:
Notice that we have by considering the first and the last equation. Now, setting and solving these functional equations, we obtain
In order to compute , we use the kernel method (see [1, 11]) on . We can write the denominator (which is a polynomial in of degree 2), as , with
Plugging (which has a Taylor expansion at ) in , we obtain the equation which implies that
Finally, after simplifying by the factor in the numerators and denominators, we obtain
which implies that , , and
Theorem 4
The bivariate generating function for the total number of -less PMAP with respect to the length and the height of the end-point is given by
and we have
and for
Finally, setting , we have for , ,
and setting , then we have
Proof. The first three equalities are immediately deduced from the previous results. Now, let us prove the last equality. Any non-empty length -less MAP is of the form () where is a -less MAP of length , or () where is a MAP of length avoiding , or () , where are some MAP avoiding such that the length of lies into and starts and ends with , or () , where , , and is a MAP of length lying into and starting with . The number of of a given length is the total number of -less MAP of length minus the total number of -less MAP of length . Taking into account all these cases, we obtain the result.
Corollary 10
The generating function that counts the partial -less MAP with respect to the length is given by
Corollary 11
The generating function that counts -less MAP with respect to the length is given by
The first few terms of the series expansion of are
which corresponds to the sequence A095980 in [18] counting Motzkin paths of length with no occurrences of .
Let be the infinite matrix . The first few rows of the matrix are
In Figure 5 we show the -less PMAP counted by .

The matrix is not a (proper) Riordan array. For this reason, we consider the matrix , where
The first few rows of the matrix are
Corollary 12
The matrix is the Riordan array defined by , where
Proof. It follows from the relation .
It seems difficult to obtain a close form for the coefficient using the Lagrange Inversion Formula. Indeed, can be expressed in terms of , where is a polynomial of degree 6, which complicates the calculations.
4.2 A bijective approach
Corollary 11 proves that the set of -less Motzkin paths with air pockets of length (ending on the -axis) is equinumerous to the set of Motzkin paths of length avoiding . Below, we provide a bijection between these two sets.
Any -less Motzkin path with air pockets is either of the form () , () , () , () , () , or () , where are -less MAP (possibly empty), and is a -less MAP and . According to all these cases, we define the map .
Definition 3
We recursively define the map from -less MAP of length to -less Motzkin paths of length . Let be a -less MAP, we set:
Due to the recursive definition, the image of -less MAP of length by is a -less Motzkin path of length . The recursive definition naturally induces that is a bijection. For instance, if then we obtain (see Figure 6 for an illustration of this example).

References
- [1] C. Banderier, M. Bousquet-Mélou, A. Denise, P. Flajolet, and D. Gouyou-Beauchamps. Generating functions for generating trees. Discrete Math. 246 (2002), 29–55.
- [2] J.-L. Baril, S. Kirgizov, R. Maréchal, and V. Vajnovszki. Enumeration of Dyck paths with air pockets. Submitted (2022), https://arxiv.org/abs/2202.06893
- [3] J.-L. Baril, S. Kirgizov, R. Maréchal, and V. Vajnovszki. Grand Dyck paths with air pockets. Submitted (2022), https://arxiv.org/abs/2211.04914
- [4] J.-L. Baril and P. Barry. Two kinds of partial Motzkin paths with air pockets. Submitted (2022). https://arxiv.org/abs/2212.12404
- [5] T.-X. He and R. Sprugnoli. Sequence characterization of Riordan arrays. Discrete Math. 309 (2009), 3962–3974.
- [6] A. Krinik, G. Rubino, D. Marcus, R.J. Swift, H. Kasfy, and H. Lam. Dual processes to solve single server systems. Journal of Stat. Planning and Inference, 135(1) (2005), 121–147.
- [7] S.-C. Liu, J. Ma, and Y.-N. Yeh. Dyck paths with peak- and valley- avoiding sets. Stud. Appl. Math. 121 (2008), 263–289.
- [8] D. Merlini, R. Sprugnoli, and M. C. Verri, Lagrange inversion: when and how, Acta Appl. Math. 94 (2006), 233–249.
- [9] D. Merlini, D. G. Rogers, R. Sprugnoli, and M. C. Verri. On some alternative characterizations of Riordan arrays. Canadian J. Math. 49 (1997), 301–320.
- [10] D. Merlini, D. G. Rogers, R. Sprugnoli, and M. C. Verri. Underdiagonal lattice paths with unrestricted steps. Discrete Appl. Math. 91 (1999), 197–213.
- [11] H. Prodinger. The kernel method: a collection of examples. Sém. Lothar. Combin. 50 (2004), B50f.
- [12] H. Prodinger. Partial Dyck paths with air pockets. INTEGERS 22 (2022), #A24.
- [13] J. L. Ramírez and V. F. Sirvent. A generalization of the -bonacci sequence from Riordan arrays. Electron. J. Combin. 22 (2015), # P1.38.
- [14] J. L. Ramírez and V. F. Sirvent. Generalized Schröder matrix and its combinatorial interpretation. Linear Multilinear Algebra 66(2) (2018), 418–433.
- [15] D. G. Rogers. Pascal triangles, Catalan numbers and renewal arrays. Discrete Math. 22 (1978), 301–310.
- [16] L. W. Shapiro, S. Getu, W. Woan, and L. Woodson, The Riordan group, Discrete Appl. Math. 34 (1991), 229–239.
- [17] L. W. Shapiro, R. Sprugnoli, P. Barry, G.-S. Cheon, T.-X. He, D. Merlini, and W. Wang, The Riordan Group and Applications, Springer Monographs in Mathematics, Springer, 2022.
- [18] N. J. A. Sloane. The On-line Encyclopedia of Integer Sequences. Available electronically at http://oeis.org.
- [19] S-.L. Yang, Y.-N. Dong, and T.-X. He. Some matrix identities on colored Motzkin paths. Discrete Math. 340 (2017), 3081–3091.
- [20] S-.L. Yang and M. Jiang. The -Schröder paths and -Schröder numbers. Discret. Math. 344(2) (2021), 112209.
- [21] L. Yang, S.-L. Yang, and T.-X. He. Generalized Schröder matrices arising from enumeration of lattice paths. Czechoslovak Math. J. 70 (2020), 411–433.