This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Lattice walks ending on a coordinate hyperplane avoiding backtracking and repeats

John Machacek
Abstract.

We work with lattice walks in r+1\mathbb{Z}^{r+1} using step set {±1}r+1\{\pm 1\}^{r+1} that finish with xr+1=0x_{r+1}=0. We further impose conditions of avoiding backtracking (i.e. [v,v][v,-v]) and avoiding consecutive steps (i.e. [v,v][v,v]) each possibly combined with restricting to the half-space xr+10x_{r+1}\geq 0. We find in all cases the generating functions for such walks are algebraic and give explicit formulas for them. We also find polynomial recurrences for their coefficients. From the generating functions we find the asymptotic enumeration of each family of walks considered. The enumeration in special cases includes central binomial coefficients and Catalan numbers as well as relations to enumeration of another family of walks previously studied for which we provide a bijection.

Key words and phrases:
Lattice walks, WZ theory, generating functions, formal languages, central binomial coefficients, Catalan numbers
2010 Mathematics Subject Classification:
Primary 05A15; Secondary 05A16, 33F10, 68Q45

1. Introduction

Central binomial coefficients and Catalan numbers are two fundamental sequences in enumerative combinatorics as well as in other areas of mathematics. Both these numbers can be thought of as enumerating walks in \mathbb{Z} with steps from {±1}\{\pm 1\} that end at the origin. The Catalan number model has the additional restriction the walks must stay in the nonnegative integers and correspond to the height of usual Dyck paths. We generalize this situation by looking at walks in r+1\mathbb{Z}^{r+1} with steps from {±1}r+1\{\pm 1\}^{r+1}. The condition that the walks must end on the hyperplane defined by xr+1=0x_{r+1}=0 is imposed. For the generalized Catalan situation we also require the walks be confined to the halfspace with xr+10x_{r+1}\geq 0. We then look at such walks avoiding the backtracking pattern [v,v][v,-v] and the repeat pattern [v,v][v,v] for v{±1}r+1v\in\{\pm 1\}^{r+1}. Here a walk is a sequence of vectors from {±1}r+1\{\pm 1\}^{r+1} and [v1,v1,,v][v_{1},v_{1},\dots,v_{\ell}] contains the pattern [u1,u2][u_{1},u_{2}] if and only if [vi,vi+1]=[u1,u2][v_{i},v_{i+1}]=[u_{1},u_{2}] for 1i<1\leq i<\ell. That is, our pattern avoidance means that no contiguous subsequence of a walk is equal to the pattern. When r=0r=0 there are no nonempty walks ending at the origin avoiding the backtracking pattern. While for avoiding the repeat pattern there are the two walks of length 2n2n namely [+1,1]n[+1,-1]^{n} and [1,+1]n[-1,+1]^{n} only the first of which is relevant the Catalan situation. However, for r>0r>0 there are many such walks. Our aim is enumerating these walks.

Walks in integer lattices are a topic of interest in computer science, mathematics, physics, and statistics. Lattice path combinatorics can be approached from various perspectives (see [Kra15] for survey with focus on enumeration). Our focus is enumeration (i.e. finding recurrences, generating functions, and formulas). One such enumeration problem involving avoidance of backtracking we solve gives an interpretation of sequence A085363 in the OEIS [OEI] in terms of 2D lattices walks. This sequence was an original motivation, but we found the techniques readily generalized to arbitrary dimension as well as avoidance of consecutive steps. In addition to combinatorial arguments, we make use of formal language theory and its connection to generating functions. We also use automated methods for dealing with hypergeometric terms and finding polynomial recurrences (see [PWZ96] for more about these types of techniques).

Lattice path enumeration has a long and rich history, and recent attention has been given to avoiding patterns as we consider here. We saw for Dyck paths (i.e. r=0r=0) that avoiding consecutive steps or backtracking is not interesting. However, the consecutive step patterns [+1,+1][+1,+1] and [1,1][-1,-1] are special cases of runs [+1,+1,,+1][+1,+1,\dots,+1] and [1,1,,1][-1,-1,\dots,-1]. Study of Dyck paths avoiding runs of given lengths (as well as peaks and valleys avoiding certain heights) is conducted in [EZ] with automated computational methods and in [BDB] with formal grammar techniques. Avoiding a pattern in lattice paths was considered in [ABBG20] and later for multiple patterns in [AB20, ABR20]. These latter works make use of the so called vectorial kernel method which modifies the kernel method to allow for pattern avoidance. While the vectorial kernel method is an efficient and flexible way to access the generating functions of our walks, we want to focus in this work on binomial expressions for the coefficients; so, for our set of jumps we present a way to do so via an alternative approach based on context-free grammars and ad-hoc recurrences.

The remainder of the paper is organized as follows. In Section 2 we formally define the languages of walks we are interested in and show that their generating functions are algebraic (and hence the sequences of coefficients satisfy a recurrence with polynomial coefficients). Formulas and recurrences are found in Section 3, then generating functions and asymptotics are given in Section 4. Lastly, Section 5 concludes by looking at some open problems and related work. Also, there is the Appendix which provides Maple code used to prove some results from earlier in the article.

Acknowledgments

The author wishes to thank anonymous referees for their careful reading as well as for several thoughtful and helpful comments which have improved this paper.

2. The setting

For r0r\geq 0 we consider lattice walks in r+1\mathbb{Z}^{r+1} that use steps from 𝒮r:={±1}r+1\mathcal{S}_{r}:=\{\pm 1\}^{r+1} which start at the origin and end with xr+1=0x_{r+1}=0. Let 𝐀(r)\mathbf{A}^{(r)} be the language over the alphabet 𝒮r\mathcal{S}_{r} consisting of such walks. Evidently any such walk must consist of 2n2n steps for some n0n\geq 0. Let an(r)a^{(r)}_{n} be the number of such walks with 2n2n steps.

We are further interested in subsets of these walks with additional conditions. We consider the language of walks 𝐁(r)𝐀(r)\mathbf{B}^{(r)}\subseteq\mathbf{A}^{(r)} which avoid backtracking. That is, walks ending with xr+1=0x_{r+1}=0 with the additional constraint that a step vv cannot be directly followed by v-v for any v𝒮dv\in\mathcal{S}_{d}. We let bn(r)b^{(r)}_{n} be the number of walks avoiding backtracking with 2n2n steps. Similarly, we let 𝐂(r)𝐀(r)\mathbf{C}^{(r)}\subseteq\mathbf{A}^{(r)} denote the language of walks avoiding consecutive repeats. That is, walks avoiding a step vv directly followed by vv for any v𝒮dv\in\mathcal{S}_{d}. We let cn(r)c^{(r)}_{n} denote the number of walks avoiding consecutive repeats with 2n2n steps.

Now let 𝐃(r)\mathbf{D}^{(r)} be the language consisting of walks starting at the origin for which xr+10x_{r+1}\geq 0 at all times and finish with xr+1=0x_{r+1}=0. We similarly let 𝐄(r)𝐃(r)\mathbf{E}^{(r)}\subseteq\mathbf{D}^{(r)} and 𝐅(r)𝐃(r)\mathbf{F}^{(r)}\subseteq\mathbf{D}^{(r)} denote the sublanguages which avoid backtracking and consecutive equal steps respectively. Again we let the sequences dn(r)d^{(r)}_{n}, en(r)e^{(r)}_{n}, and fn(r)f^{(r)}_{n} count the number of walks of length 2n2n in each of the languages 𝐃(r)\mathbf{D}^{(r)}, 𝐄(r)\mathbf{E}^{(r)}, and 𝐅(r)\mathbf{F}^{(r)}. Letting 𝐗(r)\mathbf{X}^{(r)} denote the language of walks avoiding the backtracking pattern [v,v][v,-v] and 𝐘(r)\mathbf{Y}^{(r)} denote the language of walks avoiding consecutive repeats [v,v][v,v] we have

𝐁(r)\displaystyle\mathbf{B}^{(r)} =𝐀(r)𝐗(r)\displaystyle=\mathbf{A}^{(r)}\cap\mathbf{X}^{(r)} 𝐄(r)\displaystyle\mathbf{E}^{(r)} =𝐃(r)𝐗(r)\displaystyle=\mathbf{D}^{(r)}\cap\mathbf{X}^{(r)}
𝐂(r)\displaystyle\mathbf{C}^{(r)} =𝐀(r)𝐘(r)\displaystyle=\mathbf{A}^{(r)}\cap\mathbf{Y}^{(r)} 𝐅(r)\displaystyle\mathbf{F}^{(r)} =𝐃(r)𝐘(r)\displaystyle=\mathbf{D}^{(r)}\cap\mathbf{Y}^{(r)}

as expressions of our languages of interest. It is worth noting that both 𝐗(r)\mathbf{X}^{(r)} and 𝐘(r)\mathbf{Y}^{(r)} are regular languages.

Remark 2.1.

Here are a few remarks about notation (some of which has already been used in the Section 1). We will use ()(\;\cdot\;) to denote vectors (i.e. elements of our alphabet) and [][\;\cdot\;] to denote words (i.e. sequences of vectors). For example, (+1,1,+1)𝒮2(+1,-1,+1)\in\mathcal{S}_{2} and [(+1,1,+1),(+1,+1,1)][(+1,-1,+1),(+1,+1,-1)] is a word over 𝒮2\mathcal{S}_{2}. We may also use (v,+1)(v,+1) or (v,1)(v,-1) to denote a element of 𝒮r+1\mathcal{S}_{r+1} ending in +1+1 or 1-1 respectively for v𝒮r.v\in\mathcal{S}_{r}. We will also use the power notation to denote repeated instances of a vector or word. So if v=(+1,1)v=(+1,-1) then [v3]=[(+1,1),(+1,1),(+1,1)][v^{3}]=[(+1,-1),(+1,-1),(+1,-1)]. We may also put words to a power. For example, if w1=[(+1,+1),(1,1)]w_{1}=[(+1,+1),(-1,-1)] and w2=[(+1,+1),(+1,+1)]w_{2}=[(+1,+1),(+1,+1)], then

[w12,w2]=[(+1,+1),(1,1),(+1,+1),(1,1),(+1,+1),(+1,+1)].[w_{1}^{2},w_{2}]=[(+1,+1),(-1,-1),(+1,+1),(-1,-1),(+1,+1),(+1,+1)].

