# Hypergeometric Expressions for Generating Functions of Walks with Small Steps in the Quarter Plane

We study nearest-neighbors walks on the two-dimensional square lattice, that is, models of walks on Z^2 defined by a fixed step set that is a subset of the non-zero vectors with coordinates 0, 1 or -1. We concern ourselves with the enumeration of such walks starting at the origin and constrained to remain in the quarter plane N^2, counted by their length and by the position of their ending point. Bousquet-Mélou and Mishna [Contemp. Math., pp. 1--39, Amer. Math. Soc., 2010] identified 19 models of walks that possess a D-finite generating function; linear differential equations have then been guessed in these cases by Bostan and Kauers [FPSAC 2009, Discrete Math. Theor. Comput. Sci. Proc., pp. 201--215, 2009]. We give here the first proof that these equations are indeed satisfied by the corresponding generating functions. As a first corollary, we prove that all these 19 generating functions can be expressed in terms of Gauss' hypergeometric functions that are intimately related to elliptic integrals. As a second corollary, we show that all the 19 generating functions are transcendental, and that among their 19 × 4 combinatorially meaningful specializations only four are algebraic functions.

## Authors

• 13 publications
• 4 publications
• 7 publications
• 19 publications
• 1 publication
• ### Combinatorics of nondeterministic walks of the Dyck and Motzkin type

This paper introduces nondeterministic walks, a new variant of one-dimen...
12/17/2018 ∙ by Élie De Panafieu, et al. ∙ 0

• ### Analytic Combinatorics in Several Variables: Effective Asymptotics and Lattice Path Enumeration

The field of analytic combinatorics, which studies the asymptotic behavi...
09/15/2017 ∙ by Stephen Melczer, et al. ∙ 0

• ### Local time for lattice paths and the associated limit laws

