Dispersed Dyck paths revisited

Dispersed Dyck paths are Dyck paths, with possible flat steps on level 0. We revisit and augment questions about them from the Encyclopedia of Integer Sequences, in a systematic way that uses generating functions and the kernel method.

As in various examples discussed in the past [3,4,6] we will use the kernel method to set up appropriate generating functions.There are three (or four) bivariate (or trivariate) generating functions F (u), G(u), H(u) (also depending on z) related to the nature of the last step of the prefix of a dispersed Dyck path.To solve the system, a 'bad' factor u − r 2 must be divided out from numerator and denominator, after which one can plug in u = 0 and identify the unknown quantities f 1 = F (0), etc.
Various questions (from the encyclopedia of integer sequences [7]) about such paths will be revisited; our method is fairly automatic and purely refers to generating functions.To be more specific, these include 1-ascents, 1-descents, valleys on level 0, occurrences of UUDD.Also, we obtain expression for paths that do not have to go back to the x-axis, rather finish at a level j, or, more generally, on any level.This is either achieved by looking at the coefficient of u j , say, or, setting u = 1.The generating functions of interest usually have 3 variables: z for the length (number of steps), u for the final height, and t for an additional parameter of interest.

Counting 1-ascents
A 1-ascent is an ascent consisting of exactly 1 up step.The paper [2] contains some analysis, but without generating functions.The paper [1] discusses d-ascents for d ≥ 2 as well, but the quadratic equations that are so common in the context of Dyck paths, are then of higher order, and the results are consequently of an asymptotic nature.
We distinguish 3 states, together with the current level.Down-steps are unproblematic, but when after them an up-step arrives, it might be the only one or further up-steps follow.
A graph describes all the possible scenarios, as in [4].It has 3 layers of states, and sequences f i , i ≥ 1, g i , h i , i ≥ 0, in that order.These quantities all depend on the variable z and describe generating functions of paths leading to a particular state.Since on level 0, flat (horizontal) steps are also allowed, the quantities f 0 , g 0 , and h 0 are somewhat special and will be treated as parameters.Compare [5] for this technique.We will deal with trivariate generating functions the other variables z (counting the length) and t (counting the 1-ascents) are not explicitly mentioned.The recursions can be read off, by considering the last step made, Figure 1.Three layers of states, labelled f, g, h, in that order.The state f 0 is responsible for dispersed Dyck paths, and all others to prefixes of them.
Translating these into the trivariate generating functions, we get The system can be solved, but still depends on the initial values f 1 , g 1 , h 1 : The naive approach would be to plug in u = 0 and identity the initial values, but this doesn't work, and requires some preparations.The denominator will be factored, ) and the abbreviation Dividing out the factor u − r 2 from numerator and denominator ('kernel method'), we find , and now u = 0 is possible, with , g 1 = zf 0 , h 1 = 0.
But we have f 0 = 1 + zf 0 + zf 1 + ztg 1 , and both, f 1 and g 1 can be expressed in terms of f 0 : The ultimate solution is now with the series expansion For t = 0 we find the enumeration of dispersed Dyck paths without 1-ascents (A191385) For t = 1, we find which is the enumeration of dispersed Dyck paths of length n: n ⌊n/2⌋ .The number of 1-ascents in paths of length 5 can be deduced from (3t 2 + 4t + 3): it is 3 • 2 + 4, and in general, we must differentate f 0 w.r.t.t, followed by t = 1.
The coefficients of z n form the sequene A045621.Furthermore, we get From this, it is easy to find f j , g j , h j since we only have to expand 1/(1 − zr 2 − zu) in powers of u, which is basically a geometric series.We will not write this out.However, we will sum all these quantities, as it describes all dispersed Dyck paths with open end (partial paths, sometimes called meander).We have to be careful and, when a path ends in a state from the second layer ('g'), the last up step is a 1-ascent, and we need to attach an extra factor t. The resulting formula is surprisingly simple:

Counting 1-descents
In this section, the number of 1-descents will be counted.The definition is similar; a down-step rendered by up-steps or standing at the end of the dispersed Dyck path.The same letters as in the previous section will be used, but now with a different meaning.The figure is again self-explanatory: Here are the relevant recursions: and So the kernel method will give us g 1 and h 1 , and f 1 follows.The recursions will be translated into trivariate generating functions, as before: We do not write the solutions for F (u), G(u), H(u), only the relevant denominator with Then we divide out the factor u − r 2 in the usual way, and get, after setting u = 0, This provides also the values f 0 , g 0 , h 0 , and which is the generating function of dispersed Dyck paths returning to the 0-level.Again, to count the contributions of the 1-descents, we compute as before.This is natural, as reading from right to left turns 1-upsteps to 1-downsteps, and vice versa.Considering all paths, regardless where they end, which is surprisingly simple, with a simple series expansion,

Counting valleys on level 0
We do now exactly what the title of the section says; Here are the usual recursions, Two layers of states, labelled f, g, in that order.
We have f 0 = 1+z 2 f 1 1−z , and from the kernel method, after dividing out Then, which is sequence A191388 (no valleys on level 0).Furthermore Finally, which is sequence A191389 (number of valleys on level 0).By setting u = 1 in g 0 + F (u), we can address the number of such partial dispersed Dyck paths according to no valleys resp.number of valleys.Since these formulae are easy to obtain and not too attractive, we do not display them here.The recursions are

Counting occurrences of UUDD
The following generating functions will be used: Summing and simplifying, It is beneficial to reduce the system to just one equation, for F (u).Note also that Dividing out, as part of the kernel method, u − r 2 , with r 2 = 1 + z 4 − z 4 t − √ z 8 − 2z 8 t + 2z 4 + z 8 t 2 − 2z 4 t + 1 − 4z 2 2z and setting u = 0 leads to from which f 0 can be computed:  Of course, dispersed Dyck paths with arbitrary endpoint can also be discussed using f 0 + F (1) + G(1) + H(1) + K(1), but we are not going to display any formula; they are easy to obtain.

Figure 2 .
Figure 2. Three layers of states, labelled f, g, h, in that order.

Figure 4 .
Figure 4. Four layers of states, labelled f, g, h, k, in that order.