In enumeration it is often advantageous and interesting to work with generating functions. We will consider the following generating functions

G(x;𝐀(r))\displaystyle G(x;\mathbf{A}^{(r)}) =n0an(r)xn\displaystyle=\sum_{n\geq 0}a^{(r)}_{n}x^{n} G(x;𝐃(r))\displaystyle G(x;\mathbf{D}^{(r)}) =n0dn(r)xn\displaystyle=\sum_{n\geq 0}d^{(r)}_{n}x^{n}
G(x;𝐁(r))\displaystyle G(x;\mathbf{B}^{(r)}) =n0bn(r)xn\displaystyle=\sum_{n\geq 0}b^{(r)}_{n}x^{n} G(x;𝐄(r))\displaystyle G(x;\mathbf{E}^{(r)}) =n0en(r)xn\displaystyle=\sum_{n\geq 0}e^{(r)}_{n}x^{n}
G(x;𝐂(r))\displaystyle G(x;\mathbf{C}^{(r)}) =n0cn(r)xn\displaystyle=\sum_{n\geq 0}c^{(r)}_{n}x^{n} G(x;𝐅(r))\displaystyle G(x;\mathbf{F}^{(r)}) =n0fn(r)xn\displaystyle=\sum_{n\geq 0}f^{(r)}_{n}x^{n}

which are the ordinary generating functions for our sequences. Also for any r0r\geq 0, v𝒮rv\in\mathcal{S}_{r}, and 𝐋{𝐀(r),𝐁(r),𝐂(r),𝐃(r),𝐄(r),𝐅(r)}\mathbf{L}\in\{\mathbf{A}^{(r)},\mathbf{B}^{(r)},\mathbf{C}^{(r)},\mathbf{D}^{(r)},\mathbf{E}^{(r)},\mathbf{F}^{(r)}\} we let 𝐋(v)L\mathbf{L}(v)\subseteq L be the sublanguage of walks which start with vv. Furthermore, we let

G(x;𝐋(v))=n0|𝐋(v)𝒮d2n|xnG(x;\mathbf{L}(v))=\sum_{n\geq 0}|\mathbf{L}(v)\cap\mathcal{S}_{d}^{2n}|x^{n}

be the generating function for these walks with a given first step.

We now review some facts on power series which can be found in [Sta80]. A formal power series G(x)G(x) is algebraic if it satisfies a nontrivial polynomial equation. A holonomic sequence is a sequence that satisfies a recurrence relation with polynomial coefficients. That is, a sequence {tn}n0\{t_{n}\}_{n\geq 0} such that

pj(n)tn+j+pj1(n)tn+j1++p0(n)tn=0p_{j}(n)t_{n+j}+p_{j-1}(n)t_{n+j-1}+\cdots+p_{0}(n)t_{n}=0

for some jj and polynomials pi(n)p_{i}(n) not all of which are equal to zero. The sequence of coefficients of an algebraic formal power series is holonomic.

From a generating function one can find the asymptotics of its sequence of coefficients. Methods for obtaining these asymptotic expressions are well established and can be found in the text [FS09]. We write f(n)g(n)f(n)\sim g(n) to mean that

limnf(n)g(n)=1\lim_{n\to\infty}\frac{f(n)}{g(n)}=1

which is the standard notation. Consider a generating function G(z)=n0gnznG(z)=\sum_{n\geq 0}g_{n}z^{n} viewed as a complex analytic function and let ρ\rho be its unique singularity closest to the origin. Assume G(z)G(z) approaches C(1zρ)αC\cdot(1-\frac{z}{\rho})^{-\alpha} as zρz\to\rho for some constant CC where α\alpha is neither 0 nor a negative integer. This is the situation that will be relevant to use, and under these assumptions

gnCρnnα1Γ(α)g_{n}\sim\frac{C\rho^{-n}n^{\alpha-1}}{\Gamma(\alpha)}

where Γ(α)\Gamma(\alpha) denotes the Gamma function.

Let us now show using formal language and generating function theory that each of our generating functions are algebraic from which it follows each of the sequences is holonomic. Our goal will be to further understand these generating functions and find the recurrence relations that the sequences obey. The Chomsky–Schützenberger enumeration theorem [CS63] (see [KS86, Pan05] for proofs) says that the length generating function of an unambigous context free language is algebraic. A deterministic context free language is a language recognized by a deterministic push down automata (DPDA). Ginsburg and Greibach [GG66] have shown that a deterministic context free language is an unambiguous context free language and that when such a language is intersected with a regular language it remains a deterministic context free language.

start (v,1),Z0Z0U(v,1),Z_{0}\to Z_{0}U (v,1),Z0Z0D(v,-1),Z_{0}\to Z_{0}D ϵ,Z0Z0\epsilon,Z_{0}\to Z_{0} (v,1),UUU(v,1),U\to UU (v,1),Dϵ(v,1),D\to\epsilon (v,1),Uϵ(v,-1),U\to\epsilon (v,1),DDD(v,-1),D\to DD
Figure 1. A DPDA recognizing 𝐀(r)\mathbf{A}^{(r)} where vv represents any vector in {±1}r\{\pm 1\}^{r}.
start (v,1),Z0Z0U(v,1),Z_{0}\to Z_{0}U ϵ,Z0Z0\epsilon,Z_{0}\to Z_{0} (v,1),UUU(v,1),U\to UU (v,1),Uϵ(v,-1),U\to\epsilon
Figure 2. A DPDA recognizing 𝐃(r)\mathbf{D}^{(r)} where vv represents any vector in {±1}r\{\pm 1\}^{r}.
Theorem 2.2.

Let 𝐋{𝐀(r),𝐁(r),𝐂(r),𝐃(r),𝐄(r),𝐅(r)}\mathbf{L}\in\{\mathbf{A}^{(r)},\mathbf{B}^{(r)},\mathbf{C}^{(r)},\mathbf{D}^{(r)},\mathbf{E}^{(r)},\mathbf{F}^{(r)}\} be one of our languages, then LL is a deterministic context free language. Hence, G(x;L)G(x;L) is algebraic and its sequence of coefficients is holomonic.

Proof.

It suffices to prove that each of 𝐀(r)\mathbf{A}^{(r)} and 𝐃(r)\mathbf{D}^{(r)} is recognized by a DPDA. Both of the languages 𝐗(r)\mathbf{X}^{(r)} and 𝐘(r)\mathbf{Y}^{(r)} consisting of walks which respectively avoid the backtracking pattern [v,v][v,-v] as well as which avoid the repeat pattern [v,v][v,v] (but can end anywhere) are regular. Since 𝐁(r)=𝐀(r)𝐗(r)\mathbf{B}^{(r)}=\mathbf{A}^{(r)}\cap\mathbf{X}^{(r)}, 𝐂(r)=𝐀(r)𝐘(r)\mathbf{C}^{(r)}=\mathbf{A}^{(r)}\cap\mathbf{Y}^{(r)}, 𝐄(r)=𝐃(r)𝐗(r)\mathbf{E}^{(r)}=\mathbf{D}^{(r)}\cap\mathbf{X}^{(r)}, and 𝐅(r)=𝐃(r)𝐘(r)\mathbf{F}^{(r)}=\mathbf{D}^{(r)}\cap\mathbf{Y}^{(r)} it will follow that each of these will be deterministic context free languages. By the Chomsky–Schützenberger enumeration theorem all the generating functions will be algebraic. Therefore each of the sequences must be holonomic. DPDAs recognizing the languages 𝐀(r)\mathbf{A}^{(r)} and 𝐃(r)\mathbf{D}^{(r)} are shown in Figure 1 and Figure 2 respectively. ∎

Remark 2.3.

Theorem 2.2 essentially follows from the definition of our languages. Its purpose is to make rigorous the fact that generating functions are algebraic and that their sequences of coefficients are holonomic. It is worth noting that there are other techniques that can also be used to obtain the algebraicity of the generating functions (e.g. the vectorial kernel method). We also note the method above the flexible to other situations (e.g. intersecting with a different regular language coming from a pattern or patterns).

Now that we know our generating functions are algebraic we turn our attention to describing these generating functions and their coefficient as explicitly as possible. The values of an(r)a_{n}^{(r)} and F(x;𝐀(r))F(x;\mathbf{A}^{(r)}) can be found without difficulty. We have that

(1) an(r)=22nr(2nn)a^{(r)}_{n}=2^{2nr}\binom{2n}{n}

since any walk in 𝐀(r)\mathbf{A}^{(r)} is

[v1,v2,,v2n][v_{1},v_{2},\dots,v_{2n}]

where for coordinates 1ir1\leq i\leq r in v1,,v2nv_{1},\dots,v_{2n} form any binary string and the last coordinate makes a balanced binary string. Hence, an(r)a^{(r)}_{n} satisfies the recurrence

(2) nan(r)=22r+1(2n1)an1(r)na^{(r)}_{n}=2^{2r+1}(2n-1)a^{(r)}_{n-1}

of the form guaranteed from being holonomic. It follows that

(3) G(x;𝐀(r))=1122r+2x=114(4rx)G(x;\mathbf{A}^{(r)})=\frac{1}{\sqrt{1-2^{2r+2}x}}=\frac{1}{\sqrt{1-4(4^{r}x)}}

is the expression for the generating function. By similar arguments we find that

(4) dn(r)=22nrn+1(2nn)=22nrCnd^{(r)}_{n}=\frac{2^{2nr}}{n+1}\binom{2n}{n}=2^{2nr}C_{n}

where Cn=1n+1(2nn)C_{n}=\frac{1}{n+1}\binom{2n}{n} is the nnth Catalan number. Also,

(5) (n+1)dn(r)=22r+1(2n1)dn1(r)(n+1)d^{(r)}_{n}=2^{2r+1}(2n-1)d^{(r)}_{n-1}

and

(6) G(x;𝐃(r))=114(4rx)2G(x;\mathbf{D}^{(r)})=\frac{1-\sqrt{1-4(4^{r}x)}}{2}

give the recurrence and generating function for dn(r)d^{(r)}_{n}

3. Formulas and recurrences