For generalized Dyck paths (i.e., directed lattice paths with any finite...
05/23/2018 ∙ by Cyril Banderier, et al. ∙ 0

• ### Hipster random walks

We introduce and study a family of random processes on trees we call hip...
09/16/2019 ∙ by Louigi Addario-Berry, et al. ∙ 0

• ### Can NetGAN be improved by short random walks originated from dense vertices?

Graphs are useful structures that can model several important real-world...
05/13/2019 ∙ by Amir Jalilifard, et al. ∙ 0

• ### Solving quadratic matrix equations arising in random walks in the quarter plane

Quadratic matrix equations of the kind A_1X^2+A_0X+A_-1=X are encountere...
07/23/2019 ∙ by Dario A. Bini, et al. ∙ 0

• ### Verteilung der Primzahlen und Asymptotik bezüglich der Kongruenzen der rationalen Punkte auf elliptischen Kurven über einem endlichen Körper

This work has two main purposes. On the one side we investigate in this ...
04/19/2020 ∙ by Thi Altenschmidt, et al. ∙ 0

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1. Introduction

##### Context.

An important problem in enumerative combinatorics is the study of lattice walks in restricted lattices. Many efforts have been deployed in recent years for classifying them, see e.g. the surveys

[27] and [30] and the references therein. The generating functions of lattice walks are not only intriguing for combinatorial reasons, but also from the perspective of computer algebra. For combinatorial reasons they are interesting because, depending on the choice of admissible steps, the generating functions may have quite different algebraic and analytic properties. For computational reasons they are interesting because their descriptions (whether by a polynomial or by a linear differential equation, as we will see below) are sometimes so large in size that it becomes difficult to handle them with a reasonable efficiency.

In the present article, we consider small step walks restricted to the quarter plane, defined as follows. Let be a fixed subset of , which will contain all steps allowed in the walks. An -walk of length starts at the origin and consists of consecutive steps, where a step from a point to a point is admitted if , and both and belong to the quarter plane . These walks are called restricted to the quarter plane because they are not allowed to step out of it, and with small steps because a single step changes the position by no more than in each coordinate. As an example, for (Kreweras walks), a possible walk of length six is

 (0,0)→(1,1)→(2,2)→(1,2)→(2,3)→(2,2)→(2,1).

A brute-force enumeration with rejection shows that, altogether, there are 125 different walks of length six for this particular step set. In the general case of an arbitrary step set , with denoting the number of different -walks of length , we are interested in the generating function .

The generating function corresponding to the example step set above is algebraic [31, 22, 10], i.e., it satisfies a polynomial equation for some . But this is not the case for all other step sets. Still, among those step sets that induce a transcendental (i.e., non-algebraic) generating function , some have a  that is D-finite, i.e., that satisfies a linear differential equation with polynomial coefficients. The step set is an example for this case [9, 12]. Finally, there are also step sets whose corresponding generating function is not even D-finite; Mishna and Rechnitzer [38] proved that this is the case for example when .

More generally, for a fixed step set , one is interested in the study of the trivariate power series

 Q(x,y;t)=∞∑n=0∞∑i,j=0qi,j;nxiyjtn,

where denotes the number of -walks of length  starting at and ending at . The power series is called the complete generating function for -walks. Note that the counting series  introduced before is nothing but the specialization of at . Other combinatorially meaningful specializations are , the generating function of -walks returning to the origin (also called excursions), , the generating function of -walks ending on the horizontal axis, and , the generating function of -walks ending on the vertical axis.

Bousquet-Mélou and Mishna [11] have undertaken a systematic classification of the 256 step sets , from the viewpoint of structural properties of the generating function . Again, the concerned properties are algebraicity and D-finiteness, yet applied to a multivariate setting111A trivariate power series is algebraic if it is the root of a nonzero polynomial . It is called D-finite if the set of all partial derivatives of spans a finite-dimensional vector space over . . They found out that there are 79 inherently different and nontrivial models to consider, of which they recognized 22 models for which is D-finite; a 23rd model, of the so-called Gessel walks, was proved to be D-finite (and even algebraic) by Bostan and Kauers [7]. These 23 models share the feature that a certain group associated to is finite. In the remaining 56 cases, it has been proved that the groups are infinite [11], and that the complete generating functions are not D-finite [38, 32, 8, 36].

Of the 23 D-finite generating functions, 4 were recognized to be algebraic [11, 7]: one corresponds to the Kreweras model , one to its reverse , one to , and one to Gessel’s. All the other 19 generating functions were proved to be transcendental [17], although some of their specializations are algebraic, e.g., for  [11]. These 19 models form the main object of this article; they are depicted in the third column of Table 1.

The proofs of D-finiteness given by Bousquet-Mélou and Mishna are implicit (i.e., qualitative): the existence of differential equations satisfied by the generating functions was shown without obtaining the differential equations explicitly. On the other hand, Bostan and Kauers [6, 5] provided explicit differential equations for (specializations of) the 23 D-finite generating functions, but these equations were determined only experimentally and, in most of the transcendental cases, they still lack formal proofs (in the 4 algebraic cases, differential equations are easily proved, starting from algebraic equations). Therefore, the following problems were left unsolved by Bousquet-Mélou and Mishna:

• prove differential equations satisfied by and [11, §7.5];

• find closed form expressions for them [11, §7.3];

• classify models with algebraic generating function  [11, §7.3].

##### Contributions.

The original goal of the present paper was to answer question (i). In this regard, we rigorously prove the differential equations for and guessed by Bostan and Kauers [6, 5] for the 19 models with D-finite transcendental complete generating function. We actually do more, that is we also find and prove differential equations for and for , that specialize to equations for and .

By solving these differential equations, we answer (ii) in the following sense: for all the 19 models mentioned above we uniformly find closed form expressions for in terms of Gauss’ hypergeometric series  with parameters , with , defined by

 (1) 2F1(abc∣∣∣t)=∞∑n=0(a)n(b)n(c)ntnn!,

where denotes the Pochhammer symbol for .

More precisely, we obtain the following structure result, that has been conjectured in [6, §3.2]. Note that a similar expression also appears in a related combinatorial context [4] for rook paths on a three-dimensional chessboard.

###### Theorem 1.

Let be one of the 19 models of small step walks in the quarter plane (see Table 1). The complete generating function is expressible as a finite sum of iterated integrals of products of algebraic functions in and of expressions of the form , where and .

The parameters of the occurring ’s as well as the rational functions are explicitly given in Table 2. The full expressions of the generating functions , , , , , and are too large to be displayed in this paper, and are available on-line at http://specfun.inria.fr/chyzak/ssw/closed_forms.html. It turns out by inspection that the involved hypergeometric functions have a very particular form: they are intimately related to elliptic integrals, namely to the complete elliptic integrals of first and second kinds,

 K(k)=∫π/20(1−k2sin2θ)−1/2 dθ =π22F1(12121∣∣∣k2), E(k)=∫π/20(1−k2sin2θ)1/2 dθ =π22F1(−12121∣∣∣k2).

For instance, for the step set of the so-called king walks (case 4 in Table 1), we prove that

 (2) Q(t)=1t∫t01(1+4x)3⋅2F1(32322∣∣∣16x(1+x)(1+4x)2)dx.

See Section 2 for a detailed presentation of this example. Alternatively, an expression of  in terms of elliptic integrals is

 Q(t)=1t∫t01π(1+4x)2√x(1+x)⋅K′(4√x(1+x)1+4x)dx.

The relationship to elliptic integrals appears to hold true in a far more general setting. Indeed, taking Theorem 1 as starting point, one of us (van Hoeij) has checked that for many (more than 100) integer sequences in the OEIS whose generating function is both D-finite and convergent in a small neighborhood of , all second-order irreducible factors of the minimal-order linear differential operator annihilating  are solvable either in terms of algebraic functions, or in terms of complete elliptic integrals. This surprisingly general feature, reminiscent of Dwork’s conjecture mentioned in [6, §3.2], begs for a combinatorial explanation. See also [48, Section 8] for a similar discussion.

In Theorem 1 and in representations of generating functions like (2), all “functions” bear a combinatorial meaning: they have to be understood as denoting formal series at 0, potentially with a (finite) polar part. Correspondingly, integration has to be viewed as a linear operator from the set of formal Laurent series without term in  to the whole field  of formal Laurent series. By the natural growth of the number of walks counted by length, all series considered can also be viewed as analytic series that converge at least on an annulus around 0. This alternative interpretation will be used in Section 4.3 only, for asymptotic considerations.

Finally, concerning question (iii), we start from the explicit differential equations and we exhaustively classify the algebraic cases among all the specializations of the generating function  at points . As a corollary, we reprove the transcendence of . More precisely, we prove:

###### Theorem 2.

Let be one of the 19 models of small step walks in the quarter plane (see Table 1), with complete generating function . For any , the power series is transcendental, except in the following four cases:

• Case 18 at and at ,

• Cases 17 and 18 at .

As a consequence, the power series , , and  are transcendental for all the 19 models. Additionally, the generating functions of the four algebraic cases are equal to:

•  in case 17,

•  in case 18,

•  in case 18.

As an aside, starting from the explicit expressions in terms of hypergeometric functions, we use singularity analysis and transfer theorems that are classical in Analytic Combinatorics to get some asymptotic formulas for the th coefficient of , , and .

##### Methodology.

Our proofs of Theorems 1 and 2 are computer-driven and crucially rely on the use of several modern computer algebra algorithms. The starting point is a result by Bousquet-Mélou and Mishna [11], stating that for the 19 models in Table 1 the complete generating function can be expressed as the positive part of a certain rational function in three variables. The notion of positive part is one of the key mathematical ingredients in what follows. In one variable, extraction of the positive part is an operator, denoted , which acts on formal Laurent series by cutting away all the terms with zero or negative exponents, leaving a formal power series with no constant term as a result. For example,

 [x>]1x2(1−x)2=[x>]∞∑n=−2(n+3)xn=∞∑n=1(n+3)xn=x(4−3x)(1−x)2.

Note that interpreting the rational function as a formal Laurent series in  instead of  would lead to a different extraction map. Indeed, for this other definition of positive-part extraction, we would have

 [x>]1x2(1−x)2=[x>]∞∑n=0n1xn+3=[x>]−3∑n=−∞−(n+3)xn=0.

Things get more complicated in the multivariate setting. Using the kernel method, Bousquet-Mélou and Mishna showed in [11, Prop. 8] that the generating function , can be written in the form

 (3) Q(x,y;t)=1xy[x>][y>]N(x,y)1−tS(x,y)

where and are certain (structured) Laurent polynomials in  with coefficients that are rational functions in . These quantities depend on and are listed in Table 1. Since there is no unique natural way of mapping rational functions in several variables to multivariate formal Laurent series, it is a priori not clear how the positive-part extraction is defined in this context. Here is the intended reading of (3): first interpret as an element of , owing to particular properties of and  (see Lemma 9 below); let act term by term, obtaining a series in that can be shown to actually belong to for all cases in Table 1; then let act term by term, finally obtaining an element of . In this reading, the composition of positive-part operators is only applied to Laurent polynomials, for which it is certainly well-defined, in a unique way.

As pointed out by Bousquet-Mélou and Mishna, Equation (3) already implies the D-finiteness of , since positive parts can be encoded as diagonals, and diagonals of D-finite power series are again D-finite [34]. This argument also implies an algorithm for computing linear differential equations satisfied by , since the D-finiteness proof in [34] is effective and basically amounts to linear algebra. Therefore, from (3) one could, in principle, determine differential equations for . To be more specific, the positive part of a formal power series  can be encoded as

 (4) [x>][y>]R(x,y;t)=x1−xy1−y⊙x,yR(x,y;t)=Diagx,x′Diagy,y′x1−xy1−yR(x′,y′;t),

where the Hadamard product denoted  is the term-wise product of two series, while the diagonal operator  selects those terms with equal exponents of and . However, the direct use of (4

) in our context leads to infeasible computations; worse, the intermediate algebraic objects involved in the calculations would probably have too large sizes to be merely written and stored. This is really unfortunate, since our need is mere evaluations of the diagonals in (

4) at specific values for and .

To bypass this computational obstacle, we use two ingredients.

The first one is our main theoretical innovation: we reformulate the generating function in terms of formal residues. This idea is classical (and in fact already used in Lipshitz’ proof [34]): we encode diagonals as residues, with the added advantage that early specialization of the variables and/or  becomes possible. Additionally, our derivation bases on a positive-part extraction that differs from Bousquet-Mélou and Mishna’s iterated operator : we use a theory [2] of series with exponents that may be arbitrarily large in negative directions, but are restricted to fixed cones, together with a different, direct positive-part operator, , to be defined in Section 3. The outcome of this reformulation is the ability to compute linear differential equations with polynomial coefficients for the specializations and .

To perform these computations, we use a second ingredient, creative telescoping, an efficient algorithmic technique for the symbolic integration of multivariate functions. Indeed, a direct application of Lipshitz’ linear-algebra algorithm (even with specialized variables) still leads to too large systems, while creative telescoping succeeds in our cases of application; see [4, §2.3] for a related discussion. By specialization and recombination, the equations thus obtained give rise to rigorously proved differential equations for , , and , thus answering question (i). The analysis of these differential equations combined with Kovacic’s algorithm [29] allows to answer question (iii) and to prove Theorem 2. Moreover, these differential equations are solved in explicit terms using symbolic algorithms for ODE factorization and ODE solving, leading to the proof of Theorem 1 and to the answer of question (ii).

The remarkable property that the differential equations in the cases could all be solved in terms of hypergeometric functions relies on the fact that these operators share a very peculiar factorization pattern: they factor into factors that all have order 1 with the exception of the left-most one that can have order 1 or 2. The origin of this common mathematical feature deserves to be better understood.

##### Previous work.

We conclude this introduction by mentioning previous contributions on the main topics of the article: D-finiteness, transcendence and explicit expressions for and its specializations.

D-finiteness. For the simplest models, the square walk (case 1) and the diagonal walk (case 2), D-finiteness is classical (e.g., [3]). Some more involved models have been considered sporadically: for case 19, Gouyou-Beauchamps [25] proved bijectively that is D-finite; for cases 5 and 15 Mishna [39, §2.4.1, §2.4.2] showed that is D-finite using the kernel method; and for case 17 she proved [39, §2.3.3] that is D-finite by using a bijection with Young tableaux of height at most 3.

Several methods have been proposed to capture D-finiteness in a uniform way. For models with a vertical symmetry (cases 1–16), Bousquet-Mélou and Petkovšek [12, §2] proved that is D-finite by a combinatorial argument, and Bousquet-Mélou [9, §3] proved D-finiteness of by an algebraic argument (a variation of the kernel method). For cases 17–19, Gessel and Zeilberger [23] proved D-finiteness of by using an algebraic version of the reflection principle; their argument works more generally when the step set is left invariant by a Weyl group and the walks are confined to a corresponding Weyl chamber. Bousquet-Mélou and Mishna [11] reproved D-finiteness of in all 19 cases by using the kernel equation and the group of the walk borrowed from [18]; their method generalizes the previous ones from [23] and [9]. Raschel [41] uses boundary value problems to get integral representations for  that imply its D-finiteness in all 19 cases. By using methods from the book [18], Fayolle and Raschel reproved in [17, Theorem 1.1] that is D-finite for each and in all 19 cases.

Transcendence. Algebraicity/transcendence proofs were first considered in some isolated cases: in case 15, was proved transcendental by Mishna [39, Th. 2.5]; in case 17, Mishna [39, §2.3.3], then Bousquet-Mélou and Mishna [11, §5.2], showed that and are transcendental and that  is algebraic; in case 18,  was proved algebraic by Bousquet-Mélou and Mishna [11, §5.2]; in case 19, Bousquet-Mélou and Mishna [11, §5.3] showed that , , and are transcendental. The first unified transcendence proof for applying to all 19 cases is by Fayolle and Raschel [17, Theorem 1.1], although they attribute that result to Bousquet-Mélou and Mishna [11]. They actually proved more, namely that is transcendental for each , using the approach in [18, Chap. 4]. However, this result does not provide any transcendence information about specializations at .

Explicit equations and formulas. For the simplest models (cases 1–2), simple formulas exist, see e.g. [9]; some of them admit bijective proofs, see e.g. [26]. For models 5 and 15, Mishna [39, Th. 2.5 and 2.6] gives explicit expressions of in terms of some auxiliary series. For model 17, basing on earlier work by Regev [42] and using a bijection with Young tableaux of height at most 3, Mishna [39, §2.3.3] shows that has a nice hypergeometric expression and that is the (algebraic) generating function of Motzkin numbers. In cases 17–18, Bousquet-Mélou and Mishna [11, §5.2] gave explicit expressions for (and more generally for ). For model 19, it was proved by Gouyou-Beauchamps [25] that the number of -step walks ending on the -axis is a product of Catalan numbers; hypergeometric expressions for the total number of walks are derived in [11, §5.3], and for those ending at an arbitrary point . Bostan and Kauers [6, 5] empirically determined differential equations for and for all 19 models. For the “highly symmetric” models (cases 1–4), Melczer and Mishna [35] proved differential equations for conjectured by Bostan and Kauers [6]. Raschel [41] provides explicit integral representations of the complete generating function using a uniform analytic approach.

Before we enter into the details, Section 2 goes through the whole process on one concrete example. From now on, we more simply write and , respectively, for and .

## 2. A Worked Example: King Walks in the Quarter Plane

We illustrate our approach on an example. We choose the so-called king walks in the quarter plane (case 4 in Table 1), with step set . The first terms of the generating function of king walks with prescribed length and arbitrary endpoint read (see http://oeis.org/A151331)

 Q(1,1;t)=1+3t+18t2+105t3+684t4+4550t5+31340t6+219555t7+1564080t8+⋯,

and the methods of the present article allow to obtain the above-mentioned closed formula (2) for it.

Here are the main steps of our approach. First, the classical kernel equation [11, Lemma 4] relates  to , , and :

 (5) Q(x,y;t)=1+t(S(x,y)Q(x,y;t)−¯y(x+1+¯x)Q(x,0;t)−¯x(y+1+¯y)Q(0,y;t)+¯x¯yQ(0,0;t)),

where  is the generating polynomial of the step set:

 S(x,y)=∑(i,j)∈Sxiyj=xy+y+¯xy+x+¯x+x¯y+¯y+¯x¯y.

A simple but important observation is that the kernel remains unchanged under the change of variables , and . (Other step sets could require different changes of variables to provide the same property.)

Applying these rational transformations to the kernel equation (5) yields the four relations:

 xyK(x,y;t)Q(x,y;t) =−xy−tx(x+1+¯x)Q(x,0;t)−ty(y+1+¯y)Q(0,y;t)+tQ(0,0;t), −¯xyK(x,y;t)Q(¯x,y;t) =−¯xy+t¯x(x+1+¯x)Q(¯x,0;t)+ty(y+1+¯y)Q(0,y;t)−tQ(0,0;t), ¯x¯yK(x,y;t)Q(¯x,¯y;t) =−¯x¯y−t¯x(x+1+¯x)Q(¯x,0;t)−t¯y(y+1+¯y)Q(0,¯y;t)+tQ(0,0;t), −x¯yK(x,y;t)Q(x,¯y;t) =−x¯y+tx(x+1+¯x)Q(x,0;t)+t¯y(y+1+¯y)Q(0,¯y;t)−tQ(0,0;t).

Upon adding up these equations, all terms in the right-hand side involving  disappear, resulting in

 xyQ(x,y;t)−¯xyQ(¯x,y;t)+¯x¯yQ(¯x,¯y;t)−x¯yQ(x,¯y;t)=K(x,y;t)−1(xy−¯xy+¯x¯y−