In this section we find formulas for each of the sequences {bn(r)}n0\{b^{(r)}_{n}\}_{n\geq 0}, {cn(r)}n0\{c^{(r)}_{n}\}_{n\geq 0}, {en(r)}n0\{e^{(r)}_{n}\}_{n\geq 0}, and {fn(r)}n0\{f^{(r)}_{n}\}_{n\geq 0} consisting of a sum of hypergeometric terms and as an evaluation of a hypergeometric function. Zeilberger’s algorithm [Zei90, Zei91] is then applied to obtain a recurrence.

3.1. Ending on a hyperplane

For a given integer nn, an integer composition of nn is an ordered sequence of positive integers which sum to nn. The notion of an integer composition will be essential to the proofs of the next two theorems. We will write αn\alpha\vDash n to denote that α\alpha is an integer composition of nn. The length of an integer composition α\alpha is the number of elements in the sequence and is denoted by (α)\ell(\alpha). For example, α=(1,1,3)\alpha=(1,1,3) and β=(1,3,1)\beta=(1,3,1) are two distinct integer compositions of 55 both of length (α)=(β)=3\ell(\alpha)=\ell(\beta)=3. A known fact about integer compositions which we will use is that there are (n1k1)\binom{n-1}{k-1} integer compositions of nn with length equal to kk.

Theorem 3.1.

For any r1r\geq 1 and n1n\geq 1 we have

bn(r)\displaystyle b^{(r)}_{n} =2k=1n(2r1)2k22r(2n2k+1)(n1k1)((2r1)(n1k1)+2r(n1k2))\displaystyle=2\sum_{k=1}^{n}(2^{r}-1)^{2k-2}2^{r(2n-2k+1)}\binom{n-1}{k-1}\left((2^{r}-1)\binom{n-1}{k-1}+2^{r}\binom{n-1}{k-2}\right)
=2(22rn2r(2n1))F23[.n,n+1,2rnn+11,2rnn.;(2r1)2(12)2r]\displaystyle=2\left(2^{2rn}-2^{r(2n-1)}\right){}_{3}F_{2}{\left[\genfrac{.}{.}{0.0pt}{}{-n{\mathchar 44\relax}\mskip 8.0mu-n+1{\mathchar 44\relax}\mskip 8.0mu2^{r}n-n+1}{1{\mathchar 44\relax}\mskip 8.0mu2^{r}n-n};(2^{r}-1)^{2}\left(\frac{1}{2}\right)^{2r}\right]}

which satisfies the recurrence

nbn(r)=2((22r+12r+1+1)(n1)+22r2r)bn1(r)(2r+11)2(n2)bn2(r)nb^{(r)}_{n}=2\left((2^{2r+1}-2^{r+1}+1)(n-1)+2^{2r}-2^{r}\right)b^{(r)}_{n-1}-(2^{r+1}-1)^{2}(n-2)b^{(r)}_{n-2}

for n3n\geq 3 with b1(r)=2r+1(2r1)b^{(r)}_{1}=2^{r+1}(2^{r}-1) and

b2(r)=23r+1(2r1)+22r+1(2r1)2+2r+1(2r1)3.b^{(r)}_{2}=2^{3r+1}(2^{r}-1)+2^{2r+1}(2^{r}-1)^{2}+2^{r+1}(2^{r}-1)^{3}.
Proof.

Recall that bn(r)b^{(r)}_{n} counts the number of walks of length 2n2n which avoid backtracking and end with xr+1=0x_{r+1}=0. Consider the projection of such a walk onto the xr+1x_{r+1}-axis. This projection can be encoded by a word with up steps UU and down steps DD corresponding to if step in the walk had the last coordinate +1+1 or 1-1 respectively. Let us assume the word starts with a UU. The case that starts with a DD is completely analogous. The lengths of the runs of UU’s and DD’s will give two integer compositions αn\alpha\vDash n and βn\beta\vDash n respectively where =(β){k1,k}\ell=\ell(\beta)\in\{k-1,k\} when (α)=k\ell(\alpha)=k. The vector corresponding to each UU and DD has the last coordinate determined and then has either 2r2^{r} or 2r12^{r}-1 choices for which v{±1}rv\in\{\pm 1\}^{r} it could have came from making the prefix of the first rr coordinates of the vector. Looking at only the UU’s, we see that the UsU^{\prime}s with only 2r12^{r}-1 choices are those in positions α1+1,α1+α2+1,,α1++αk1+1\alpha_{1}+1,\alpha_{1}+\alpha_{2}+1,\dots,\alpha_{1}+\cdots+\alpha_{k-1}+1. Looking at only the DD’s, we see that the DD’s with only 2r12^{r}-1 choices are those in positions 1,β1+1,β1+β2+1,,β1++β1+11,\beta_{1}+1,\beta_{1}+\beta_{2}+1,\dots,\beta_{1}+\cdots+\beta_{\ell-1}+1. Thus we find that

bn(r)\displaystyle b^{(r)}_{n} =2k=1nαn(α)=k(2r1)k12r(nk+1)(βn(β)=k(2r1)k2r(nk)+βn(β)=k1(2r1)k12r(nk+1))\displaystyle=2\sum_{k=1}^{n}\sum_{\begin{subarray}{c}\alpha\vDash n\\ \ell(\alpha)=k\end{subarray}}(2^{r}-1)^{k-1}2^{r(n-k+1)}\left(\sum_{\begin{subarray}{c}\beta\vDash n\\ \ell(\beta)=k\end{subarray}}(2^{r}-1)^{k}2^{r(n-k)}+\sum_{\begin{subarray}{c}\beta\vDash n\\ \ell(\beta)=k-1\end{subarray}}(2^{r}-1)^{k-1}2^{r(n-k+1)}\right)
=2k=1n(2r1)k12r(nk+1)(n1k1)((2r1)k2r(nk)(n1k1)+(2r1)k12r(nk+1)(n1k2))\displaystyle=2\sum_{k=1}^{n}(2^{r}-1)^{k-1}2^{r(n-k+1)}\binom{n-1}{k-1}\left((2^{r}-1)^{k}2^{r(n-k)}\binom{n-1}{k-1}+(2^{r}-1)^{k-1}2^{r(n-k+1)}\binom{n-1}{k-2}\right)
=2k=1n(2r1)2k22r(2n2k+1)(n1k1)((2r1)(n1k1)+2r(n1k2))\displaystyle=2\sum_{k=1}^{n}(2^{r}-1)^{2k-2}2^{r(2n-2k+1)}\binom{n-1}{k-1}\left((2^{r}-1)\binom{n-1}{k-1}+2^{r}\binom{n-1}{k-2}\right)

Once we have bn(r)b^{(r)}_{n} expressed in this way as a sum over hypergeometric terms we may find the hypergeometric evaluation and recurrence using automated methods. In the appendix we show how this computation can be performed in Maple.

Example 3.2.

For r=1r=1 and n=4n=4 along with the two integer compositions (1,2,1)(1,2,1) and (2,2)(2,2) we have 25=322^{5}=32 lattice walks in the plane contributing to the count of a4(1)a^{(1)}_{4}. Projecting onto the x2x_{2}-axis all such walks will be either

[U2,D1,D2,U1,U2,D1,D2,U1][{}^{2}U,{}^{1}D,{}^{2}D,{}^{1}U,{}^{2}U,{}^{1}D,{}^{2}D,{}^{1}U]

or

[D2,U1,U2,D1,D2,U1,U2,D1].[{}^{2}D,{}^{1}U,{}^{2}U,{}^{1}D,{}^{2}D,{}^{1}U,{}^{2}U,{}^{1}D].

Here the superscripts indicate how many choices we have for each step as a 22-dimensional walk. We let

{±1}2={NE:=(1,1),NW:=(1,1),SE:=(1,1),SW:=(1,1)}.\{\pm 1\}^{2}=\{NE:=(1,1),NW:=(-1,1),SE:=(1,-1),SW:=(-1,-1)\}.

Accounting for the symmetry of reflection over the x1x_{1}-axis and the x2x_{2}-axis (i.e. exchanging EE and WW or exchanging NN and SS) there are 88 walks each starting with NENE which are shown both as words and graphed in the plane in Figure 3.

[NE,SE,SE,NE,NE,SE,SE,NE][NE,SE,SE,NE,NE,SE,SE,NE][NE,SE,SE,NE,NE,SE,SW,NW][NE,SE,SE,NE,NE,SE,SW,NW][NE,SE,SE,NE,NW,SW,SE,NE][NE,SE,SE,NE,NW,SW,SE,NE][NE,SE,SW,NW,NE,SE,SE,NE][NE,SE,SW,NW,NE,SE,SE,NE][NE,SE,SE,NE,NW,SW,SW,NW][NE,SE,SE,NE,NW,SW,SW,NW][NE,SE,SW,NW,NE,SE,SW,NW][NE,SE,SW,NW,NE,SE,SW,NW][NE,SE,SW,NW,NW,SW,SE,NE][NE,SE,SW,NW,NW,SW,SE,NE][NE,SE,SW,NW,NW,SW,SW,NE][NE,SE,SW,NW,NW,SW,SW,NE]
Figure 3. Here are 88 walks from which all 3232 walks in the plane avoiding backtracking corresponding to the integer compositions (1,2,1)(1,2,1) and (2,2)(2,2) can be obtained.
Theorem 3.3.

For any r1r\geq 1 and n1n\geq 1 we have

cn(r)\displaystyle c^{(r)}_{n} =2k=1n(2r1)2n2k2r(2k1)(n1k1)(2r(n1k1)+(2r1)(n1k2))\displaystyle=2\sum_{k=1}^{n}(2^{r}-1)^{2n-2k}2^{r(2k-1)}\binom{n-1}{k-1}\left(2^{r}\binom{n-1}{k-1}+(2^{r}-1)\binom{n-1}{k-2}\right)
=22r+1(2r1)2n2F23[.n,n+1,2rn+11,2rn.;22r(2r1)2]\displaystyle=2^{2r+1}(2^{r}-1)^{2n-2}{}_{3}F_{2}{\left[\genfrac{.}{.}{0.0pt}{}{-n{\mathchar 44\relax}\mskip 8.0mu-n+1{\mathchar 44\relax}\mskip 8.0mu-2^{r}n+1}{1{\mathchar 44\relax}\mskip 8.0mu-2^{r}n};\frac{2^{2r}}{(2^{r}-1)^{2}}\right]}

which satisfies the recurrence

ncn(r)=2((22r+12r+1+1)(n1)+22r2r)cn1(r)(2r+11)2(n2)cn2(r)nc^{(r)}_{n}=2\left((2^{2r+1}-2^{r+1}+1)(n-1)+2^{2r}-2^{r}\right)c^{(r)}_{n-1}-(2^{r+1}-1)^{2}(n-2)c^{(r)}_{n-2}

for n3n\geq 3 with c1(r)=22r+1c^{(r)}_{1}=2^{2r+1} and

c2(r)=24r+1+23r+1(2r1)+22r+1(2r1)2.c^{(r)}_{2}=2^{4r+1}+2^{3r+1}(2^{r}-1)+2^{2r+1}(2^{r}-1)^{2}.
Proof.

Recall that cn(r)c^{(r)}_{n} counts the number of walks of length 2n2n which avoid consecutive repeated steps and end with xr+1=0x_{r+1}=0. Proceeding similarly to the proof of Theorem 3.1, we consider the projection of such a walk onto the xr+1x_{r+1}-axis. Again this projection can be encoded by a word with up steps UU and down steps DD meaning the corresponding step in the walk had the last coordinate +1+1 or 1-1 respectively. Let us assume the word starts with a UU since the case that starts with a DD is completely analogous. The lengths of the runs of UU’s and DD’s will give two integer compositions αn\alpha\vDash n and βn\beta\vDash n respectively where =(β){k1,k}\ell=\ell(\beta)\in\{k-1,k\} when (α)=k\ell(\alpha)=k. The vector corresponding to each UU and DD has the last coordinate determined and then has either 2r2^{r} or 2r12^{r}-1 choices for which v{±1}rv\in\{\pm 1\}^{r} it could have came from making the prefix of the first rr coordinates. Looking at only the UU’s, we see that the UsU^{\prime}s with 2r2^{r} choices are those in positions 1,α1+1,α1+α2+1,,α1++αk1+11,\alpha_{1}+1,\alpha_{1}+\alpha_{2}+1,\dots,\alpha_{1}+\cdots+\alpha_{k-1}+1. Looking at only the DD’s, we see that the DD’s with 2r2^{r} choices are those in positions 1,β1+1,β1+β2+1,,β1++β1+11,\beta_{1}+1,\beta_{1}+\beta_{2}+1,\dots,\beta_{1}+\cdots+\beta_{\ell-1}+1. So, it follows that

cn(r)\displaystyle c^{(r)}_{n} =2k=1nαn(α)=k(2r1)nk2rk(βn(β)=k(2r1)nk2rk+βn(β)=k1(2r1)nk+12r(k1))\displaystyle=2\sum_{k=1}^{n}\sum_{\begin{subarray}{c}\alpha\vDash n\\ \ell(\alpha)=k\end{subarray}}(2^{r}-1)^{n-k}2^{rk}\left(\sum_{\begin{subarray}{c}\beta\vDash n\\ \ell(\beta)=k\end{subarray}}(2^{r}-1)^{n-k}2^{rk}+\sum_{\begin{subarray}{c}\beta\vDash n\\ \ell(\beta)=k-1\end{subarray}}(2^{r}-1)^{n-k+1}2^{r(k-1)}\right)
=2k=1n(2r1)nk2rk(n1k1)((2r1)nk2rk(n1k1)+(2r1)nk+12r(k1)(n1k2))\displaystyle=2\sum_{k=1}^{n}(2^{r}-1)^{n-k}2^{rk}\binom{n-1}{k-1}\left((2^{r}-1)^{n-k}2^{rk}\binom{n-1}{k-1}+(2^{r}-1)^{n-k+1}2^{r(k-1)}\binom{n-1}{k-2}\right)
=2k=1n(2r1)2n2k2r(2k1)(n1k1)(2r(n1k1)+(2r1)(n1k2))\displaystyle=2\sum_{k=1}^{n}(2^{r}-1)^{2n-2k}2^{r(2k-1)}\binom{n-1}{k-1}\left(2^{r}\binom{n-1}{k-1}+(2^{r}-1)\binom{n-1}{k-2}\right)

Notice the only difference with Theorem 3.1 is that exponents of (2r1)(2^{r}-1) and 2r2^{r} are changed. Once we have cn(r)c^{(r)}_{n} expressed in this way as a sum over hypergeometric terms we may find the hypergeometric evaluation and recurrence using automated methods. In the appendix we show how this computation can be performed in Maple. ∎

3.2. Ending on a hyperplane and restricted to a halfspace

Theorem 3.4.

For any r1r\geq 1 and n1n\geq 1 we have

en(r)\displaystyle e^{(r)}_{n} =1nk=1n(2r1)2k12r(2n2k+1)(nk)(nk1)\displaystyle=\frac{1}{n}\sum_{k=1}^{n}(2^{r}-1)^{2k-1}2^{r(2n-2k+1)}\binom{n}{k}\binom{n}{k-1}
=(22rn2r(2n1))F12[.n,n+12.;(2r1)2(12)2r]\displaystyle=\left(2^{2rn}-2^{r(2n-1)}\right){}_{2}F_{1}{\left[\genfrac{.}{.}{0.0pt}{}{-n{\mathchar 44\relax}\mskip 8.0mu-n+1}{2};(2^{r}-1)^{2}\left(\frac{1}{2}\right)^{2r}\right]}

which satisfies the recurrence

(n+1)en(r)=(22r+12r+1+1)(2n1)en1(r)(2r+11)2(n2)en2(r)(n+1)e^{(r)}_{n}=(2^{2r+1}-2^{r+1}+1)(2n-1)e^{(r)}_{n-1}-(2^{r+1}-1)^{2}(n-2)e^{(r)}_{n-2}

for n3n\geq 3 with e1(r)=2r(2r1)e^{(r)}_{1}=2^{r}(2^{r}-1) and e2(r)=23r(2r1)+2r(2r1)3e^{(r)}_{2}=2^{3r}(2^{r}-1)+2^{r}(2^{r}-1)^{3}.

Proof.

Recall that en(r)e^{(r)}_{n} counts the number of walks of length 2n2n which avoid backtracking and end with xr+1=0x_{r+1}=0 while staying the half space defined by xr+10x_{r+1}\geq 0. In the last coordinate we must have a Dyck path. We partition Dyck paths of semilength nn by number of peaks. The Narayana number

N(n,k)=1n(nk)(nk1)N(n,k)=\frac{1}{n}\binom{n}{k}\binom{n}{k-1}

gives the number of Dyck paths of semilength nn with kk peaks (and hence k1k-1 valleys). For the first rr coordinates with have 2r2^{r} choices for each step except for the steps directly after a peak or valley for which we only have (2r1)(2^{r}-1) choices. Once we have en(r)e^{(r)}_{n} expressed in this way as a sum over hypergeometric terms we may find the hypergeometric evaluation and recurrence using automated methods. In the appendix we show how this computation can be performed in Maple. ∎

Theorem 3.5.

For any r1r\geq 1 and n1n\geq 1 we have

fn(r)\displaystyle f^{(r)}_{n} =1nk=1n(2r1)2n2k22rk(nk)(nk1)\displaystyle=\frac{1}{n}\sum_{k=1}^{n}(2^{r}-1)^{2n-2k}2^{2rk}\binom{n}{k}\binom{n}{k-1}
=22r(2r1)2n2F12[.n,n+12.;22r(2r1)2]\displaystyle=2^{2r}(2^{r}-1)^{2n-2}{}_{2}F_{1}{\left[\genfrac{.}{.}{0.0pt}{}{-n{\mathchar 44\relax}\mskip 8.0mu-n+1}{2};\frac{2^{2r}}{(2^{r}-1)^{2}}\right]}

which satisfies the recurrence

(n+1)fn(r)=(22r+12r+1+1)(2n1)fn1(r)(2r+11)2(n2)fn2(r)(n+1)f^{(r)}_{n}=(2^{2r+1}-2^{r+1}+1)(2n-1)f^{(r)}_{n-1}-(2^{r+1}-1)^{2}(n-2)f^{(r)}_{n-2}

for n3n\geq 3 with f1(r)=22rf^{(r)}_{1}=2^{2r} and f2(r)=24r+22r(2r1)2f^{(r)}_{2}=2^{4r}+2^{2r}(2^{r}-1)^{2}.

Proof.

Recall that fn(r)f^{(r)}_{n} counts the number of walks of length 2n2n which avoid the repeat pattern and end with xr+1=0x_{r+1}=0 while staying the half space defined by xr+10x_{r+1}\geq 0. In the last coordinate we must have a Dyck path. We again partition Dyck paths of semilength nn by number of peaks given by Narayana numbers

N(n,k)=1n(nk)(nk1)N(n,k)=\frac{1}{n}\binom{n}{k}\binom{n}{k-1}

for each 1kn1\leq k\leq n. For the first rr coordinates with have 2r2^{r} for only the steps directly after a peak or valley as well as for the first step. At all other steps we have (2r1)(2^{r}-1) choices for the first rr coordinates. Once we have fn(r)f^{(r)}_{n} expressed in this way as a sum over hypergeometric terms we may find the hypergeometric evaluation and recurrence using automated methods. In the appendix we show how this computation can be performed in Maple. ∎

Example 3.6.

For r=1r=1 and n=4n=4 consider walks contributing to f4(1)f^{(1)}_{4} projecting onto the Dyck path [U2,U1,U1,D2,U2,D2,D1,D1][{}^{2}U,{}^{1}U,{}^{1}U,{}^{2}D,{}^{2}U,{}^{2}D,{}^{1}D,{}^{1}D] where UU and DD are up and down steps respectively and superscripts indicated the number of choices for each step. There are 24=162^{4}=16 such paths because this Dyck path has 22 peaks and 11 valley. We let

{±1}2={NE:=(1,1),NW:=(1,1),SE:=(1,1),SW:=(1,1)}\{\pm 1\}^{2}=\{NE:=(1,1),NW:=(-1,1),SE:=(1,-1),SW:=(-1,-1)\}

and accounting for symmetry we may assume NENE is the first step. This results in 88 walks shown in Figure 4.

[NE,NW,NE,SE,NE,SE,SW,SE][NE,NW,NE,SE,NE,SE,SW,SE][NE,NW,NE,SE,NE,SW,SE,SW][NE,NW,NE,SE,NE,SW,SE,SW][NE,NW,NE,SE,NW,SE,SW,SE][NE,NW,NE,SE,NW,SE,SW,SE][NE,NW,NE,SE,NW,SW,SE,SW][NE,NW,NE,SE,NW,SW,SE,SW][NE,NW,NE,SW,NE,SE,SW,SE][NE,NW,NE,SW,NE,SE,SW,SE][NE,NW,NE,SW,NE,SW,SE,SW][NE,NW,NE,SW,NE,SW,SE,SW][NE,NW,NE,SW,NW,SE,SW,SE][NE,NW,NE,SW,NW,SE,SW,SE][NE,NW,NE,SW,NW,SW,SE,SW][NE,NW,NE,SW,NW,SW,SE,SW]
Figure 4. Here are 88 walks from which all 1616 walks in the plane avoiding consecutive steps projecting up the Dyck path [U,U,U,D,U,D,D,D][U,U,U,D,U,D,D,D] can be obtained.

4. Generating functions and asymptotics

In this section we give a formula for each of the generating functions G(x;𝐁(r))G(x;\mathbf{B}^{(r)}), G(x;𝐂(r))G(x;\mathbf{C}^{(r)}), G(x;𝐄(r))G(x;\mathbf{E}^{(r)}), and G(x;𝐅(r))G(x;\mathbf{F}^{(r)}).

Lemma 4.1.

If r0r\geq 0 and v=(v,1)𝒮rv=(v^{\prime},1)\in\mathcal{S}_{r}, then G(x;𝐄(r)(v))=12r(G(x;𝐄(r))1)G(x;\mathbf{E}^{(r)}(v))=\frac{1}{2^{r}}\left(G(x;\mathbf{E}^{(r)})-1\right).

Proof.

Let ϵi:𝒮r𝒮r\epsilon_{i}:\mathcal{S}_{r}\to\mathcal{S}_{r} be defined by

(y1,,yi1,yi,yi+1,yr+1)(y1,,yi1,yi,yi+1,yr+1)(y_{1},\dots,y_{i-1},y_{i},y_{i+1}\dots,y_{r+1})\mapsto(y_{1},\dots,y_{i-1},-y_{i},y_{i+1}\dots,y_{r+1})

for each 1ir1\leq i\leq r. It is clear ϵi\epsilon_{i} is an involution, and hence a bijection. We have that [v1,v2,,v2n]𝐄(r)[v_{1},v_{2},\dots,v_{2n}]\in\mathbf{E}^{(r)} if and only if [ϵi(v1),ϵi(v2),,ϵi(v2n)]𝐄(r)[\epsilon_{i}(v_{1}),\epsilon_{i}(v_{2}),\dots,\epsilon_{i}(v_{2n})]\in\mathbf{E}^{(r)}. This is because v=uv=-u if and only if ϵi(v)=ϵi(u)\epsilon_{i}(v)=-\epsilon_{i}(u) and because the sum of the last coordinate is preserved. Now given any v=(v,1)𝒮rv=(v^{\prime},1)\in\mathcal{S}_{r} we can obtain any other u=(u,1)𝒮ru=(u^{\prime},1)\in\mathcal{S}_{r} by ϵiϵi1ϵi1\epsilon_{i_{\ell}}\circ\epsilon_{i_{\ell-1}}\circ\cdots\circ\epsilon_{i_{1}} for any some sequence i1,i2,,ii_{1},i_{2},\dots,i_{\ell} (i.e. the coordinates where vv and uu differ). It follows that G(x;𝐄(r)(v))=G(x;𝐄(r)(u))G(x;\mathbf{E}^{(r)}(v))=G(x;\mathbf{E}^{(r)}(u)). The lemma follows since

G(x;𝐄(r))1=v=(v,1)𝒮rG(x;𝐄(r)(v))G(x;\mathbf{E}^{(r)})-1=\sum_{v=(v^{\prime},1)\in\mathcal{S}_{r}}G(x;\mathbf{E}^{(r)}(v))

as all nonempty walks must start with some v=(v,1)𝒮rv=(v^{\prime},1)\in\mathcal{S}_{r} while 𝐄(r)(v)𝐄(r)(u)=\mathbf{E}^{(r)}(v)\cap\mathbf{E}^{(r)}(u)=\varnothing for vuv\neq u. ∎

Lemma 4.2.

If r0r\geq 0 and v𝒮rv\in\mathcal{S}_{r}, then G(x;𝐁(r)(v))=12r+1(G(x;𝐁(r))1)G(x;\mathbf{B}^{(r)}(v))=\frac{1}{2^{r+1}}\left(G(x;\mathbf{B}^{(r)})-1\right).

Proof.

The proof is very similar to the proof of Lemma 4.1. The only essential difference is that a walk in 𝐁(r)\mathbf{B}^{(r)} can begin with any v𝒮rv\in\mathcal{S}_{r} and hence we are also allowed the use the similarly defined ϵr+1:𝒮r𝒮r\epsilon_{r+1}:\mathcal{S}_{r}\to\mathcal{S}_{r}. ∎

Lemma 4.3.

For any r,n1r,n\geq 1 we have that 2rbn(r)=(2r1)cn(r)2^{r}b^{(r)}_{n}=(2^{r}-1)c^{(r)}_{n} and 2ren(r)=(2r1)fn(r)2^{r}e^{(r)}_{n}=(2^{r}-1)f^{(r)}_{n}.

Proof.

Using Theorem 3.1, Theorem 3.3, Theorem 3.4, and Theorem 3.5 we see that {bn(r)}\{b^{(r)}_{n}\} satisfies the same recurrence as {cn(r)}\{c^{(r)}_{n}\} while {en(r)}\{e^{(r)}_{n}\} satisfies the same recurrence as {fn(r)}\{f^{(r)}_{n}\}. It remains only to check initial conditions. We find that

2rb1(r)=2r(2r+1(2r1))=(2r1)22r+1=(2r1)c1(r)2^{r}b^{(r)}_{1}=2^{r}(2^{r+1}(2^{r}-1))=(2^{r}-1)2^{2r+1}=(2^{r}-1)c^{(r)}_{1}

and also

2rb2(r)\displaystyle 2^{r}b^{(r)}_{2} =2r(23r+1(2r1)+22r+1(2r1)2+2r+1(2r1)3)\displaystyle=2^{r}(2^{3r+1}(2^{r}-1)+2^{2r+1}(2^{r}-1)^{2}+2^{r+1}(2^{r}-1)^{3})
=(2r1)(24r+1+23r+1(2r1)+22r+1(2r1)2)\displaystyle=(2^{r}-1)(2^{4r+1}+2^{3r+1}(2^{r}-1)+2^{2r+1}(2^{r}-1)^{2})
=(2r1)c2(r)\displaystyle=(2^{r}-1)c^{(r)}_{2}

so the lemma is proven for bn(r)b^{(r)}_{n} and cn(r)c^{(r)}_{n}. In a similar way

2re1(r)=2r(2r(2r1))=(2r1)(22r)=(2r1)f1(r)2^{r}e^{(r)}_{1}=2^{r}(2^{r}(2^{r}-1))=(2^{r}-1)(2^{2r})=(2^{r}-1)f^{(r)}_{1}

and

2re2(r)=2r(23r(2r1)+2r(2r1)3)=(2r1)(24r+22r(2r1)2)=(2r1)f2(r)2^{r}e^{(r)}_{2}=2^{r}(2^{3r}(2^{r}-1)+2^{r}(2^{r}-1)^{3})=(2^{r}-1)(2^{4r}+2^{2r}(2^{r}-1)^{2})=(2^{r}-1)f^{(r)}_{2}

which completes the proof of the lemma. ∎

Theorem 4.4.

For any r>0r>0 we have

G(x;𝐁(r))\displaystyle G(x;\mathbf{B}^{(r)}) =1x1(2r+11)2x\displaystyle=\sqrt{\frac{1-x}{1-(2^{r+1}-1)^{2}x}}
G(x;𝐂(r))\displaystyle G(x;\mathbf{C}^{(r)}) =2r1x1(2r+11)2x(2r1)1(2r+11)2x\displaystyle=\frac{2^{r}\sqrt{1-x}-\sqrt{1-(2^{r+1}-1)^{2}x}}{(2^{r}-1)\sqrt{1-(2^{r+1}-1)^{2}x}}
G(x;𝐄(r))\displaystyle G(x;\mathbf{E}^{(r)}) =1x(1(2r+11)2x)(1x)2r+1(2r1)x\displaystyle=\frac{1-x-\sqrt{\big{(}1-(2^{r+1}-1)^{2}x\big{)}\left(1-x\right)}}{2^{r+1}(2^{r}-1)x}
G(x;𝐅(r))\displaystyle G(x;\mathbf{F}^{(r)}) =1(2r+11)x(1(2r+11)2x)(1x)2(2r1)2x\displaystyle=\frac{1-(2^{r+1}-1)x-\sqrt{\big{(}1-(2^{r+1}-1)^{2}x\big{)}(1-x)}}{2(2^{r}-1)^{2}x}

while for r=0r=0 we have

G(x;𝐂(0))\displaystyle G(x;\mathbf{C}^{(0)}) =1+x1x\displaystyle=\frac{1+x}{1-x} G(x;𝐅(0))\displaystyle G(x;\mathbf{F}^{(0)}) =11x\displaystyle=\frac{1}{1-x}

and G(x;𝐁(0))=G(x;𝐄(0))=1G(x;\mathbf{B}^{(0)})=G(x;\mathbf{E}^{(0)})=1.

Proof.

For r=0r=0 the result is easy as there are no nonempty walks avoiding backtracking ending at the origin while [+1,1]n[+1,-1]^{n} and [1,+1]n[-1,+1]^{n} are the only walks avoiding consecutive steps ending at the origin with only the former confined to the nonnegative integers. To establish the generating function identity for 𝐄(r)\mathbf{E}^{(r)} with r>1r>1 we split the walk where it first returns to xr+1=0x_{r+1}=0. We note any walk in 𝐄(r)\mathbf{E}^{(r)} is:

  1. (i)

    empty,

  2. (ii)

    or of the form [(u,1),w1,(v,1),w2][(u,1),w_{1},(v,-1),w_{2}] such that u,v𝒮r1u,v\in\mathcal{S}_{r-1} and w1,w2𝐄(r)w_{1},w_{2}\in\mathbf{E}^{(r)} where w1w_{1} is nonempty and w2w_{2} does not begin with (v,1)(-v,1),

  3. (iii)

    or of the form [(u,1),(v,1),w][(u,1),(v,-1),w] such that u,v𝒮r1u,v\in\mathcal{S}_{r-1} with vuv\neq-u and w𝐄(r)w\in\mathbf{E}^{(r)} where ww does not begin with (v,1)(-v,1).

Making use of Lemma 4.1 it follows that G=G(x;𝐄(r))G=G(x;\mathbf{E}^{(r)}) satisfies

G=1+22rx(G1)(1+2r12r(G1))+2r(2r1)x(1+2r12r(G1))G=1+2^{2r}x(G-1)\left(1+\frac{2^{r}-1}{2^{r}}\left(G-1\right)\right)+2^{r}(2^{r}-1)x\left(1+\frac{2^{r}-1}{2^{r}}\left(G-1\right)\right)

which is equivalent to quadratic equation

0=2r(2r1)x(G1)2+((22r+(2r1)2)x1)(G1)+2r(2r1)x0=2^{r}(2^{r}-1)x(G-1)^{2}+((2^{2r}+(2^{r}-1)^{2})x-1)(G-1)+2^{r}(2^{r}-1)x

that we can solve. For r>0r>0 using the quadratic formula and making the correct choice of sign we have

G1\displaystyle G-1 =1(22r+(2r1)2)x((22r(2r1)2)2x1)(x1)2r+1(2r1)x\displaystyle=\frac{1-(2^{2r}+(2^{r}-1)^{2})x-\sqrt{\left(\left(2^{2r}-(2^{r}-1)^{2}\right)^{2}x-1\right)(x-1)}}{2^{r+1}(2^{r}-1)x}
=1(22r+(2r1)2)x(1(2r+11)2x)(1x)2r+1(2r1)x\displaystyle=\frac{1-(2^{2r}+(2^{r}-1)^{2})x-\sqrt{\big{(}1-(2^{r+1}-1)^{2}x\big{)}(1-x)}}{2^{r+1}(2^{r}-1)x}

which completes the proof for G=G(x;𝐄(r))G=G(x;\mathbf{E}^{(r)}) after adding 11 to each side. By Lemma 4.3 it follows that

G(x;𝐅(r))=1+2r2r1(G(x;𝐄(r))1)G(x;\mathbf{F}^{(r)})=1+\frac{2^{r}}{2^{r}-1}\left(G(x;\mathbf{E}^{(r)})-1\right)

which can be used to conclude the theorem for G(x;𝐅(r))G(x;\mathbf{F}^{(r)}).

Now consider let’s consider walks in 𝐁(r)\mathbf{B}^{(r)} which we again split according to where they first return to xr+1=0x_{r+1}=0. Such a walk must be:

  1. (i)

    empty,

  2. (ii)

    of the form [(u,±1),w1,(v,1),w2][(u,\pm 1),w_{1},(v,\mp 1),w_{2}] such that u,v𝒮r1u,v\in\mathcal{S}_{r-1}, ±w1𝐄(r)\pm w_{1}\in\mathbf{E}^{(r)} is nonempty where ±1\pm 1 is the last coordinate of the first step of the walk, and w2𝐁(r)w_{2}\in\mathbf{B}^{(r)} which does not start with (v,±1)(-v,\pm 1)

  3. (iii)

    of the form [(u,±1),(v,1),w][(u,\pm 1),(v,\mp 1),w] such that u,v𝒮r1u,v\in\mathcal{S}_{r-1} with vuv\neq-u and w𝐁(r)w\in\mathbf{B}^{(r)} which does not start with (v,±1)(-v,\pm 1).

Letting H=G(x;𝐁(r))H=G(x;\mathbf{B}^{(r)}) while still letting G=G(x;𝐄(r))G=G(x;\mathbf{E}^{(r)}) we have that

H=1+22r+1x(G1)(1+2r+112r+1(H1))+2r+1(2r1)x(1+2r+112r+1(H1))H=1+2^{2r+1}x(G-1)\left(1+\frac{2^{r+1}-1}{2^{r+1}}\left(H-1\right)\right)+2^{r+1}(2^{r}-1)x\left(1+\frac{2^{r+1}-1}{2^{r+1}}\left(H-1\right)\right)

where we have made use of Lemma 4.2. After rearranging we find

(1+(2r+11)x2r(2r+11)G)H=1x2rxG(1+(2^{r+1}-1)x-2^{r}(2^{r+1}-1)G)\cdot H=1-x-2^{r}xG

then solving for HH and substituting the formula we have previously found for GG we have

H\displaystyle H =(2r+11)(2r+11)x(1(2r+11)2x)(1x)1+(2r+11)2x+(2r+11)(1(2r+11)2x)(1x)\displaystyle=\frac{(2^{r+1}-1)-(2^{r+1}-1)x-\sqrt{(1-(2^{r+1}-1)^{2}x)(1-x)}}{-1+(2^{r+1}-1)^{2}x+(2^{r+1}-1)\sqrt{(1-(2^{r+1}-1)^{2}x)(1-x)}}
=1x((2r+11)1x1(2r+11)2x)1(2r+11)2x(1(2r+11)2x+(2r+11)1x)\displaystyle=\frac{\sqrt{1-x}\left((2^{r+1}-1)\sqrt{1-x}-\sqrt{1-(2^{r+1}-1)^{2}x}\right)}{\sqrt{1-(2^{r+1}-1)^{2}x}\left(-\sqrt{1-(2^{r+1}-1)^{2}x}+(2^{r+1}-1)\sqrt{1-x}\right)}

which derives the formula for H=G(x;𝐁(r))H=G(x;\mathbf{B}^{(r)}). Last it remains to demonstrate the formula for H=G(x;𝐂(r))H=G(x;\mathbf{C}^{(r)}) and this can be readily done using Lemma 4.3. ∎

Corollary 4.5.

For any r1r\geq 1, we have

bn(r)\displaystyle b^{(r)}_{n} (2r+11)2n1(2r+11)21πn\displaystyle\sim(2^{r+1}-1)^{2n-1}\cdot\sqrt{\frac{(2^{r+1}-1)^{2}-1}{\pi n}}
cn(r)\displaystyle c^{(r)}_{n} 2r(2r+11)2n12r1(2r+11)21πn\displaystyle\sim\frac{2^{r}(2^{r+1}-1)^{2n-1}}{2^{r}-1}\cdot\sqrt{\frac{(2^{r+1}-1)^{2}-1}{\pi n}}
en(r)\displaystyle e^{(r)}_{n} (2r+11)2n+12r+2(2r1)(2r+11)21πn3\displaystyle\sim\frac{(2^{r+1}-1)^{2n+1}}{2^{r+2}(2^{r}-1)}\cdot\sqrt{\frac{(2^{r+1}-1)^{2}-1}{\pi n^{3}}}
fn(r)\displaystyle f^{(r)}_{n} (2r+11)2n+122(2r1)2(2r+11)21πn3\displaystyle\sim\frac{(2^{r+1}-1)^{2n+1}}{2^{2}(2^{r}-1)^{2}}\cdot\sqrt{\frac{(2^{r+1}-1)^{2}-1}{\pi n^{3}}}

as asymptotics for our sequences.

Proof.

By Lemma 4.3 we need only compute the asymptotics for bn(r)b^{(r)}_{n} and en(r)e^{(r)}_{n}. For bn(r)b^{(r)}_{n} we have the generating function

G(z;𝐁(r))=1z1(2r+11)2zG(z;\mathbf{B}^{(r)})=\sqrt{\frac{1-z}{1-(2^{r+1}-1)^{2}z}}

by Theorem 4.4 which has ρ=1(2r+11)2\rho=\frac{1}{(2^{r+1}-1)^{2}} as its singularity closest to the origin. As zρz\to\rho we have that the generating function approaches

(2r+11)21(2r+11)2(1(2r+11)2x)α\sqrt{\frac{(2^{r+1}-1)^{2}-1}{(2^{r+1}-1)^{2}}}\cdot(1-(2^{r+1}-1)^{2}x)^{-\alpha}

as a complex analytic function with α=12\alpha=\frac{1}{2}. It then follows that

bn(r)(2r+11)21(2r+11)2ρnnα1Γ(α)b^{(r)}_{n}\sim\sqrt{\frac{(2^{r+1}-1)^{2}-1}{(2^{r+1}-1)^{2}}}\cdot\rho^{-n}\cdot\frac{n^{\alpha-1}}{\Gamma(\alpha)}

which simplifies to the desired formula since Γ(α)=π\Gamma(\alpha)=\sqrt{\pi}.

Now for en(r)e^{(r)}_{n} we have the generating function

G(z;𝐄(r))=1z(1(2r+11)2z)(1z)2r+1(2r1)zG(z;\mathbf{E}^{(r)})=\frac{1-z-\sqrt{\big{(}1-(2^{r+1}-1)^{2}z\big{)}\left(1-z\right)}}{2^{r+1}(2^{r}-1)z}

by Theorem 4.4 which also has ρ=1(2r+11)2\rho=\frac{1}{(2^{r+1}-1)^{2}} as its singularity closest to the origin. As zρz\to\rho we have that the generating function approaches

(2r+11)22r+1(2r1)12r+1(2r1)(2r+11)22r+1(2r1)(2r+11)21(2r+11)2(1(2r+11)2x)α\frac{(2^{r+1}-1)^{2}}{2^{r+1}(2^{r}-1)}-\frac{1}{2^{r+1}(2^{r}-1)}-\frac{(2^{r+1}-1)^{2}}{2^{r+1}(2^{r}-1)}\cdot\sqrt{\frac{(2^{r+1}-1)^{2}-1}{(2^{r+1}-1)^{2}}}\cdot(1-(2^{r+1}-1)^{2}x)^{-\alpha}

as a complex analytic function with α=12\alpha=-\frac{1}{2}. It then follows that

en(r)(2r+11)22r+1(2r1)(2r+11)21(2r+11)2ρnnα1Γ(α)e^{(r)}_{n}\sim-\frac{(2^{r+1}-1)^{2}}{2^{r+1}(2^{r}-1)}\cdot\sqrt{\frac{(2^{r+1}-1)^{2}-1}{(2^{r+1}-1)^{2}}}\cdot\rho^{-n}\cdot\frac{n^{\alpha-1}}{\Gamma(\alpha)}

which simplifies to the desired formula since Γ(α)=2π\Gamma(\alpha)=-2\sqrt{\pi}. ∎

For comparison to the expressions in Corollary 4.5 one can see that

an(r)\displaystyle a^{(r)}_{n} (22r+2)n1πn\displaystyle\sim(2^{2r+2})^{n}\cdot\frac{1}{\sqrt{\pi n}} dn(r)\displaystyle d^{(r)}_{n} (22r+2)n1πn3\displaystyle\sim(2^{2r+2})^{n}\cdot\frac{1}{\sqrt{\pi n^{3}}}

which can be gotten from either the formula for coefficients in Equations (1) and (4) or the generating functions in Equations (3) and (6).

5. Conclusion

We now conclude with some possible directions for future work and discussion of related work.

5.1. Intersections of hyperplanes

Let us look at a natural generalization of the languages 𝐀(r)\mathbf{A}^{(r)} and 𝐃(r)\mathbf{D}^{(r)}. For 0jr0\leq j\leq r We can consider the language 𝐀(r)(j)\mathbf{A}^{(r)}(j) of walks in r+1\mathbb{Z}^{r+1} with steps from 𝒮r\mathcal{S}_{r} which end with xrj+1=xrj+2==xr+1=0x_{r-j+1}=x_{r-j+2}=\cdots=x_{r+1}=0. So, we have that 𝐀(r)=𝐀(r)(0)\mathbf{A}^{(r)}=\mathbf{A}^{(r)}(0). We also take the language 𝐃(r)(j)\mathbf{D}^{(r)}(j) which is contained in 𝐀(r)\mathbf{A}^{(r)} with the additional condition that xrj+1,xrj+1,,xr+10x_{r-j+1},x_{r-j+1},\dots,x_{r+1}\geq 0 at all times during the walk. Similarly it is the case that 𝐃(r)=𝐃(r)(0)\mathbf{D}^{(r)}=\mathbf{D}^{(r)}(0). In Theorem 2.2 we saw that both 𝐀(r)\mathbf{A}^{(r)} and 𝐃(r)\mathbf{D}^{(r)} are an unambiguous CFLs which in turn guaranteed the sequences under consideration earlier were holonomic and their generating functions were algebraic. It turns out neither 𝐀(r)(j)\mathbf{A}^{(r)}(j) nor 𝐃(r)(j)\mathbf{D}^{(r)}(j) is a CFL for j>0j>0.

Proposition 5.1.

For any 0<jr0<j\leq r the languages 𝐀(r)(j)\mathbf{A}^{(r)}(j) and 𝐃(r)(j)\mathbf{D}^{(r)}(j) are not a CFLs.

Proof.

It will suffice to show that neither 𝐀(1)(1)\mathbf{A}^{(1)}(1) nor 𝐃(1)(1)\mathbf{D}^{(1)}(1) is a CFL. We will use the pumping lemma and the choice of string pumped will readily generalize to 𝐀(r)(j)\mathbf{A}^{(r)}(j) and 𝐃(r)(j)\mathbf{D}^{(r)}(j) for r,j>1r,j>1. Assume that either 𝐀(1)(1)\mathbf{A}^{(1)}(1) or 𝐃(1)(1)\mathbf{D}^{(1)}(1) is a CFL with pumping length pp. There is the walk

[(1,1)p,(1,1)p,(1,1)p,(1,1)p,(1,1)2p]𝐃(1)(1)𝐀(1)(1)[(1,1)^{p},(1,-1)^{p},(1,1)^{p},(-1,1)^{p},(-1,-1)^{2p}]\ \in\mathbf{D}^{(1)}(1)\subseteq\mathbf{A}^{(1)}(1)

which cannot be pumped. Indeed any consecutive substring of length at most pp will contain one coordinate with all entries equal. Hence, after pumping this substring the walk will not end at the origin. For other values of rr and jj the above example can be used to choose the coordinates in positions rr and r+1r+1 while the remaining coordinates can be filled as needed to make a valid walk. ∎

Letting an(r)(j)a^{(r)}_{n}(j) denote the number of walks of length 2n2n in 𝐀(r)(j)\mathbf{A}^{(r)}(j) we can see that

an(r)(j)=22n(rj)(2nn)j+1a^{(r)}_{n}(j)=2^{2n(r-j)}\binom{2n}{n}^{j+1}

which satisfies that recurrence

nj+1an(r)(j)=22rj+1(2n1)j+1an1(r)(j)n^{j+1}a^{(r)}_{n}(j)=2^{2r-j+1}(2n-1)^{j+1}a^{(r)}_{n-1}(j)

so the sequence turns out to still be holomonic. A similar computation can be performed for 𝐃(r)(j)\mathbf{D}^{(r)}(j) with Catalan numbers in place of the central binomial coefficients. We can then look at avoiding patterns like backtracking or consecutive steps. For these languages we do not have a guarantee that the corresponding sequences are holomonic.

Question 5.2.

What can be said about enumeration for the analogous languages ending on an intersection of hyperplanes?

5.2. A Motzkin generalization and more patterns

A natural extension would be to look at other sets of steps. We outline one possibility related to Motzkin numbers. The Motzkin numbers enumerate walks in \mathbb{Z} with steps from {1,0,+1}\{-1,0,+1\} that end at the origin and are restricted to the nonnegative integers. Continuing in the spirit of what we have done, one could consider walks in r+1\mathbb{Z}^{r+1} with step set {1,0,+1}r+1\{-1,0,+1\}^{r+1} that end with xr+1=0x_{r+1}=0 along with combining half-space restrictions as well as pattern avoidance. Bu [Bu21] has used dynamic programming to attack enumeration of restricted Motzkin paths in a manner similar to the previously mentioned work on Dyck paths by Ekhad and Zeilberger [EZ]. As previously mentioned these works look at other patterns (e.g. longer runs [v,v,,v][v,v,\dots,v] of consecutive steps). One could look at the pattern of a longer run with either our current step set or another step set. Theorem 2.2 can be easily adapted to give an algebraic generating function for other patterns since the language of walks avoiding a pattern is regular.

Question 5.3.

What can be said about enumeration for the analogous languages using the Motzkin-like alphabet {1,0,+1}r+1\{-1,0,+1\}^{r+1}?

5.3. Other related work

We finish by mentioning some other related work. The r=1r=1 case of Theorem 3.1 agrees with A082298 in the OEIS [OEI] and provides a proof of a conjecture observed by David Scambler. For r=1r=1 Theorem 3.4 and Theorem 3.5 correspond to A086871 and A082298 respectively in the OEIS [OEI]. Furthermore, when r=1r=1 Theorem 3.4 is twice the formula in [Cok03, Theorem 2.2(b)] which enumerates lattice walks from (0,0)(0,0) to (n,n)(n,n) using steps {(0,j),(j,0):j0}\{(0,j),(j,0):j\geq 0\} which never go above the line x=yx=y. These walks are also enumerated by Woan in [Wj01] and are A059231 in the OEIS [OEI].

[(+1,+1)2,(1,+1)2,(1,1)1,(+1,1)3][(+1,+1)^{2},(-1,+1)^{2},(-1,-1)^{1},(+1,-1)^{3}][(2,2),(2,2),(1,1),(3,3)][(2,2),(2,2),(1,-1),(3,-3)]
Figure 5. A walk in 𝐄\mathbf{E}^{\prime} and the path in 𝐄′′\mathbf{E}^{\prime\prime} it maps to by the bijection Φ\Phi.

Let 𝐄=𝐄(1)((+1,+1))𝐄(1)\mathbf{E}^{\prime}=\mathbf{E}^{(1)}((+1,+1))\subseteq\mathbf{E}^{(1)} be the sublanguage of walks starting with the step (+1,+1)(+1,+1). Also, let 𝐄′′\mathbf{E}^{\prime\prime} be the language of walks from (0,0)(0,0) to (2n,0)(2n,0) for any n0n\geq 0 using steps from {(j,j),(j,j):j0}\{(j,j),(j,-j):j\geq 0\} which never go below the xx-axis. The walks in 𝐄′′\mathbf{E}^{\prime\prime} are equinumerous with the walks enumerated by Cocker and by Woan via exchanging (j,0)(j,j)(j,0)\leftrightarrow(j,j) and (0,j)(j,j)(0,j)\leftrightarrow(j,-j). Since our walks have a symmetry with orbit size 22 for all nonempty walks by the action of reflecting over the yy-axis, there is a bijection between 𝐄\mathbf{E}^{\prime} and 𝐄′′\mathbf{E}^{\prime\prime}. Let us now define a map Φ:𝐄𝐄′′\Phi:\mathbf{E}^{\prime}\to\mathbf{E}^{\prime\prime}. For w𝐄w\in\mathbf{E}^{\prime} start by considering the decomposition into maximal runs of consecutive steps

w=[v1j1,v2j2,vj]𝐄w=[v_{1}^{j_{1}},v_{2}^{j_{2}},\dots v_{\ell}^{j_{\ell}}]\in\mathbf{E}^{\prime}

for vi𝒮1v_{i}\in\mathcal{S}_{1} with vivi+1v_{i}\neq v_{i+1} which is unique and well-defined. We then set

Φ(w)=[u1,u2,,u]𝐄′′\Phi(w)=[u_{1},u_{2},\dots,u_{\ell}]\in\mathbf{E}^{\prime\prime}

where

ui={(ji,ji)if vi has positive y-coordinate;(ji,ji)if vi has negative y-coordinate;u_{i}=\begin{cases}(j_{i},j_{i})&\text{if $v_{i}$ has positive $y$-coordinate;}\\ (j_{i},-j_{i})&\text{if $v_{i}$ has negative $y$-coordinate;}\\ \end{cases}

for each 1i1\leq i\leq\ell.

Proposition 5.4.

The map Φ:𝐄𝐄′′\Phi:\mathbf{E}^{\prime}\to\mathbf{E}^{\prime\prime} is a bijection.

Proof.

If w𝐄w\in\mathbf{E}^{\prime} has 2n2n steps, then Φ(w)𝐄′′\Phi(w)\in\mathbf{E}^{\prime\prime} is a path from (0,0)(0,0) to (2n,0)(2n,0). It is enough to show Φ\Phi is injective since we know the number of walks in 𝐄\mathbf{E}^{\prime} with 2n2n steps is the same as the number of paths in 𝐄′′\mathbf{E}^{\prime\prime} from (0,0)(0,0) to (2n,0)(2n,0). Consider w,w𝐄w,w^{\prime}\in\mathbf{E}^{\prime} with

w\displaystyle w =[v1j1,v2j2,vj]\displaystyle=[v_{1}^{j_{1}},v_{2}^{j_{2}},\dots v_{\ell}^{j_{\ell}}]
w\displaystyle w^{\prime} =[u1j1,u2j2,uj]\displaystyle=[u_{1}^{j^{\prime}_{1}},u_{2}^{j^{\prime}_{2}},\dots u_{\ell^{\prime}}^{j_{\ell^{\prime}}^{\prime}}]

as decompositions into maximal runs. Assume the Φ(w)=Φ(w)\Phi(w)=\Phi(w^{\prime}), then immediately we have =\ell=\ell^{\prime} because the paths Φ(w)\Phi(w) and Φ(u)\Phi(u) must have the same number of steps. Next it must be the case that v1=u1=(+1,+1)v_{1}=u_{1}=(+1,+1) since w,w𝐄w,w^{\prime}\in\mathbf{E}^{\prime}. The first steps of Φ(w)\Phi(w) and Φ(w)\Phi(w^{\prime}) are (j1,j1)(j_{1},j_{1}) and (j1,j1)(j^{\prime}_{1},j^{\prime}_{1}) so we have j1=j1j_{1}=j^{\prime}_{1}. This establishes the base case for induction. Assume that vi1=ui1v_{i-1}=u_{i-1} and ji1=ji1j_{i-1}=j^{\prime}_{i-1} for some 1<i<1<i<\ell. We will show this implies that vi=uiv_{i}=u_{i} and ji=jij_{i}=j^{\prime}_{i}. The iith steps of Φ(w)\Phi(w) and Φ(w)\Phi(w^{\prime}) are (ji,±ji)(j_{i},\pm j_{i}) and (ji,±ji)(j^{\prime}_{i},\pm j^{\prime}_{i}). This means that ji=jij_{i}=j^{\prime}_{i} and the yy-coordinate of viv_{i} and uiu_{i} match. Since the walks avoid backtracking and we have decomposed them into maximal runs there is only one choice for the xx-coordinate once the yy-coordinate is fixed. As ui1=vi1u_{i-1}=v_{i-1} we have that ui=viu_{i}=v_{i}. The proposition then follows by induction. ∎

Example 5.5.

Consider w𝐁w\in\mathbf{B}^{\prime} where

w\displaystyle w =[(+1,+1),(+1,+1),(1,+1),(1,+1),(1,1),(+1,1),(+1,1),(+1,1)]\displaystyle=[(+1,+1),(+1,+1),(-1,+1),(-1,+1),(-1,-1),(+1,-1),(+1,-1),(+1,-1)]
=[(+1,+1)2,(1,+1)2,(1,1)1,(+1,1)3]\displaystyle=[(+1,+1)^{2},(-1,+1)^{2},(-1,-1)^{1},(+1,-1)^{3}]

then

Φ(w)=[(2,2),(2,2),(1,1),(3,3)]\Phi(w)=[(2,2),(2,2),(1,-1),(3,-3)]

and these walks are shown in Figure 5.

References

  • [AB20] Andrei Asinowski and Cyril Banderier. On Lattice Paths with Marked Patterns: Generating Functions and Multivariate Gaussian Distribution. In Michael Drmota and Clemens Heuberger, editors, 31st International Conference on Probabilistic, Combinatorial and Asymptotic Methods for the Analysis of Algorithms (AofA 2020), volume 159 of Leibniz International Proceedings in Informatics (LIPIcs), pages 1:1–1:16, Dagstuhl, Germany, 2020. Schloss Dagstuhl–Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.AofA.2020.1.
  • [ABBG20] Andrei Asinowski, Axel Bacher, Cyril Banderier, and Bernhard Gittenberger. Analytic combinatorics of lattice paths with forbidden patterns, the vectorial kernel method, and generating functions for pushdown automata. Algorithmica, 82(3):386–428, 2020. doi:10.1007/s00453-019-00623-3.
  • [ABR20] Andrei Asinowski, Cyril Banderier, and Valerie Roitner. Generating functions for lattice paths with several forbidden patterns. Sém. Lothar. Combin., 84B:Art. 95, 12, 2020.
  • [BDB] AJ Bu and Robert Dougherty-Bliss. Enumerating restricted Dyck paths with context-free grammars. arXiv:2009.09061. URL: https://arxiv.org/abs/2009.09061.
  • [Bu21] AJ Bu. Automated counting of restricted Motzkin paths. Enumer. Combin. Appl., 1(2):Article #S2R12, 2021.
  • [Cok03] Curtis Coker. Enumerating a class of lattice paths. Discrete Math., 271(1-3):13–28, 2003. doi:10.1016/S0012-365X(03)00037-2.
  • [CS63] N. Chomsky and M. P. Schützenberger. The algebraic theory of context-free languages. In Computer programming and formal systems, pages 118–161. North-Holland, Amsterdam, 1963.
  • [EZ] Shalosh B. Ekhad and Doron Zeilberger. Automatic counting of restricted Dyck paths via (numeric and symbolic) dynamic programming. arXiv:2006.01961. URL: https://arxiv.org/abs/2006.01961.
  • [FS09] Philippe Flajolet and Robert Sedgewick. Analytic combinatorics. Cambridge University Press, Cambridge, 2009. doi:10.1017/CBO9780511801655.
  • [GG66] Seymour Ginsburg and Sheila Greibach. Deterministic context free languages. Information and Control, 9(6):620 – 648, 1966. doi:https://doi.org/10.1016/S0019-9958(66)80019-0.
  • [Kra15] Christian Krattenthaler. Lattice path enumeration. In Handbook of enumerative combinatorics, Discrete Math. Appl. (Boca Raton), pages 589–678. CRC Press, Boca Raton, FL, 2015.
  • [KS86] Werner Kuich and Arto Salomaa. Semirings, automata, languages, volume 5 of EATCS Monographs on Theoretical Computer Science. Springer-Verlag, Berlin, 1986. doi:10.1007/978-3-642-69959-7.
  • [Map] Maplesoft, a division of Waterloo Maple Inc.. Maple. URL: https://www.maplesoft.com/.
  • [OEI] OEIS Foundation Inc. The On-Line Encyclopedia of Integer Sequences. URL: https://oeis.org.
  • [Pan05] Alois Panholzer. Gröbner bases and the defining polynomial of a context-free grammar generating function. J. Autom. Lang. Comb., 10(1):79–97, 2005.
  • [PWZ96] Marko Petkovšek, Herbert S. Wilf, and Doron Zeilberger. A=BA=B. With foreword by Donald E. Knuth. Wellesley, MA: A. K. Peters, 1996.
  • [Sta80] R. P. Stanley. Differentiably finite power series. European J. Combin., 1(2):175–188, 1980. doi:10.1016/S0195-6698(80)80051-5.
  • [Wj01] Woan Wen-jin. Diagonal lattice paths. Congr. Numerantium, 151:173–178, 2001.
  • [Zei90] Doron Zeilberger. A fast algorithm for proving terminating hypergeometric identities. Discrete Math., 80(2):207–211, 1990. doi:10.1016/0012-365X(90)90120-7.
  • [Zei91] Doron Zeilberger. The method of creative telescoping. J. Symbolic Comput., 11(3):195–204, 1991. doi:10.1016/S0747-7171(08)80044-2.

Appendix: Proofs with Maple code

Here in the Appendix we show how the functions sumrecursion and sumtohyper from the sumtools package in Maple [Map] can be used to compute the recurrences and hypergeometric evaluations in this paper. We first illustrate how to compute the recurrence relations in Theorem 3.1, Theorem 3.3, Theorem 3.4, and Theorem 3.5 using Maple to execute to Zeilberger’s algorithm [Zei90, Zei91]. Running the following in Maple

with(sumtools);
sumrecursion(2*(2^r - 1)^(2*k - 2)*2^(r*(2*n - 2*k + 1))*binomial(n - 1, k - 1)*((2^r - 1)*binomial(n - 1, k - 1) + 2^r*binomial(n - 1, k - 2)), k, b(n));
sumrecursion(2*(2^r - 1)^(2*n - 2*k)*2^(r*(2*k - 1))*binomial(n - 1, k - 1)*(2^r*binomial(n - 1, k - 1) + (2^r - 1)*binomial(n - 1, k - 2)), k, c(n));
sumrecursion((1/n)*(2^r-1)^(2*k-1)*2^(r*(2*n-2*k+1))*binomial(n,k)*binomial(n,k-1), k, e(n));
sumrecursion((1/n)*(2^r-1)^(2*n-2*k)*2^(2*r*k)*binomial(n,k)*binomial(n,k-1), k, f(n));

will return is the relevant parts of Theorem 3.1, Theorem 3.3, Theorem 3.4, and Theorem 3.5 giving the recurrences. Also running the following in Maple

with(sumtools);
sumtohyper(2*(2^r - 1)^(2*k - 2)*2^(r*(2*n - 2*k + 1))*binomial(n - 1, k - 1)*((2^r - 1)*binomial(n - 1, k - 1) + 2^r*binomial(n - 1, k - 2)), k);
sumtohyper(2*(2^r - 1)^(2*n - 2*k)*2^(r*(2*k - 1))*binomial(n - 1, k - 1)*(2^r*binomial(n - 1, k - 1) + (2^r - 1)*binomial(n - 1, k - 2)), k);
sumtohyper((2^r - 1)^(2*k - 1)*2^(r*(2*n - 2*k + 1))*binomial(n, k)*binomial(n, k - 1)/n, k);
sumtohyper((2^r - 1)^(2*n - 2*k)*2^(2*r*k)*binomial(n, k)*binomial(n, k - 1)/n, k);

verifies the hypergeometric evaluations.