Generalized Chung-Feller Theorems for Lattice Paths

A Dissertation

Presented to The Faculty of the Graduate School of Arts and Sciences Brandeis University Department of Mathematics Ira M. Gessel, Advisor

In Partial Fulfillment of the Requirements for the Degree Doctor of Philosophy

by Aminul Huq

August, 2009 This dissertation, directed and approved by Aminul Huq’s committee, has been accepted and approved by the Faculty of Brandeis University in partial fulfillment of the requirements for the degree of:

DOCTOR OF PHILOSOPHY

Adam Jaffe, Dean of Arts and Sciences

Dissertation Committee:

Ira M. Gessel, Dept. of Mathematics, Chair.

Susan F. Parker, Dept. of Mathematics

Richard P. Stanley, Dept. of Mathematics, Massachusetts Institute of Technology c Copyright by

Aminul Huq

2009 Dedication

To My Parents

iv Acknowledgments

I wish to express my heartful gratitude to my advisor, Professor Ira M. Gessel, for his teaching, help, guidance, patience, and support. I am grateful to the members of my dissertation defense committee Professor Richard P. Stanley and Professor Susan F. Parker. Specially I’m greatly indebted to Professor Parker for her continual encouragement and mental support. I learned a great deal from her about teaching and mentoring. I owe thanks to the faculty, specially Professor Mark Adler and Professor Daniel Ruberman, to my fellow students, and to the kind and supportive staff of the Brandeis Mathematics Department. I would like to thank all my family and friends for their love and encouragement with patience and I wish to express my boundless love to my wife, Arifun Chowdhury. This thesis is dedicated to my parents, Md. Enamul Huq and Mahbub Ara Ummeh Sultana, with my deep gratitude.

v Abstract

Generalized Chung-Feller Theorems for Lattice Paths

A dissertation presented to the Faculty of the Graduate School of Arts and Sciences of Brandeis University, Waltham, Massachusetts

by Aminul Huq

In this thesis we develop generalized versions of the Chung-Feller theorem for lattice paths constrained in the half plane. The beautiful cycle method which was devel- oped by Devoretzky and Motzkin as a means to prove the ballot problem is modified and applied to generalize the classical Chung-Feller theorem. We use Lagrange inver- sion to derive the generalized formulas. For the generating function proof we study various ways of decomposing lattice paths. We also show some results related to equidistribution properties in terms of Narayana and Catalan generating functions. We then develop generalized Chung-Feller theorems for Motzkin and Schr¨oderpaths. Finally we study generalized paths and the analogue of the Chung-Feller theorem for them.

vi Contents

List of Figures ix

Chapter 1. Introduction 1 1.1. Lattice paths and the Chung-Feller theorem 4

Chapter 2. A generalized Chung-Feller theorem 6 2.1. The cycle method 6 2.2. Special vertices 10 2.3. The three versions of the formula 11 2.4. Words 13 2.5. Versions of the Narayana number formula 14 2.6. Circular peaks 19

Chapter 3. Other number formulas 21 3.1. Motzkin, Schr¨oder,and Riordan number formulas 21 3.2. A combinatorial proof of the relation between large and small Schr¨oder numbers and between Motzkin and Riordan numbers 28

Chapter 4. Generating functions 32 4.1. Counting with the Catalan generating function 35 4.2. The left-most highest point 41 4.3. Counting with the Narayana generating function 43 4.4. Up steps in even positions 51 vii Chapter 5. Chung-Feller theorems for generalized paths 57 5.1. Versions of generalized Catalan number formula 1 58 5.2. The generating function approach 62 5.3. Versions of generalized Catalan number formula 2 66 5.4. Peaks and valleys 69 5.5. A generalized Narayana number formula 73

Bibliography 77

viii List of Figures

1.1 A Dyck path 1

2.1 Two cyclic shifts of a sequence a represented by a path 8

2.2 Peaks and valleys 13

3.1 A path in Q(9, 5, 1, 2, 1) with all flat or down steps on or below the x-axis. 29

4.1 Primes 32

4.2 Decomposition of a path into positive primes and negative paths 33

4.3 Peaks on or below the x-axis 45

4.4 Valleys on or below the x-axis 47

4.5 Double-rises on or below the x-axis 48

4.6 Double-falls on or below the x-axis 50

4.7 Down steps in even positions: (a) A path in P(n − 1, 1, 2) and (b) a 2-colored free Motzkin path of length 9. 53

5.1 A path in P(7, 2, 6, +) decomposed into parts a, b, c, d, e 58

5.2 Primes in P(n, 2, 0). (a) A positive prime, (b) a negative prime, and (c) a mixed prime. 63

5.3 A prime path for r = 3 70

5.4 Step set for r = 1 74

ix CHAPTER 1

Introduction

In discrete mathematics, all sorts of constrained lattice paths serve to describe apparently complex objects. The simplest lattice path problem is the problem of counting paths in the plane, with unit east and north steps, from the origin to the m+n point (m, n). The number of such paths is the binomial coefficient n . We can find more interesting problems by counting these paths according to certain parameters like the number of left turns (an east step followed by a north step), the area between the path and the x-axis, etc. If m = n then the classical Chung-Feller theorem [11] tells us that the number of such paths with 2k steps above the line x = y is independent of k, for k = 0, . . . , n and is therefore equal to the Catalan number Cn = 1 2n n+1 n . The simplest, and most fundamental, result of lattice paths constrained in a subregion of the plane is the solution of the ballot problem: the number of paths from (1, 0) to (m, n), where m > n, that never touch the line x = y, is the ballot

m−n m+n number m+n n . In the special case m = n + 1, this ballot number is the Catalan number Cn. The corresponding paths are often redrawn as paths with northeast and southeast steps that never go below the x-axis; these are called Dyck paths:

Figure 1.1. A Dyck path

1 CHAPTER 1. INTRODUCTION

Dyck paths are closely related to traversal sequences of general and binary trees; they belong to what Riordan has named the “Catalan domain”, that is, the orbit of structures counted by the Catalan numbers. The wealth of properties surrounding Dyck paths can be perceived when examining either Gould’s monograph [24] that lists 243 references or from Exercise 6.19 in Stanley’s book [37] whose statement alone spans more than 10 full pages. The classical Chung-Feller theorem was proved by Major Percy A. MacMahon in 1909 [30]. Chung and Feller reproved this theorem by using the generating function method in [11] in 1949. T. V. Narayana [33] showed the Chung-Feller theorem by combinatorial methods. Mohanty’s book [31] devotes an entire section to exploring the Chung-Feller theorem. S. P. Eu et al. [19] proved the Chung-Feller Theorem by using Taylor expansions of generating functions and gave a refinement of this theorem. In [20], they gave a strengthening of the Chung-Feller theorem and a weighted version for Schr¨oderpaths. Both results were proved by refined bijections which are developed from the study of Taylor expansions of generating functions. Y. M. Chen [10] revisited the Chung-Feller theorem by establishing a bijection. David Callan in [7] and R. I. Jewett and K. A. Ross in [26] also gave bijective proofs of the Chung-Feller theorem. J. Maa and Y.-N. Yeh studied Chung-Feller Theorem for the non-positive length and the rightmost minimum length in [29]. Therefore generalizations of the Chung-Feller theorem have been visited by several authors as described above. But the most interesting aspect of the Chung-Feller

1 2n theorem was the interpretation of the Catalan number formula n+1 n that explained 1 the appearence of the fraction n+1 . However there are two other equivalent forms of the Catalan number formula which do not fit into the classical version of the Chung- Feller theorem. Moreover there are several other kinds of lattice paths like Motzkin

2 CHAPTER 1. INTRODUCTION

paths, Schr¨oderpaths, Riordan paths, etc. and associated number formulas and equivalent forms that have not been studied using generalized versions of the Chung- Feller theorem. The same can be said about their higher-dimensional versions [40] and q-analogues. For that reason the main purpose of this thesis is to find more systematic generaliza- tions of the Chung-Feller theorem. We apply the cycle method to this problem. In the next section we present the classical Chung-Feller theorem along with the definitions and notations that we’ll use. In chapter two we give the modified cy- cle method and the notion of special vertices and use that to derive the generalized Chung-Feller theorems for Catalan and Narayana number formulas. Chapter three deals with generalized Chung-Feller theorems for Motzkin, Schr¨oder,and Riordan number formulas. In chapter four we use generating functions to prove general- ized Chung-Feller theorems for Catalan and Narayana numbers and also describe the equidistribution property of left-most highest points and up steps in even posi- tions for paths that end at height one and height two respectively. In chaper five we develop generalized Chung-Feller theorems for generalized Catalan and Narayana number formulas.

3 CHAPTER 1. INTRODUCTION

1.1. Lattice paths and the Chung-Feller theorem

In this section we present the varieties of lattice paths to be studied and restate the Chung-Feller theorem with proofs. We begin with the formal definition of the paths that we will be dealing with.

Definition 1.1.1. Fix a finite set of vectors in Z×Z, V = {(a1, b1),..., (am, bm)}.

A lattice path with steps in V is a sequence v = (v1, . . . , vn) such that each vj is in V.

The geometric realization of a lattice path v = (v1, . . . , vn) is the sequence of points

(P0,P1,...,Pn) such that P0 = (0, 0) and Pi − Pi−1 = vi. The quantity n is referred to as the length of the path.

In the sequel, we shall identify a lattice path with the polygonal line admitting

P0,P1,...,Pn as vertices. The elements of V are called steps, and we also refer to the vectors Pi − Pi−1 = vi as the steps of a particular path. Various constraints will be imposed on paths. We consider the following condition on the paths we’ll concern ourselves with.

Definition 1.1.2. Let P(n, r, h) be the set of paths (referred to simply as paths) having the step set S = {(1, 1), (1, −r)} that lie in the half plane Z≥0 × Z ending at ((r + 1)n + h, h), where we call n the semi-length. We denote by P(n, 1, 0, +) the paths in P(n, 1, 0) that lie in the quarter plane Z≥0 × Z≥0. They are known as Dyck paths (we’ll also refer to them as positive paths). We also denote by P(n, 1, 0, −) the set of negative paths which are just the reflections of P(n, 1, 0, +) about the x-axis.

A lot of effort has been given to enumerating the above mentioned paths according to different parameters and with restrictions. We know that the total number of Dyck

4 CHAPTER 1. INTRODUCTION

paths of length 2n is given by the Catalan number Cn and the well known Chung- Feller theorem [11], stated below, gives a nice combinatorial interpretation for the Catalan number formula which generalizes the enumeration of Dyck paths.

2n Theorem 1.1.3. (Chung-Feller) Among the n paths from (0, 0) to (2n, 0), the number of paths with 2k steps lying above the x-axis is independent of k for 0 ≤ k ≤ n,

1 2n and is equal to n+1 n .

The Chung-Feller theorem only deals with paths having steps of the form (1, 1) and (1, −1) whereas the cycle lemma, first introduced by Dvoretzky and Motzkin [18], gives us an indication that a generalized Chung-Feller theorem might exist that can take into account more general paths. If we let k = n so that all the steps lie above the x-axis then we just get the Dyck paths. There are two other equivalent expressions for the Catalan number

1 2n+1 1 2n  Cn : 2n+1 n and n n−1 , which await similar combinatorial interpretations. David Callan [8] gave an interpretation of these forms using paths that end at different heights. In the next section we give a general method for explaining formulas like this. In all cases we count paths that end at (2n + 1, 1). Our interpretation shows

1 2n+1 that the formula 2n+1 n corresponds to counting all such paths according to the 1 2n number of points on or below the x-axis, n+1 n corresponds to counting such paths starting with an up step according to the number of up steps starting on or below

1 2n  the x-axis and n n−1 corresponds to counting such paths starting with a down step according to the number of down steps starting on or below the x-axis.

5 CHAPTER 2

A generalized Chung-Feller theorem

2.1. The cycle method

An important method of counting lattice paths is the “cycle lemma” of Dvoret- zky and Motzkin [18]. It may be stated in the following way: For any n-tuple

(a1, a2, . . . , an) of integers from the set {1, 0, −1, −2,... } with sum k > 0, there are exactly k values of i for which the cyclic permutation (ai, . . . , an, a1, . . . , ai−1) has every partial sum positive. The special case in which each ai is either 1 or −1 gives the solution to the ballot problem. The Chung-Feller theorem, and some of its gen- eralizations, can be proved by a variation of the cycle lemma. It is worth noting here that Dvoretzky and Motzkin [18] stated and proved the cycle lemma as a means of solving the ballot problem. Dershowitz and Zaks [14] pointed out that this is a “fre- quently rediscovered combinatorial lemma” and they provide two other applications of the lemma. They stated that the cycle lemma is the combinatorial analogue of the Lagrange inversion formula. We are going to apply the “cycle method” to develop generalized Chung-Feller theorems. This approach was first used by Narayana [33] in a less transparent way to prove the original Chung-Feller theorem. We’ll use sequences instead of paths to prove the theorem to make things easier. We define the cyclic shift σ on sequences a = (a1, a2, . . . , an) by

σ(a1, a2, . . . , an) = (a2, a3, . . . , an, a1).

6 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

A conjugate of (a1, a2, . . . , an) is a sequence of the form

i σ (a1, a2, . . . , an) = (ai+1, ai+2, . . . , an, a1, . . . , ai)

for some i. With these definition we state a variation of the cycle lemma.

Theorem 2.1.1. Suppose that a1 + a2 + ··· + an = 1 where each ai ∈ Z, i = 1, . . . , n. Then for each k, 1 ≤ k ≤ n, there is exactly one conjugate of the sequence a = (a1, . . . , an) with exactly k nonpositive partial sums.

i Proof. We define Si(a) to be a1 + ··· + ai − n for 0 ≤ i ≤ n. Note that

S0(a) = Sn(a) = 0 and it is clear that for 0 ≤ i ≤ n − 1, Si(a) ≤ 0 if and only if a1 + ··· + ai ≤ 0. Let us also define aj for j > n or j ≤ 0 by setting aj = ai whenever j ≡ i (mod n). So, Si(a) is defined for all i ∈ Z; i.e., if j ≡ i (mod n) then

Sj = Si(a).

We observe that since the fractional parts of S0(a),...,Sn−1(a) are all different, all Si(a), 0 ≤ i ≤ n − 1, are distinct.

j To prove the theorem it is enough to show that if Si(a) < Sj(a) then σ (a) has more nonpositive partial sums than σi(a), since the number of nonpositive partial

sums is in {1, 2, . . . , n}. Suppose that Si(a) < Sj(a). Then we have

j k Sk(σ (a)) = Sk((aj+1, . . . , an, a1, . . . , aj)) = aj+1 + ··· + aj+k − n (2.1.1) and

i k+j−i Sk+j−i(σ (a)) = Sk+j−i(ai+1, . . . , an, a1, . . . , ai) = ai+1 + ··· + aj+k − n . (2.1.2)

This is true even if j + k > n. So,

i j j i Sk+j−i(σ (a)) − Sk(σ (a)) = (a1 + ··· + aj − n ) − (a1 + ··· + ai − n )

7 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

= Sj(a) − Si(a)

> 0. (2.1.3)

i j i So if Sk+j−i(σ (a)) ≤ 0 then Sk(σ (a)) < Sk+j−i(σ (a)) ≤ 0. Moreover for k = 0, we have

i j Sj−i(σ (a)) − S0(σ (a)) > 0.

j j Since S0(σ (a)) = 0, this shows that σ (a) has at least one more nonpositive

j partial sum than σ (a). 

We can give a geometric interpretation of this result in terms of lattice paths that will make it easier to understand.

j

a i

 ia

 j a

Figure 2.1. Two cyclic shifts of a sequence a represented by a path

We can associate to a sequence (a1, a2, . . . , an) a path p = (p1, p2, . . . , pn) in which

pi is (1, ai) which is either an up step that goes up by ai, a flat step, or a down step

that goes down by −ai, whenever ai is positive, zero, or negative respectively. Since

8 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

a1 + a2 + ··· + an = 1, the path ends at height 1 and the nonpositive partial sums correspond to vertices of the path on or below the x-axis. We define a conjugate of a

i path p = (p1, p2, . . . , pn) to be a path of the form σ (p) = (pi+1, . . . , pn, p1, . . . , pi). With these definitions a special case of Theorem 2.1.1 can be stated as follows:

Theorem 2.1.2. For a path in P(n, 1, 1) that starts at (0, 0) and ends at height 1 there is exactly one conjugate of p with exactly k vertices on or below the x-axis for each k, 1 ≤ k ≤ n.

Figure 2.1 illustrates the nonpositive sums given in the proof as the vertices of the path on or below the x-axis.

9 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

2.2. Special vertices

We can extend σ in a natural way to the vertices of paths, so that a vertex v of a path p corresponds to the vertex σj(v) of the path σj(p). For each path p we take a subset of the vertex set of p which we call the set of special vertices of p. We require that special vertices are preserved by cyclic permutation, so that v is a special vertex of p if and only if σj(v) is a special vertex of σj(p). Unless otherwise stated we will not include the last vertex as a special vertex.

Theorem 2.2.1. Suppose p has k special vertices. Let σt1 (p), . . . , σtk (p) be the k conjugates of p that start with a special vertex. For each such path let X(σi(p)) be the number of special vertices on or below the x-axis. Then

{X(σt1 (p)),X(σt2 (p)),...,X(σtk (p))} = {1, 2, . . . , k}. (2.2.1)

Proof. Given a sequence a as in Theorem 2, let the sequence b = (b1, b2, . . . , bk) be defined by

b1 = a1 + ··· + at1

b2 = at1+1 + ··· + at2 . .

bm = atm−1+1 + ··· + atm (2.2.2)

Pm where t1 < t2 < ··· < tm = n. Since bi ∈ Z and i=1 bi = 1 by Theorem 2.1.1 we have that for each k, 1 ≤ k ≤ m, there is exactly one conjugate of b with exactly k nonpositive partial sums. 

10 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

2.3. The three versions of the Catalan number formula

We can use the notion of special vertices and Theorem 2.2.1 to give a nice combi- natorial interpretation to the three versions of the Catalan number formula as follows:

Theorem 2.3.1.

(1) The number of paths in P(n, 1, 1) that start with an up step with exactly k

1 2n up steps starting on or below the x-axis for k = 1, 2, . . . , n + 1 is n+1 n . (2) The number of paths in P(n, 1, 1) that start with a down step with exactly k

1 2n  down steps that start on or below the x-axis for k = 1, 2, . . . , n is n n−1 . (3) The number of paths in P(n, 1, 1) with exactly k vertices on or below the

1 2n+1 x-axis for k = 1, 2,..., 2n + 1 is 2n+1 n .

Proof. This is just a straightforward application of Theorem 2.2.1. First we’ll prove the first part. Let p be any path in P(n, 1, 1). So p starts from (0, 0) and ends at (2n+1, 1) with n+1 up steps and n down steps. We take the initial vertices of the up steps of p as our special vertices. Since there are n+1 up steps, p has n conjugates that start with an up step. By Theorem 2.2.1 there is exactly one conjugate of p with exactly k up steps starting on or below the x-axis and we know that the number of 2n paths in P(n, 1, 1) that start with an up step is given by the binomial coefficient n . Therefore the number of paths starting with an up step and having k up steps on or

1 2n below the x-axis is given by n+1 n as stated in part one. The proof of part two is similar, where we consider the initial vertices of the down steps as special vertices. For part three we consider the initial vertices of all the steps as special vertices and use the same argument. 

Note that part one of the theorem is basically the classical Chung-Feller theorem. To make the connection we just need to remove the first up step and lower the path

11 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

one level down. Then we get a path in P(n, 1, 0) that starts and ends on the x-axis with k up steps starting below the x-axis. Since the number of up and down steps below the x-axis are the same, having k up steps below the x-axis is the same as having 2k steps below the x-axis.

12 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

2.4. Words

We can encode each up step by the letter U (for up) and each down step by the letter D (for down), obtaining the encoding of paths in P(n, 1, 1) as words. For example, the path in Fig. 2.2 is encoded by the word

UDUDDDUDUUDUUUDUD.

In a path a peak is an occurrence of UD, a valley is an occurrence of DU, a double rise is an occurrence of UU, and a double fall is an occurrence of DD.

Peaks UD Valleys DU

UDUDDDUDUUDUUUDUD

Figure 2.2. Peaks and valleys

By a peak lying on or below the x-axis we mean the vertex between the up step and the down step lying on or below the x-axis and for a double rise we consider the vertex between the two consecutive up steps lying on or below the x-axis. Similarly for valleys and double falls. In the next section we’ll count paths according to the number of these special vertices lying on or below the x-axis.

13 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

2.5. Versions of the Narayana number formula

Definition 2.5.1. The Narayana number N(n, k)[32] counts Dyck paths from (0, 0) to (2n, 0) with k peaks and is given by

1 n n  N(n, k) = n k k − 1 for n ≥ 1.N(n, k) can also be expressed in five other forms as

1 n n − 1 1 nn − 1 N(n, k) = = k k − 1 k − 1 n − k + 1 k k − 1 1 n + 1n − 1 1 nn − 1 = = n + 1 k k − 1 k − 1 k k − 2 1  n n − 1 = . n − k k − 1 k

These numbers are well known in the literature since they have many combinato- rial interpretations (see for example Sulanke [38], which describes many properties of Dyck paths having the Narayana distribution). Deutsch [15] studied the enumeration of Dyck paths according to various parameters, several of which involved Narayana numbers. The generalized Chung-Feller theorem can also be used to give combinatorial interpretation of the different versions of the Narayana number formula taking the special vertices as peaks, valleys, double rises, and double falls.

Theorem 2.5.2.

(1) The number of paths in P(n, 1, 1) with k − 1 peaks that start with a down step and end with an up step with exactly j peaks on or below the x-axis for

1 n n−1 j = 0, 1, 2, . . . , k − 1 is given by k k−1 k−1 . 14 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

(2) The number of paths in P(n, 1, 1) with k − 1 valleys that start with an up step and end with a down step with exactly j valleys on or below the x-axis

1 n n−1 for j = 0, 1, 2, . . . , k − 1 is given by k k−1 k−1 . (3) The number of paths in P(n, 1, 1) with n − k double rises that start with an up step and end with an up step with exactly j double rises on or below the

1 nn−1 x-axis for j = 0, 1, 2, . . . , n − k is given by n−k+1 k k−1 . (4) The number of paths in P(n, 1, 1) with n − k − 1 double falls that start with a down step and end with a down step with exactly j double falls on or below

1 n n−1 the x-axis for j = 0, 1, 2, . . . , n − k − 1 is given by n−k k−1 k . (5) The number of paths in P(n, 1, 1) with k peaks that start with an up step with exactly j up steps starting on or below the x-axis for j = 1, 2, . . . , n + 1 is

1 n+1n−1 given by n+1 k k−1 . (6) The number of paths in P(n, 1, 1) with k valleys that start with a down step with exactly j down steps starting on or below the x-axis for j = 1, 2, . . . , n

1 n n  is given by n k k−1 .

Proof.

(1) Consider paths that start with a down step D and end with an up step U with k − 1 peaks UD. Each one will have k conjugates of this form because the starting point will become a peak when we take a conjugate. So taking peaks as special vertices we see by Theorem 4 that the number of peaks on or below the x-axis is equidistributed.

We can write such a path as Dj0 U i1 Dj1 ··· U ik−1 Djk−1 U ik where

i1 + i2 + ··· + ik = n + 1; il > 0

15 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

and

j0 + j1 + ··· + jk−1 = n; jl > 0

n−1 n  for l = 0, . . . , k. The number of solutions of these equations is k−1 k−1 . Since each path has k conjugates of this form, the number of paths with j peaks on or below the

1 n−1 n  x-axis is given by k k−1 k−1 .

(2) Since the peaks and the valleys are interchangable, by replacing the up steps with down steps the proof of the the second part is exactly the same as the first part.

(3) Consider paths that start with an up step U and end with an up step U. We know that the number of peaks plus the number of double rises is equal to n. So if we consider paths with k UDs then each path will have n − k double rises. So there will be n − k + 1 conjugates that start and end with an up step. We can write such

a path as U i1 Dj1 ··· U ik Djk U ik+1 where

i1 + i2 + ··· + ik+1 = n + 1; il > 0, for l = 1, . . . , k + 1

and

j1 + j2 + ··· + jk = n; jm > 0, for m = 1, . . . , k.

nn−1 The number of solutions of these equations is k k−1 . Since there are n − k + 1 conjugates of this form, the number of paths with j double rises on or below the

1 nn−1 x-axis is given by n−k+1 k k−1 .

(4) Consider paths that start with a down step D and end with a down step D. We know that the number of valleys plus the number of double falls is equal to n − 1. So if we consider paths with k DUs then each path will have n − k − 1 double falls. So

16 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

we can write such a path as Di1 U j1 ··· U jk Dik+1 where

i1 + i2 + ··· + ik+1 = n; il > 0 for l = 1, 2, . . . , k + 1

and

j1 + j2 + ··· + jk = n + 1; jm > 0 for m = 1, . . . , k.

n−1 n  The number of solutions of these equations is k k−1 . Since there are n − k conjugates of this form, the number of paths with j double falls on or below the

1 n−1 n  x-axis is given by n−k k k−1 .

(5) If we consider paths that start with an up step U with k peaks UD and we do not care how they end then we get n + 1 conjugates of this form. We can write such

a path as U i1 Dj1 U i2 ··· U ik Djk U ik+1−1 where

i1 + i2 + ··· + ik+1 − 1 = n + 1; il > 0

for l = 1, . . . , k + 1 and

j1 + j2 + ··· + jk = n; jl > 0

n+1n−1 for l = 1, . . . , k. The number of solutions of these equations is k k−1 . Since each path has n + 1 conjugates of this form, the number of paths with j up steps on or

1 n+1n−1 below the x-axis is given by n+1 k k−1 .

(6) If we consider paths that start with a down step D with k valleys DU, each one will have n conjugates of this form. We can write such a path as Di1 U j1 ··· Dik U jk Dik+1−1 where

i1 + i2 + ··· + ik+1 − 1 = n; il > 0

17 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

for l = 1, . . . , k and

j1 + j2 + ··· + jk = n + 1; jl > 0

n n  for l = 1, . . . , k + 1. The number of solutions of these equations is k k−1 . Since each path has n conjugates of this form, the number of paths with j down steps on

1 n n  or below the x-axis is given by n k k−1 . 

Notice that from part five of Theorem 2.5.2 we can find an analogue of the classical Chung-Feller theorem for Narayana numbers in terms of decending runs. A decend- ing run in a path is a maximal consecutive sequence of down steps. For example, UDUDDUUUDD has 3 decending runs. If we remove the first up step of the paths as described in part five and shift the paths down one level, we get paths in P(n, 1, 0) that start and end on the x-axis. If these paths start with an up step they will have k peaks or k decending runs. If they start with a down step then they will have k − 1 peaks but k decending runs. Therefore the equivalent Narayana-Chung-Feller theorem is

Theorem 2.5.3 (Narayana-Chung-Feller Theorem). Among the paths in P(n, 1, 0) with k decending runs, the number of paths with i up steps below the x-axis is inde-

1 n+1n−1 pendent of i for i = 0, . . . , n, and is the Narayana number n+1 k k−1 .

1 nn−1 The Narayana number formula k−1 k k−2 did not fit into this picture. But we have a nice combinatorial interpretation for this form in section 4.4.

18 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

2.6. Circular peaks

We will introduce here the notion of circular peaks to give yet another application of the generalized Chung-Feller theorem. In addition to the six forms of the Narayana number formula presented in the previous section there is another form given by

1  n n n + 1n − 1 N(n, k) = + . (2.6.1) 2n + 1 k − 1 k k k − 1

We’ll present a theorem in this section that will give a combinatorial interpretation of this form of the Narayana number formula.

Definition 2.6.1. For any path p ∈ P(n, 1, 1) we call every peak a circular peak. If p starts with a down step and ends with an up step then the initial vertex will also be considered as a circular peak.

Note that circular peaks are preserved under arbitrary conjugation.

Theorem 2.6.2. The number of paths in P(n, 1, 1) with k circular peaks having j vertices on or below the x-axis is independent of j for j = 1,..., 2n+1. The number of

1 n n n+1n−1 such paths is given by the Narayana number N(n, k) = 2n+1 k−1 k + k k−1 .

Proof. We consider paths with n + 1 up steps and n down steps with k circular peaks. To find the total number of paths we need to consider two cases. Case 1: Paths starting with a down step. This kind of path has k − 1 peaks if the path ends with an up step and k peaks if it ends with a down step. The path can be represented by Di1 U j1 Di2 U j2 ...Dik U jk Dik+1−1 where

i1 + i2 + ··· + ik + ik+1 − 1 = n; il > 0

and

j1 + j2 + ··· + jk = n + 1; jl > 0

19 CHAPTER 2. A GENERALIZED CHUNG-FELLER THEOREM

n n  for each l = 1, 2, . . . , k. The number of solution is k k−1 . Case 2: Paths starting with an up step. This kind of path has k peaks. The path can be represented by U i1 Dj1 U i2 ...U ik Djk U ik+1−1 where

i1 + i2 + ··· + ik+1 = n + 2; il > 0 for each l = 1, 2, . . . , k + 1 and

j1 + j2 + ··· + jk = n; jm > 0 for each m = 1, 2, . . . , k

n+1n−1 The number of solution is k k−1 . Adding the two we get

 n n n + 1n − 1 1 n + 1n − 1 + = (2n + 1) k − 1 k k k − 1 n + 1 k k − 1 (2.6.2) = (2n + 1)N(n, k).

We know that circular peaks are preserved under conjugation and there are 2n+1 conjugates of these paths. So using Theorem 2.1.2 dividing (2.6.2) by 2n + 1 we see that the number of paths with j vertices on or below the x-axis is given by the

1 n n n+1n−1 Narayana number 2n+1 k−1 k + k k−1 . 

20 CHAPTER 3

Other number formulas

3.1. Motzkin, Schr¨oder,and Riordan number formulas

In this section we’ll consider paths having different types of steps, in particular Motzkin and Schr¨oder paths. We’ll see that the generalized Chung-Feller theorem can also be applied to the Motzkin and Schr¨odernumber formulas.

Definition 3.1.1. Let us define Q(k, l, r, s, h) to be the set of paths having the step set M = {(1, 1), (s, 0), (1, −r)} that lie in the half plane Z≥0 × Z ending at ((r + 1)k + sl + h, h) with rk + h up steps, k down steps, and l flat steps. The paths in Q(k, l, 1, 1, 0) that lie in the quarter plane Z≥0 × Z≥0 are known as Motzkin paths and the paths in Q(k, l, 1, 2, 0) that lie in the quarter plane Z≥0 × Z≥0 are known as Schr¨oderpaths. In this section we’ll only consider s having the value 1 or 2.

All the paths discussed before including the Motzkin paths have steps of unit length. Therefore the total number of steps of the paths coincided with the length of the path. But from now we’ll define the length of the path to be the x-coordinate of the endpoint. So paths in Q(k, l, r, s, h) have length (r+1)k+sl+h and total number of steps (r + 1)k + l + h. With this definition we can see that the difference between the Schr¨oderpaths and the Motzkin paths is due to the length of the horizontal steps. The horizontal steps of the Schr¨oderpaths are of length two. So the Schr¨oderpaths that start and end on the x-axis have even length. 21 CHAPTER 3. OTHER NUMBER FORMULAS

Let us define

1 2k + l2k 2k + l T (k, l) = = C . (3.1.1) k + 1 2k k 2k k

Then T (k, l) counts paths in Q(k, l, 1, s, 0) because the number of ways to place the 2k+l flat steps is 2k and after placing the flat steps we can place in Ck ways the up and down steps. Replacing 2k + l by n or k + l by n in (3.1.1) we get the following two formulas.

1  n 2k M(n, k) = (3.1.2) k + 1 2k k 1 n + k2k R(n, k) = . (3.1.3) k + 1 2k k

Here M(n, k) counts Motzkin paths in Q(k, n − 2k, 1, 1, 0) with k up steps, k down Pbn/2c steps and n − 2k flat steps and the [5] Mn = k=0 M(n, k) counts Motzkin paths of length n. The first few Motzkin numbers (sequence A001006 in OEIS) are 1, 1, 2, 4, 9, 21, 51, 127, 323, 835, 2188, 5798,... . Also R(n, k) counts Schr¨oder paths in Q(k, n − k, 1, 2, 0) with k up steps, k down steps and n − k flat steps and the Pn Schr¨odernumber Rn = k=0 R(n, k) counts Schr¨oderpaths of semi-length n = k + l. The first few Schr¨odernumbers (sequence A006318 in OEIS) are 1, 2, 6, 22, 90, 394,... . There is a simple relation between (3.1.2) and (3.1.3) given by

M(n + k, k) = R(n, k).

Below is the table of values of T (k, l) for k, l = 0,..., 6.

22 CHAPTER 3. OTHER NUMBER FORMULAS

k \ l 0 1 2 3 4 5 6 0 1 1 2 5 14 42 132 1 1 3 10 35 126 462 1716 2 1 6 30 140 630 2772 12012 3 1 10 70 420 2310 12012 60060 4 1 15 140 1050 6930 42042 240240 5 1 21 252 2310 18018 126126 816816 6 1 28 420 4620 42042 336336 2450448

It is interesting to see that we can write T (k, l) in the following seven forms,

1 2k + l2k 12k + l 2k  T (k, l) = = k + 1 2k k k 2k k − 1 1 2k + lk + l + 1 1 2k + lk + l = = k + l + 1 k k + 1 k + l k + 1 k 1 2k + l2k + 1 12k + lk + l = = 2k + 1 2k k l k k + 1 1 2k + l + 12k + 1 = . 2k + l + 1 2k + 1 k

Note that when l = 0 these formulas reduce to the three forms of the Catalan numbers

1 except for the one with l in front. Similar to the Catalan and the Narayana number formulas, we will give a combinatorial interpretation of the different formulas for T (k, l) in the following theorem.

Theorem 3.1.2.

(1) The number of paths in Q(k, l, 1, s, 1) that start with an up step with exactly i

1 2k+l2k up steps starting on or below the x-axis for i = 1, 2, . . . , k+1 is k+1 2k k . 23 CHAPTER 3. OTHER NUMBER FORMULAS

(2) The number of paths in Q(k, l, 1, s, 1) that start with a down step with exactly

1 2k+l 2k  i down steps starting on or below the x-axis for i = 1, 2, . . . , k is k 2k k−1 . (3) The number of paths in Q(k, l, 1, s, 1) that start with a flat step with exactly

1 2k+lk+l i flat steps starting on or below the x-axis for i = 1, 2, . . . , l is l k k+1 . (4) The number of paths in Q(k, l, 1, s, 1) that start with an up step or flat step with exactly i up or flat steps starting on or below the x-axis for i =

1 2k+lk+l+1 1, 2, . . . , k + l + 1 is k+l+1 k k+1 . (5) The number of paths in Q(k, l, 1, s, 1) that start with a down step or a flat step with exactly i down or flat steps starting on or below the x-axis for

1 2k+lk+l i = 1, 2, . . . , k + l is k+l k+1 k . (6) The number of paths in Q(k, l, 1, s, 1) that start with an up or a down step with exactly i up or down steps starting on or below the x-axis for i =

1 2k+l2k+1 1, 2,..., 2k + 1 is 2k+1 2k k . (7) The number of paths in Q(k, l, 1, s, 1) with exactly i vertices on or below the

1 2k+l+12k+1 x-axis for i = 1, 2,..., 2k + l + 1 is 2k+l+1 2k+1 k .

Proof. The proof is straightforward using similar arguments to those in the proof of Theorem 2.3.1. For example the paths in Theorem 3.1.2(1) that start with an up step have a total of 2k + l + 1 steps. Since the paths start with an up step 2k+l we can choose 2k places from the remaining 2k + l places in 2k ways for the up 2k and down steps and then choose k places from the 2k chosen places in k ways to place the down steps. Since there are k + 1 conjugates for each path that start with an up step, the number of paths with exactly i up steps on or below the x-axis for

1 2k+l2k+1 i = 1, 2, . . . , k + 1 is k+1 2k k . 

It is also easy to make the connection between these paths and Motzkin and Schr¨oderpaths which end at height 0 rather than height 1. For example, consider the

24 CHAPTER 3. OTHER NUMBER FORMULAS

paths in Theorem 3.1.2(1) that start with an up step and end at height one keeping track of the up steps starting on or below the x-axis. According to the theorem, the number of these paths with i up steps starting below the x-axis is independent of i. So if we remove the first up step of these paths and shift the paths down one level then we get paths that start and end on the x-axis, and have i up steps starting below the x-axis. Furthermore if we consider i = 0 then all the steps must start on or above the x-axis and we get exactly the Motzkin or Schr¨oderpaths. On the other hand if we take i as large as possible then removing the first up step and shifting the path down one level gives us the negatives of the Motzkin or Schr¨oderpaths. Next we look at similar relations with the Riordan and small Schr¨odernumbers. The number of Motzkin paths of length n with no horizontal steps at level 0 are called Riordan numbers (sequence A005043 in OEIS) and the number of Schr¨oderpaths of length n with no horizontal steps at level 0 are called small Schr¨odernumbers (se- quence A001003 in OEIS). Therefore Riordan and small Schr¨oderpaths are Motzkin and Schr¨oderpaths respectively without any flat steps on the x-axis. It can be shown that 12k + lk + l − 1 Z(k, l) = (3.1.4) k k − 1 k − 1 counts paths in Q(k, l, 1, s, 0) with no flat step on the x-axis. Replacing 2k + l by n or k + l by n in (3.1.4) we get the following two formulas.

1n − k − 1 n  J(n, k) = (3.1.5) k k − 1 k − 1 1n − 1n + k S(n, k) = . (3.1.6) k k − 1 k − 1

Here J(n, k) counts Riordan paths in Q(k, n−2k, 1, 1, 0) with k up steps, k down steps Pbn/2c and n − 2k flat steps and the Riordan number Jn = k=0 J(n, k) counts Riordan

25 CHAPTER 3. OTHER NUMBER FORMULAS paths of length n. The first few Riordan numbers 0, 1, 1, 3, 6, 15, 36, 91,... . On the other hand S(n, k) counts small Schr¨oder paths in Q(k, n − k, 1, 2, 0) with k up steps, Pn k down steps, and n − k flat steps and the small Schr¨odernumber Sn = k=0 S(n, k) counts small Schr¨oderpaths of semi-length n = k + l. The first few small Schr¨oder numbers are 1, 1, 3, 11, 45, 197,... . The relation between (3.1.5) and (3.1.6) is similar to the relation between the Motzkin and large Schr¨odernumber formulas,

J(n + k, k) = S(n, k).

The following table illustrates Z(k, l) for values of l and k from 1 to 6.

k \ l 1 2 3 4 5 6 1 1 2 5 14 42 132 2 1 5 21 84 330 1287 3 1 9 56 300 1485 7007 4 1 14 120 825 5005 28028 5 1 20 225 1925 14014 91728 6 1 27 385 4004 34398 259896

There are several forms of Z(k, l) as well. More precisely five, as follows

1 k + l2k + l 1k + l − 12k + l Z(k, l) = = k + l k k − 1 k k − 1 k − 1 1 2k + lk + l − 1 12k + lk + l − 1 = = k + l + 1 k k − 1 l k − 1 k 1 2k + l + 1k + l − 1 = . 2k + l + 1 k k − 1

Although these forms suggest that there may exist a nice combinatorial interpre- tation like Theorem 3.1.2, we do not have one so far.

26 CHAPTER 3. OTHER NUMBER FORMULAS

The relation between these formulas can be viewed nicely using the following diagram which also shows the relation between Motzkin and Riordan number formulas and large and small Schr¨odernumber formulas.

T (k, l) n=2k+l n=k+l

X M(n+k,k)=R(n,k) X Mn = M(n, k) Rn = R(n, k) k k

Mn=Jn+Jn+1 Rn=2Sn

X J(n+k,k)=S(n,k) X Jn = J(n, k) Sn = S(n, k) k k

n=2k+l n=k+l Z(k, l).

Moreover there is a simple relation between (3.1.1) and (3.1.4) given by

T (k, l) = Z(k + 1, l) + Z(k, l + 1).

27 CHAPTER 3. OTHER NUMBER FORMULAS

3.2. A combinatorial proof of the relation between large and small Schr¨odernumbers and between Motzkin and Riordan numbers

It is well known [37] that

Rn = 2Sn (3.2.1) for n ≥ 1. Shapiro and Sulanke [35], Sulanke [39] and Deutsch [16] have given bijective proofs of (3.2.1). In [16] Deutsch uses the notion of short bush and tall bush (rooted short bush) with n + 1 leaves to show his bijection.

The small Schr¨odernumber Sn for n ≥ 1 is the number of Schr¨oderpaths with no flat steps on the x-axis. Marcelo Aguiar and Walter Moreira [1] noted that the

Schr¨oderpaths counted by the large Schr¨odernumbers Rn fall in two classes, those with flat steps on the x-axis, and those without and the number of paths in each class is the small Schr¨odernumber Sn. This is quite easy to see. Consider a Schr¨oderpath with at least one flat step on the x-axis. Now we remove the last flat step that lies on the x-axis and elevate the path before the flat step by adding an up step at the begining and a down step at the end. The resulting path will have no flat step on the x-axis. To go back consider a nonempty Schr¨oderpath with no flat step on the x-axis. This kind of path must start with an up step. So we look at the part of the path that returns to the x-axis for the first time. We remove the up and down step from the two ends of this part and replace them with a flat step after this part. The resulting path is a Schr¨oder path with at least one flat step on the x-axis. From Theorem 3.1.2(4) we find another combinatorial proof of (3.2.1). Consider the paths described in Theorem 3.1.2(4) that start with a flat or a down step and end at height one of length 2n + 1(= 2k + 2l + 1). Among these paths consider those with all the flat or down steps on or below the x-axis. These are counted by the

28 CHAPTER 3. OTHER NUMBER FORMULAS

large Schr¨odernumbers. The following figure illustrates a path of this form of length 25. Removing the last up step of these paths gives us the negative Schr¨oderpaths.

Figure 3.1. A path in Q(9, 5, 1, 2, 1) with all flat or down steps on or below the x-axis.

According to the theorem these are equinumerous with those with exactly one flat or down step on or below the x-axis. But these fall into two classes, those starting with a flat step and those starting with a down step. Let p be a path of this form. If p starts with a flat step then it cannot have any other flat step on the x-axis, but it may touch the x-axis. Moreover the rest of the path cannot go below the x-axis. So if we remove the first flat step and add a down step at the end of p we get a Schr¨oderpath that does not have a flat step on the x-axis. Also exchanging a flat step with a down step reduces the length of the path to 2n. These paths are counted by the small Schr¨odernumbers Sn (3.1.6). On the other hand if p starts with a down step then it must have an up step immediately after that and the rest of the path cannot have any flat step on the x-axis and must lie above the x-axis, although it may touch the x-axis. So if we remove the initial two steps (DU) from p and add a down step at the end we again get a Schr¨oderpath of length 2n that does not have a flat step on the x-axis. Adding these two cases we get the large Schr¨odernumbers Rn. This shows that Rn = 2Sn.

29 CHAPTER 3. OTHER NUMBER FORMULAS

We can also look at similar relations between Motzkin and Riordan numbers. We know that the Motzkin and the Riordan numbers are related by the relation

Mn = Jn + Jn+1. (3.2.2)

Here we can use the same argument that we used for Schr¨oder numbers to give a combinatorial interpretation. Consider the paths described in Theorem 3.1.2(4) that start with a flat or an up step with length n + 1(= 2k + l + 1) and end at height one. Among these paths consider those with all the flat or down steps on or below the x-axis. Since all the steps of these paths except the last stay on or below the x-axis, removing the last up step gives us the negatives of the Motzkin paths. These are counted by the Motzkin numbers Mn and these are equinumerous, by Theorem 3.1.2(4), with those paths with exactly one flat or up step on or below the x-axis. But these also fall into two classes, those starting with a flat step and those starting with a down step. Let q be a path of this form. If q starts with a flat step then it cannot have any other flat step on the x-axis. Moreover the rest of the path will lie above the x-axis although it may touch the x-axis. So if we remove the first flat step and add a down step at the end we get a Motzkin path of length n + 1 that does not have a flat step on the x-axis. Since exchanging the flat step with a down step does not change the length of the path, these paths are counted by the Riordan numbers Jn+1. On the other hand if q starts with a down step then it must have an up step immediately after that and the rest of the path must lie above the x-axis. So if we remove the initial two steps (DU) from q and add a down step at the end we get a

30 CHAPTER 3. OTHER NUMBER FORMULAS

Motzkin path of length n that does not have a flat step on the x-axis and these are counted by the Riordan numbers Jn. This shows the relation (3.2.2).

31 CHAPTER 4

Generating functions

Generating functions are very useful in lattice path enumeration. Finding gener- ating functions is equivalent to finding explicit formulas. Generating functions can be applied in many different ways, but the simplest is the derivation of functional equations from combinatorial decompositions. For example, every Dyck path can be decomposed into “prime” Dyck paths by cutting it at each return to the x-axis:

Figure 4.1. Primes

Moreover, a prime Dyck path consists of an up step, followed by an arbitrary Dyck path, followed by a down step. It follows that if c(x) is the generating function for Dyck paths (i.e., the coefficient of xn in c(x) is the number of Dyck paths with 2n steps) then c(x) satisfies the equation c(x) = 1/(1 − xc(x)) which can be solved to give the generating function for the Catalan numbers,

√ ∞ 1 − 1 − 4x X 1 2n c(x) = = xn. 2x n + 1 n n=0

Many other lattice path results can be proved by similar decompositions. We’ll use mainly three types of decompositions to prove generalized Chung-Feller theorems. The most common form of decomposition is decomposing the path into arbitrary 32 CHAPTER 4. GENERATING FUNCTIONS

positive and negative primes that start and end on the x-axis. We can also consider primes that start and end at height 1. 2n For example, let us consider paths in P(n, 1, 0). There are n paths in P(n, 1, 0)

√ 1 and we know that the generating function for these paths is 1−4x . There are several ways we can decompose these paths. First we decompose a path p in P(n, 1, 0) into positive and negative primes. The generating function for the positive primes is xc(x) and the generating function for the negative primes is the same. So the generating function for all of these paths is

1 1 = √ . 1 − 2xc(x) 1 − 4x

Second we can decompose a path p into positive primes separated by (possibly empty) negative paths. Here we have alternating negative paths and positive primes,

Figure 4.2. Decomposition of a path into positive primes and negative paths

starting and ending with a negative path. The generating function for negative paths is c(x). So the generating function for all such paths is

∞ X c(x) 1 c(x)[xc(x) · c(x)]k = = √ . 1 − xc(x)2 1 − 4x k=0

Finally, we can decompose a path p into alternating positive and negative paths. Let the generating function for nonempty positive and negative paths be P and N respectively. So P = N = c(x) − 1 = xc(x)2.

33 CHAPTER 4. GENERATING FUNCTIONS

Therefore the generating function for all paths is

1 c(x)2 c(x) (1 + P ) (1 + N) = = 1 − NP 1 − (xc(x)2)2 1 − xc(x)2 (4.0.3) 1 = √ . 1 − 4x

We can also use similar decompositions for paths having different types of steps or ending at other height.

34 CHAPTER 4. GENERATING FUNCTIONS

4.1. Counting with the Catalan generating function

In this section we’ll give another proof of Theorem 2.3.1 using the generating function approach. First we define the generating functions for the paths described in Theorem 2.3.1. Let xf(x, y) denote the generating function for the paths in P(n, 1, 1) that start with an up step, where we put a weight of x on the up steps that start on or below the x-axis and we put a weight of y on the up steps that start above the x-axis. Similarly we denote by xg(x, y) the generating function for the paths in P(n, 1, 1) that start with a down step, where we put a weight of x on the the down steps that start on or below the x-axis and we put a weight of y on the down steps that start above the x-axis and finally we denote by yh(x, y) the generating function for the paths in P(n, 1, 1) putting a weight of x on the vertices that are on or below the x-axis and a weight of y on the vertices that are above the x-axis except for the first vertex. With these weights, we have the following theorem which is equivalent to Theorem 2.3.1.

Theorem 4.1.1. The generating functions f(x, y), g(x, y) and h(x, y) satisfies

P∞ Pn i n−i (1) f(x, y) = n=0 Cn i=0 x y P∞ Pn i n−i (2) g(x, y) = n=0 Cn+1 i=0 x y P∞ P2n i 2n−i (3) h(x, y) = n=0 Cn i=0 x y

Proof.

(1) To prove Theorem 4.1.1(1) we first show that

1 f(x, y) = . 1 − xc(x) − yc(y)

35 CHAPTER 4. GENERATING FUNCTIONS

Consider paths in P(n, 1, 1) starting with an up step and ending at height 1. We want to count all such paths according to the number of up steps that start on or below the x-axis with weights x and y as described above. Any path p of this form has a total of 2n + 1 steps with n + 1 up steps and n down steps. If we remove the first step of p and shift the path one level down we get a path in P(n, 1, 0) of length 2n, where the up steps originally starting on or below the x-axis are now up steps starting below the x-axis. The generating function for these paths is f(x, y), where every up step below the x-axis is weighted x and every up step above the x-axis is weighted y. We can factor this path into positive and negative primes, where a positive prime path is a path in P(n, 1, 0, +) that starts with an up step and comes back to the x-axis only at the end and a negative prime path is a path in P(n, 1, 0, −) that starts with a down step and returns to the x-axis only at the end. We know that the number of positive prime paths of length 2n is the (n − 1)th Catalan number. So the generating

+ function for the positive prime paths (denoted by f1 (x)) is given by

∞ + X n f1 (y) = Cn−1y = yc(y). n=1

− Similarly the generating function for the negative prime paths (denoted by f1 (y)) is given by ∞ − X n f1 (x) = Cn−1x = xc(x). n=1 Since an arbitrary path can be factored into l primes (positive or negative) for some l, the generating function for all paths is

∞ X 1 1 f(x, y) = (f + + f −)l = = . 1 1 1 − f + − f − 1 − xc(x) − yc(y) l=0 1 1

36 CHAPTER 4. GENERATING FUNCTIONS

Including the initial up step we get the generating function of paths that start with an up step from (0, 0) and end at height 1 as

x xf(x, y) = . 1 − xc(x) − yc(y)

Now we’ll show xc(x) − yc(y) 1 = (4.1.1) x − y 1 − xc(x) − yc(y) or (xc(x) − yc(y))(1 − xc(x) − yc(y)) = x − y.

Starting with the left-hand side we get

(xc(x) − yc(y))(1 − xc(x) − yc(y))

= xc(x) − yc(y) − x2c(x)2 + y2c(y2)

= x(1 + xc(x)2) − y(1 + yc(y)2) − x2c(x)2 + y2c(y2)

= x + x2c(x)2 − y + y2c(y)2 − x2c(x)2 + y2c(y2)

= x − y.

(2) To prove Theorem 4.1.1(2) we first show that

c(x)c(y) g(x, y) = . 1 − xc(x) − yc(y)

Consider paths in P(n, 1, 1) starting with a down step and ending at height 1. We want to count all such paths according to the number of down steps that start on or below the x-axis. The generating function of these paths is xg(x, y) with weights x and y on the down steps as defined before.

37 CHAPTER 4. GENERATING FUNCTIONS

Since the paths start with a down step, they start with a negative prime path. So we can write any path starting from (0, 0) with a down step and ending at (2n + 1, 1) in the form

− + p = q Qq∗

where q− is a negative prime path, Q is an arbitrary path in P(n, 1, 0) that starts

+ and ends on the x-axis, and q∗ is a path that stays above the x-axis and ends at (2n + 1, 1). So the generating function for positive prime paths is given by

+ g1 (y) = yc(y)

and the generating function for negative prime paths q− is given by

− g1 (x) = xc(x).

+ + If we add an extra down step to q∗ we get a positive prime path. Therefore q∗ has + the generating function g∗ (y) = c(y). We also know Q has the generating function − + −1 (1 − g1 (x) − g1 (y)) . Therefore the generating function for paths of the form p can be written as

xc(x)c(y) xg(x, y) = g−(x)(1 − g−(x) − g+(y))−1g+(y) = . 1 1 1 ∗ 1 − xc(x) − yc(y)

Using the identity (4.1.1) we find

c(x)c(y) xc(x) − yc(y) = c(x)c(y) 1 − xc(x) − yc(y) x − y xc(x)2c(y) − yc(y)2c(x) = x − y (c(x) − 1)c(y) − (c(y) − 1)c(x) = x − y

38 CHAPTER 4. GENERATING FUNCTIONS

c(x) − c(y) = . x − y

(3) Finally to prove Theorem 4.1.1(3) we first show that

c(x2)c(y2) h(x, y) = . 1 − xyc(x2)c(y2)

We consider any path p ∈ P(n, 1, 1) having the following weights on the steps above the x-axis and below the x-axis: We weight the steps ending at vertices that lie above the x-axis by y, and we weight steps ending at vertices on or below the x-axis by x. The generating function for these paths is yh(x, y). We decompose p in the following way:

− + − + − + − + p = p1 p1 p2 p2 . . . pmpmp∗ p∗

− + − for m ≥ 0, where each pi is a negative path, each pi is a positive prime path, p∗ is + the last negative path, and p∗ is the last positive path that leaves x-axis for the last time and ends at height 1. The generating function of the negative paths (denoted

− by h1 (x)) is − 2 h1 (x) = c(x ).

+ The generating function of the positive prime paths (denoted by h1 (x)) is

+ 2 h1 (x) = xyc(y )

+ and the generating function for paths that look like p∗ is

+ 2 h∗ (x) = yc(y ).

Therefore the generating function for paths of the form p is

2 2 1 − + yc(x )c(y ) yh(x, y) = − + h1 (x)h∗ (y) = 2 2 . 1 − h1 (x)h1 (y) 1 − xyc(x )c(y ) 39 CHAPTER 4. GENERATING FUNCTIONS

Now to complete the proof we need to show that

c(x2)c(y2) x − y · = 1. (4.1.2) 1 − xyc(x2)c(y2) xc(x2) − yc(y2)

Starting with the left hand side we get

c(x2)c(y2) x − y · 1 − xyc(x2)c(y2) xc(x2) − yc(y2) c(x2)c(y2)(x − y) = xc(x2) − yc(y2) − x2yc(x2)2c(y2) − xy2c(x2)c(y2)2 c(x2)c(y2)(x − y) = (1 + y2c(y2)2)xc(x2) − (1 + x2c(x2)2)yc(y2) c(x2)c(y2)(x − y) = xc(y2)c(x2) − yc(x2)c(y2)

= 1. 

40 CHAPTER 4. GENERATING FUNCTIONS

4.2. The left-most highest point

In this section we’ll show another type of equidistribution property with respect to the left-most highest point of paths in P(n, 1, 1). We find that the number of paths in P(n, 1, 1) with i steps before the left most highest point is independent of i.

Given a sequence f = (a1, a2, . . . , an) ∈ Λ of distinct real numbers with partial sums s0 = 0, s1 = a1,... , sn = a1 + ··· + an, where Λ is the set of sequences obtained by permuting the elements of {a1, a2, . . . , an}, we define the following two numbers:

P (f) = the number of strictly positive terms in the sequence (s0, s1, . . . , sn)

L(f) = the smallest index k = (0, 1, . . . , n) with sk = max sm. 0≤m≤n

Thus for any permutation of the sequence f ∈ Λ, both P (f) and L(f) are natural numbers between 0 and n and the equivalence principle of Sparre Andersen [2] states that the distribution P (f) and L(f) over the n! permutations of Λ are identical. In this section we show that the equivalence principle of Sparre Andersen gives us another Chung-Feller type phenomenon. This was also studied by Foata [21], Woan [41], and Baxter [4]. For a lattice path p ∈ P(n, r, h) the numbers P (f) and L(f) becomes the number of vertices of the path p that lie on or above the x-axis and the position of the left- most highest vertex respectively. First we consider paths in P(n, 1, h). Then we claim that every path ending at height 1 has a unique conjugate whose left-most highest vertex lies at the end. In other words we have the following theorem.

Theorem 4.2.1. If p ∈ P(n, 1, 1) is a path whose left-most highest vertex lies at the end then the left-most highest vertex of σi(p) lies at position 2n − i.

41 CHAPTER 4. GENERATING FUNCTIONS

Proof. Let us consider the generating function approach. Suppose the path ends at height h and the left-most highest vertex v lies at height k. We can decompose the path into two parts a and b at the vertex v. Part a of the path starts at the origin and end at height k and part b of the path starts at height k and ends at height k − h, where k ≥ h. We weight the steps before the vertex v by x and the steps after the vertex v by y. Then the generating function of the part a is (xc(x2))k and the generating function of part b is c(y2)(yc(y2))k−h. Therefore the generating function of the whole path (denoted by P (x, y)) is

∞ X P (x, y) = (xc(x2))kc(y2)(yc(y2))k−h. (4.2.1) k=1

Taking h = 1 we get

∞ X P (x, y) = (xc(x2))kc(y2)(yc(y2))k−1 k=0 ∞ X = xc(x2)c(y2) (xc(x2))k(yc(y2))k (4.2.2) k=0 xc(x2)c(y2) = . 1 − xyc(x2)c(y2)

From equation (4.1.2) and (4.2.2) we find that

xc(x2) − yc(y2) P (x, y) = x x − y

i+1 2n−i 1 2n+1 and the coefficient of x y in P (x, y) is 2n+1 n . 

42 CHAPTER 4. GENERATING FUNCTIONS

4.3. Counting with the Narayana generating function

Recall that the Narayana numbers are

1 n n  N(n, k) = n k k − 1

for n ≥ 1. We can get the Catalan numbers from the Narayana numbers by

n X N(n, k) = Cn. (4.3.1) k=1

We define the Narayana generating function by

X E(x, s) = N(n, m)sm−1xn. (4.3.2) 1≤m≤n

It is known that E(x, s) can be expressed explicitly as

1 − x − xs − p(1 − x + xs)2 − 4xs E(x, s) = . (4.3.3) 2xs

Notice that E(x, 1) = c(x)−1. We will use several identities satisfied by the generating function E which can be proved by a straightforward computation which we omit. We list them here sE(x, s) − tE(x, t) E(x, s)(1 + tE(x, t)) 1 + E(x, t) 1 + = 1 + = s − t 1 − tE(x, s)E(x, t) 1 − sE(x, s)E(x, t) (4.3.4) 1 + E(x, s) = 1 − tE(x, s)E(x, t)

E(x, s) − E(x, t) (1 + E(x, s))E(x, s)E(x, t) = s − t 1 − tE(x, s)E(x, t) (4.3.5) x(1 + E(x, t))E(x, s) = . 1 − x(1 + sE(x, s)) − xt(1 + E(x, t)) Next we’ll give a generating function proof of Theorem 2.5.2 by decomposing the paths into positive and negative parts or into primes. We recall here that by a peak

43 CHAPTER 4. GENERATING FUNCTIONS lying on or below the x-axis we mean the vertex between the up step and the down step lying on or below the x-axis and similarly for valleys/double rises/double falls.

Proof of Theorem 2.5.2.

(1) For the first part of Theorem 2.5.2 we want to count paths p1 ∈ P(n, 1, 1) that start with a down step and end with an up step according to the number of peaks on or

+ − below the x-axis. We take Lpk(x, s) and Lpk(x, t) to be the generating function of the nonempty positive paths and the nonempty negative paths in P(n, 1, 0) respectively according to peaks. From (4.3.2) we see that if x weights the semi-length and s weights the number of peaks then sE(x, s) is the generating function for nonempty

+ Dyck paths according to peaks. Therefore we can express Lpk(x, s) in terms of the Narayana generating function E(x, s) as

+ X X n pk(p) Lpk(x, s) = x s = sE(x, s) (4.3.6) n all nonempty p∈P(n,1,0,+) where n is the semi-length of p and pk(p) is the number of peaks of p. If we reflect a Dyck path about the x-axis we get a negative path where the peaks become valleys and the valleys become peaks. Since the number of valleys in a Dyck path is one

− less than the number of peaks, the generating function Lpk(x, t) can be expressed in terms of the Narayana generating function as

− X X n pk(p) X X n v(p) Lpk(x, t) = x t = x t n all nonempty n all nonempty p∈P(n,1,0,−) p∈P(n,1,0,+)

= E(x, t) where v(p) is the number of valleys of p.

44 CHAPTER 4. GENERATING FUNCTIONS

Since the path p1 starts with a down step, it starts with a negative path. If we remove the last up step then we can write the remaining path Gp in the form

− + − + − + − Gp = g1 g1 g2 g2 ··· gmgmgp∗U

− + where each gi is a nonempty negative path and each gi is a nonempty positive path − for 0 ≤ i ≤ m and gp∗ is the last negative path which can be empty. Therefore, taking

Figure 4.3. Peaks on or below the x-axis

Lpk(x, s, t) to be the generating function for all paths of the form p1 according to the semi-length and number of peaks with weight s on the peaks that lie above the x-axis and weight t on the peaks that lie on or below the x-axis, we can write

1 − Lpk(x, s, t) = − + (1 + Lpk(x, t)) 1 − Lpk(x, t)Lpk(x, s) 1 + E(x, t) = 1 − sE(x, t)E(x, s) sE(x, s) − tE(x, t) = 1 + by (4.3.4) s − t X = 1 + N(n, m)xn(sm−1 + sm−2t + ··· + tm−1). 1≤m≤n

n i j This shows that the coefficient of x s t in the expansion of Lpk(x, s, t) is given by 1 n n−1 the Narayana number k k−1 k−1 . 45 CHAPTER 4. GENERATING FUNCTIONS

(2) The second part of the theorem counts paths Gv ∈ P(n, 1, 1) that start with an up step and end with a down step with respect to the valleys on or below the x-axis. For convenience we’ll decompose these paths into positive and negative paths with respect to height 1 instead of the x-axis. So a positive/negative path in this case will be a path that starts and ends at height 1 and stays above/below the x-axis respectively.

+ − We take Lv (x, s) and Lv (x, t) to be the generating functions of nonempty positive paths and negative paths that start and end at height 1 according to valleys where s is the weight on valleys that stay above the x-axis and t is the weight on valleys that stay on or below the x-axis. They may be expressed in terms of the Narayana generating function E(x, y) as follows

+ X X n v(p) Lv (x, s) = x s = E(x, s) n p∈P(n,1,0,+)

− X X n v(p) Lv (x, t) = x t = tE(x, t). n p∈P(n,1,0,−)

After the first up step we cut Gv each time it crosses height 1. Since the path Gv ends with a down step, it ends with a positive path at height 1 and Gv will have alternating positive and negative parts after the first up step. So we can write any path Gv in the form

+ − + − + − + Gv = Ugv∗g1 g1 g2 g2 ··· gk gk

− + where each gi is a nonempty negative path at height 1 and each gi is a nonempty + positive path at height 1 for 0 ≤ i ≤ k and gv∗ is the first positive path at height 1 ∗ + that can be empty. The generating function of gv is 1 + Lv (x, s). If we denote by

Lv(x, s, t) the generating function for all such paths Gv according to the semi-length and number of valleys with weight s on the valleys that lie above the x-axis and

46 CHAPTER 4. GENERATING FUNCTIONS

Figure 4.4. Valleys on or below the x-axis

weight t on the valleys that lie on or below the x-axis, then we can write

1 + Lv(x, s, t) = + − (1 + Lv (x, s)) 1 − Lv (x, s)Lv (x, t) 1 + E(x, s) = 1 − tE(x, s)E(x, t) sE(x, s) − tE(x, t) = 1 + by (4.3.4) s − t X = 1 + N(n, m)xn(sm−1 + sm−2t + ··· + tm−1). 1≤m≤n

n i j So we see that the coefficient of x s t in the expansion of Lp(x, s, t) is given by the 1 n n−1 Narayana number k k−1 k−1 .

(3) For the third part of the theorem we would like to count the paths Hdr ∈ P(n, 1, 1) for n > 1 that start with an up step and end with an up step with respect to the double rises on or below the x-axis. Since for each Dyck path the total number of peaks and double rises is equal to n, it is easy to find the generating function of the positive and negative paths with respect to double rises using (4.3.6) and the fact that double rises in positive and negative paths have the same distribution. We take

+ − Ldr(x, s) and Ldr(x, t) to be the generating functions of the positive paths and the 47 CHAPTER 4. GENERATING FUNCTIONS

negative paths in P(n, 1, 0) according to double rises. Therefore

+ X X n dr(p) + −1 Ldr(x, s) = x s = Lpk(xs, s ) = E(x, s) n p∈P(n,1,0,+)

− X X n dr(p) Ldr(x, t) = x t = E(x, t) n p∈P(n,1,0,−)

where dr(p) is the number of double rises of p.

If we decompose Hdr into positive and negative parts we see that whenever the path transitions from negative to positive we get an additional double rise that lies on the x-axis and if the last negative part of the path is not empty we get another

double rise at the end. So we can write Hdr in the form

+ − + − + − + − Hdr = hb (h1 h1 h2 h2 ··· hk hk )hf U

− + where each hi is a nonempty negative path and each hi is a nonempty positive path + − for 0 ≤ i ≤ k, hb is the initial nonempty positive part of the path and hf is the last − − negative path that can be empty. The generating function of hf is 1 + tLdr(x, t).

Figure 4.5. Double-rises on or below the x-axis

Therefore taking Ldr(x, s, t) to be the generating function for all such paths ac- cording to the semi-length and number of double rises with weight s on the double rises that lie above the x-axis and weight t on the double rises that lie on or below

48 CHAPTER 4. GENERATING FUNCTIONS

the x-axis, we have

+ 1 − Ldr(x, s, t) = Ldr(x, s) + − (1 + tLdr(x, t)) 1 − Ldr(x, s)Ldr(x, t)t E(x, s)(1 + tE(x, t)) = 1 − tE(x, s)E(x, t) sE(x, s) − tE(x, t) = by (4.3.4) s − t X = N(n, m)xn(sm−1 + sm−2t + ··· + tm−1). 1≤m≤n

n i j So we see that the coefficient of x s t in the expansion of Ldr(x, s, t) is given by the 1 nn−1 Narayana number n−k+1 k k−1 .

(4) The fourth part of the theorem is the same as the third part where paths start and end with a down step instead and are counted according to double falls. Since the number of double rises and the number of double falls in any path have the same distribution they have the same generating function

+ X X n df(p) Ldf (x, s) = x s = E(x, s) n p∈P(n,1,0,+)

− X X n df(p) Ldf (x, t) = x t = E(x, t) n T ∈P(n,1,0,−) where df(p) is the number of double falls of p. Similar to part three, note that whenever the path transitions from positive to negative we get an additional double fall that lies on the x-axis. These paths have the form

− + − + − + − + Hdf = hb (h1 h1 h2 h2 ··· hk hk )hf (4.3.7)

− + where each hi is a nonempty negative path and each hi is a nonempty positive − + path for 0 ≤ i ≤ k, hb is the initial nonempty negative part of the path and hf

49 CHAPTER 4. GENERATING FUNCTIONS

+ is the final positive path that ends at height 1. The generating function of hf is + + + (1 + Ldf (x, t))Ldf (x, t) since hf consists of an initial possibly empty positive path followed by an up step followed by a nonempty positive path.

Figure 4.6. Double-falls on or below the x-axis

Therefore taking Ldf (x, s, t) to be the generating function for all such paths ac- cording to the semi-length and number of double falls with weight s on the double falls that lie above the x-axis and weight t on the double falls that lie on or below the x-axis, we have

− 1 + + Ldf (x, s, t) = Ldf (x, t) + − (1 + Ldf (x, t))Ldf (x, t) 1 − tLdf (x, s)Ldf (x, t) E(x, t)(1 + E(x, s))E(x, s) = 1 − tE(x, t)E(x, s) E(x, s) − E(x, t) = by (4.3.5) s − t X = N(n, m)xn(sm−2 + sm−1t + ··· + tm−2). 1

n i j So we see that the coefficient of x s t in the expansion of Ldf (x, s, t) is given by the 1 n n−1 Narayana number n−k k−1 k . The proofs of the fifth and sixth parts of the theorem are similar, so we leave them

to the reader. 

50 CHAPTER 4. GENERATING FUNCTIONS

4.4. Up steps in even positions

There is another well-known combinatorial interpretation of the Narayana num- bers given by the following theorem. This was one of the first Narayana statistics observed [27]. We’ll give a generalized Chung-Feller theorem that corresponds to this interpretation. D. Callan in [9] used a similar approach to give a combinatorial j kn  interpretation of the formula n n+j . Let us consider paths in P(n − 1, 1, 2), i.e., paths that end at height two, accord- ing to the number of up steps that start in even positions, where the positions are 0, 1,..., 2n − 1. We define an even up step to be an up step that starts in an even position and an odd up step to be an up step that starts in an odd position.

Theorem 4.4.1.

(1) For k > 1, the number of paths in P(n − 1, 1, 2) with k − 1 even down steps that start with a down step with exactly j even down steps on or below the x-axis is independent of j, j = 1, . . . , k − 1, and is given by the Narayana

1 nn−1 number N(n, k) = k−1 k k−2 . (2) The number of paths in P(n − 1, 1, 2) with k even up steps that start with an up step with exactly j even up steps on or below the x-axis is independent of

1 n−1 n  j, j = 1, . . . , k, and is given by the Narayana number N(n, k) = k k−1 k−1 .

Proof. We’ll prove the first part of the theorem and leave the second to the reader as the proof is similar. Any path in P(n − 1, 1, 2) has n + 1 up steps and n − 1 down steps and a total of 2n positions (n odd and n even) for the steps. Here we only consider the paths in P(n − 1, 1, 2) that start with a down step with exactly k − 1 even down steps.

51 CHAPTER 4. GENERATING FUNCTIONS

Since the paths start with a down step, we have k − 2 down steps to place in n − 1 n−1 even positions. There are k−2 ways k − 2 down steps can be even down steps, and n  n the remaining n−k down steps can be assigned to odd positions in n−k = k ways. nn−1 So in total there are k k−2 paths in P(n − 1, 1, 2) that start with a down step with k − 1 even down steps. Any path p of this form in P(n − 1, 1, 2) has k − 1 conjugates that start with even down steps. Theorem 2.2.1 only deals with paths that end at height 1 therefore we cannot apply Theorem 2.2.1 here directly. But we can convert these paths into 2-colored free Motzkin paths to apply Theorem 2.2.1. A 2-colored free Motzkin path is a path with four types of steps, up, down, solid flat and dashed flat as shown in the Figure 4.7. We can convert paths in P(n − 1, 1, 2) into 2-colored free Motzkin paths by taking two steps at a time and converting the UUs to U, DDs to D, UDs to dashed flat steps and DUs to solid flat steps. This bijection was given in [17]. Since we start with a path that ends at height 2 the bijection will give us a 2- colored free Motzkin path that ends at height 1 with k − 1 down and solid flat steps. If we take the initial vertices of the down steps and the solid flat steps of the 2-colored free Motzkin paths as our special vertices then according to Theorem 2.2.1, out of the k − 1 conjugates of a 2-colored free Motzkin path that start with a down or a solid flat step there is only one conjugate having j down or solid flat steps on or below the x-axis for j = 1, . . . , k − 1. In terms of a path p in P(n − 1, 1, 2) that starts with a down step with k − 1 even down steps this means that there is one conjugate of p having j even down steps on or below the x-axis for j = 1, . . . , k − 1. Therefore the number of paths in P(n − 1, 1, 2) that start with a down step having exactly k − 1

1 n−1n even down steps with j even down steps on or below the x-axis is k−1 k−2 k . 

52 CHAPTER 4. GENERATING FUNCTIONS

a

b

Figure 4.7. Down steps in even positions: (a) A path in P(n−1, 1, 2) and (b) a 2-colored free Motzkin path of length 9.

Note that if we take j = 1 in Theorem 4.4.1(2) then the path will lie above the x-axis except at the beginning. So if we remove the last up step and add a down step at the end we’ll get a Dyck path of semi-length n. So the number of Dyck paths of semi-length n with k even up steps is N(n, k). Generating function proof: We can also prove Theorem 4.4.1 using generating func- tions: We want to count paths in P(n − 1, 1, 2) according to even down steps lying on or below the x-axis.We can decompose each path into positive and negative paths. To find the generating function for the positive paths we first consider the positive prime paths. We weight the even down steps by s and the odd down steps by t.A positive prime path does not return to the x-axis untill the end. So it starts with an up step followed by a positive path and ends with a down step. Let

X X M(x, s, t) = se(p)to(p)xn n p∈P(n,1,0,+)

53 CHAPTER 4. GENERATING FUNCTIONS

and X X M +(x, s, t) = se(p)to(p)xn n p∈P(n,1,0,+) be the generating functions for positive paths and positive prime paths respectively where n is the semi-length, e(p) is the number of even down steps and o(p) is the number of odd down steps. So the positive prime paths have the generating function

M +(x, s, t) = xtM(x, t, s) (4.4.1) and the generating function for the positive paths is

1 M(x, s, t) = 1 − M +(x, s, t) 1 = 1 − xtM(x, t, s) 1 = . (4.4.2) xt 1 − 1 − xsM(x, s, t)

Solving for M(x, s, t) gives us

1 − tx − sx − p(1 − tx + sx)2 − 4sx M(x, s, t) = 1 + (4.4.3) 2sx

Note that M(x, 1, s) = 1 + E(x, s) (4.4.4) M(x, t, 1) = 1 + tE(x, t) and E(x, y) = xM(x, y, 1)M(x, 1, y).

We would like to consider the even down steps starting on or below the x-axis. So we weight the even down steps starting above the x-axis by a and the even down steps starting on or below the x-axis by b. With these weights the generating functions for

54 CHAPTER 4. GENERATING FUNCTIONS the positive primes and negative primes can be written using M(x, s, t) by

MP+(x, a, b) = xM(x, 1, a)

MP−(x, a, b) = bxM(x, b, 1).

We can write any path p ∈ P(n − 1, 1, 2) that starts with a down step in the form

p = n0(p1q1 ··· pnqn)p∗,

where n0 is the first nonempty negative path, each pi is a nonempty positive path and each qi is a nonempty negative path, and p∗ is the last positive path that ends at height 2. These have the generating functions

MP+(x, a, b) M +(x, a, b) = 1 − MP+(x, a, b) MP−(x, a, b) M −(x, a, b) = 1 − MP−(x, a, b)

M ∗(x, a, b) = xM(x, 1, a)M(x, a, 1)(1 + M +(x, a, b)).

So we can write the generating function (denoted by G(x, a, b)) for the paths p in P(n, 1, 2) that start with a down step as

1 G(x, a, b) = M −(x, a, b) M ∗(x, a, b) 1 − M +(x, a, b)M −(x, a, b) bx2M(x, b, 1)M(x, a, 1)M(x, 1, a) = 1 − xM(x, 1, a) − bxM(x, b, 1)

55 CHAPTER 4. GENERATING FUNCTIONS

Using (4.4.4) and the identity (4.3.5) we can write G(x, a, b) as

b(E(x, a) − E(x, b)) G(x, a, b) = a − b X = b N(n + 1, k + 1)xn+1(ak−1 + ak−2b + ··· + bk−1) (4.4.5) 1≤k≤n X = b N(n, k)xn(ak−2 + ak−3b + ··· + bk−2). 2≤k≤n−1

Making use of (4.3.2) and the definition of E(x, y) we find that the coefficient of xnak−1−jbj, for j = 1, . . . , k−1 in the expansion of G(x, a, b) in (4.4.5) is the Narayana

1 n−1n number k−1 k−2 k .

56 CHAPTER 5

Chung-Feller theorems for generalized paths

In this section we’ll consider paths in P(n, r, h) that go up by one and down by any amount r > 1 ending at height h. We’ll use one of the most famous and powerful tools in called the Lagrange inversion [22, 23] method to derive some of the generalized formulas.

P∞ n Lemma. (Lagrange Inversion) Let g(u) = n=0 gnu , where gn are indetermi-

nates, and let f(x) be the formal power series in gn defined by

f(x) = xg(f(x)).

Then, for k > 0, ∞ X k f k(x) = un−k g(u)n. n n=1 If φ(t) is a formal Laurent series then another variation of this formula gives

[xn] φ(f) = [un] (1 − ug0(u)/g(u))φ(u)g(u)n.

Here [xn] φ(f) denotes the coefficient of xn in φ(f). The above formula is of great importance in enumeration since many counting problems lead to equations of the form f(x) = xg(f(x)).

57 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

5.1. Versions of generalized Catalan number formula 1

Let fh(x) be the generating function for paths in P(n, r, h, +) that stay strictly above the x-axis where each up step has weight 1 and each down step has weight x. We can uniquely decompose any path in P(n, r, h, +) into h consecutive parts where

a b c x d x x e x x

x x

Figure 5.1. A path in P(7, 2, 6, +) decomposed into parts a, b, c, d, e each part is a path in P(n, r, 1, +). As shown in the figure we look at the first part of the path that returns to height 1 for the last time and remove it. This part (denoted by a in the figure) of the path is in P(n, r, 1, +). Then we remove the next part (part b) that ends at height 2 and so on. This is possible because the rightmost vertex at each level l ≤ r must be a vertex of the path, i.e., either the endpoint of an up step or the endpoint of a down step. Otherwise it would have to be in the middle of a down step, but then the path ends at height h ≥ l so it would have to return later to this

h h height. Therefore the generating function can be written as fh(x) = f1 (x) = f (x),

where f(x) = f1(x) is the generating function for paths in P(n, r, 1, +). Now let us consider the paths in P(n, r, 1, +). If a path in P(n, r, 1, +) does not have a down step then it consists of a single up step. Otherwise it ends with a down step and if we remove the last down step we get a path that ends at height r + 1. So we get the functional equation

f(x) = 1 + xf r+1(x). (5.1.1)

58 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

To solve this by Lagrange inversion we can put in a new redundent variable z and solve the equation f(x, z) = z(1 + xf r+1(x, z))

and then set z = 1 to get

∞ X h f h(x) = [tm−h](1 + xtr+1)m m m=h ∞ X h X m = [tm−h] xnt(r+1)n (5.1.2) m n m=h n X h (r + 1)n + h = xn, taking m = (r + 1)n + h. (r + 1)n + h n n

The coefficients are known as r-ballot numbers. In particular we have

∞ X r n f(x) = Cnx (5.1.3) n=0

r where we define Cn by

1 (r + 1)n + 1 Cr = . n (r + 1)n + 1 n

r Notice that for r = 1 the coefficients reduce to Catalan numbers. The numbers Cn are called generalized Catalan numbers or order r + 1 Fuss-Catalan numbers [3, 36]. These numbers were first studied by N. I. Fuss in 1791. They also arise in counting rooted plane trees with rn + 1 leaves in which every non-leaf vertex has exactly r + 1 children. By “plane tree”, we mean that the left-to-right order of children

n matters. Hilton and Pedersen [25] observed that Cr counts the subdivisions of a convex polygon into n disjoint (r + 1)-gons by noncrossing diagonals.

59 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

These numbers can also be written in three different ways like the Catalan numbers as follows

1 (r + 1)n + 1 1 (r + 1)n 1 (r + 1)n = = . (r + 1)n + 1 n n n − 1 rn + 1 n

Similar to the Catalan numbers we can give a nice combinatorial interpretation of these three formulas as follows:

Theorem 5.1.1.

(1) The number of paths in P(n, r, 1) that start with an up step with exactly k up steps starting on or below the x-axis for k = 1, 2, . . . , rn + 1 is given by

1 (r+1)n rn+1 n . (2) The number of paths in P(n, r, 1) that start with a down step with exactly k down steps that start on or below the x-axis for k = 1, 2, . . . , n is given by

1 (r+1)n n n−1 . (3) The number of paths in P(n, r, 1) with exactly k vertices on or below the

1 (r+1)n+1 x-axis for k = 1, 2,..., (r + 1)n + 1 is given by (r+1)n+1 n .

Proof. Here we can apply Theorem 2.2.1 again to prove the above statements. Let p be any path in P(n, r, 1). To prove (1) we take the initial vertices of the up steps of p as our special vertices. Since there are rn + 1 up steps, p has rn + 1 conjugates that start with an up step. By Theorem 2.2.1 there is exactly one conjugate of p with exactly k up steps starting on or below the x-axis and we know that the number of paths in P(n, r, 1) that start with an up step is given by the binomial coefficient (r+1)n n . Therefore the number of paths starting with an up step and having k up 1 (r+1)n steps on or below the x-axis is given by rn+1 n . The proofs of parts two and three follow similarly, taking the initial vertices of the down steps as special vertices

and all vertices as special vertices, respectively.  60 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

It is noteworthy to mention here the following corollary which is the classical analogue of the generalized version of the Chung-Feller theorem.

Corollary 5.1.2. The number of paths in P(n, r, 0), with exactly k up steps below

1 (r+1)n the x-axis is independent of k for k = 0, 1, 2, . . . , rn and is given by rn+1 n .

Proof. The technique used to prove the classical version applies here too. If we remove the first up step of the paths in Theorem 5.1.1(1) and shift them down one level then the up steps on or below the x-axis becomes up steps below the x-axis and

we have paths in P(n, r, 0) that satisfy the corollary. 

61 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

5.2. The generating function approach

We can also prove Theorem 5.1.1 using generating functions. In this section we’ll give a sketch of the proof of Theorem 5.1.1(1) and 5.1.1(2) and omit the proof of 5.1.1(3). Let t be the weight on the up steps. Then the generating function for paths in P(n, r, 0, +) has the form ∞ X r n rn Cg(y, t) = Cny t . (5.2.1) n=0 So

r Cg(y, t) = f(yt ).

Since we are interested in up steps that start on or below the x-axis we weight them by s and the up steps that start above the x-axis will have weight t. We also distinguish between the down steps that start on or below the x-axis (weighted by x) and the down steps that start above the x-axis (weighted by y). It is not hard to show that any path in P(n, r, 0) can be uniquely factored into three different types of primes by looking at each time they return to the x-axis, as shown in Figure 5.2. Let us consider positive prime paths in P(n, r, 0), i.e., paths that stay above the x-axis and do not return to the x-axis till the end. If we remove the last down step from one of these prime paths we get a path in P(n, r, r, +) that stay strictly above the x-axis. Therefore the generating function of the positive prime paths in P(n, r, 0) is

r−1 Fp = ysCg(y, t)(tCg(y, t)) . (5.2.2)

Similarly the generating function of the negative prime paths in P(n, r, 0) is

r Fn = x(sCg(x, s)) . (5.2.3)

62 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

We also have another type of prime path in P(n, r, 0) that contains a down step that

cross the x-axis and is of the form pr−iDqi for i = 1, . . . , r − 1 where pr−i is a strictly

a b c

Figure 5.2. Primes in P(n, 2, 0). (a) A positive prime, (b) a negative prime, and (c) a mixed prime.

positive path in P(n, r, r − i, +) that starts on the x-axis and end at height r − i, D is

a down step and qi is a strictly negative path that start from height −i and touches the x-axis at the end. These differ from the positive and negative primes because of the down step D that crosses the x-axis. We call these mixed primes. The mixed primes have the generating function

r−1 X r−1−i i Fm = sCg(y, t)(tCg(y, t)) y(sCg(x, s)) . (5.2.4) i=1

Note that we can combine the generating function of the positive primes and the mixed primes in to one formula as

r−1 X r−1−i i Fp+m = sCg(y, t)(tCg(y, t)) y(sCg(x, s)) (5.2.5) i=0

and the functional equation for f(xsr) is

sf(xsr) = s + xsr+1f r+1(xsr).

63 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

Which in terms of Cg(x, s) is

r+1 sCg(x, s) = s + x(sCg(x, s)) .

Using the generating function of the primes we express the generating function

for the paths in P(n, r, 0) (denoted by G0(x, s, y, t)) as

1 G0(x, s, y, t) = . (5.2.6) 1 − Fn − Fp+m

Since any path in P(n, r, 1) can be uniquely decomposed into two parts where the first part is a path in P(n, r, 0) and the last part is a path in P(n, r, 1, +) using (5.2.6) we can write the generating function for the paths in P(n, r, 1) (denoted by G1(x, s, y, t)) as

sCg(y, t) G1(x, s, y, t) = . (5.2.7) 1 − Fn − Fp+m If we consider the paths in P(n, r, 1) that start with a down step they must start with a negative prime. Therefore the generating function is

sCg(y, t)Fn G1D(x, s, y, t) = FnG1(x, s, y, t) = . (5.2.8) 1 − Fn − Fp+m

On the other hand the paths in P(n, r, 1) that start with an up step must start with a positive prime or a mixed prime. Therefore the generating function is

(1 − Fn)sCg(y, t) G1U (x, s, y, t) = G1(x, s, y, t) − FnG1(x, s, y, t) = . (5.2.9) 1 − Fn − Fp+m

To show that the coefficient of (5.2.8), (5.2.9) are the generalized Catalan numbers we need the following identities which are easy to prove.

64 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

∞ rn X X tCg(1, t) − sCg(1, s) Cr tisrn−i = n t − s n=0 i=0 (5.2.10) ∞ n X X Cg(x, 1) − Cg(y, 1) Cr xiyn−i = n+1 x − y n=0 i=0 The following relations are equivalent to Theorem 5.1.1(1) and 5.1.1(2).

∞ rn X r X i+1 rn−i G1U (1, s, 1, t) = Cn s t n=0 i=0 (5.2.11) ∞ n X r X i+1 n−i G1D(x, 1, y, 1) = Cn+1 x y . n=0 i=0

Similar to the proof of Theorem 4.1.1 we can algebraically show the following results

(1 − F )sC (1, t) (1 − (sC (1, s))r)sC (1, t) n g = g g 1 − F − F r Pr−1 r−1−i i n p+m 1 − (sCg(1, s)) − i=0 sCg(1, t)(tCg(1, t)) (sCg(1, s)) tC (1, tr) − sC (1, sr) = s g g t − s (5.2.12) and C (y, 1)F C (y, 1)x(C (x, 1))r g n = g g 1 − F − F r Pr−1 r−1−i i n p+m 1 − x(Cg(x, 1) − i=0 Cg(y, 1)(Cg(y, 1)) y(Cg(x, 1)) C (x, 1) − C (y, 1) = x g g . x − y (5.2.13)

i+1 rn−i Therefore the coefficient of t s in G1U is independent of i for 0 ≤ i ≤ rn

r 1 (r+1)n j+1 n−j and is Cn = rn+1 n and the coefficient of x y in G1D is independent of j r 1 rn  for 0 ≤ j ≤ n and is Cn = n n−1 respectively.

65 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

5.3. Versions of generalized Catalan number formula 2

In this section we show another way to generalize the Catalan number formula. If we consider the up steps to have weight 1 and the down steps to have weight x then xf r(x) is the generating function of the positive primes in P(n, r, 0). It is interesting to see that the generating function xf r(x) can be expressed in a different way by rewriting (5.1.1) as xf r(x) = 1 − f −1(x).

Then the Lagrange inversion formula gives

∞ X −1 (r + 1)n − 1 f −1(x) = xn (r + 1)n − 1 n n=0 ∞ X 1 (r + 1)n − 1 = 1 − xn (r + 1)n − 1 n n=1

So we get ∞ X 1 (r + 1)n − 1 xf r(x) = xn. (r + 1)n − 1 n n=1 Note that for r = 1 the coefficients are just the Catalan numbers. But for r > 1, these are not the same as the coefficients in (5.1.3). These numbers can also be written in three different forms as follows:

1 (r + 1)n − 1 1 (r + 1)n − 2 1 (r + 1)n − 2 = = . (r + 1)n − 1 n n n − 1 rn − 1 n

Given such a prime path if we remove the first step (an up step) and shift the path down one level then we have a path that starts at the origin and ends at height −1, i.e., paths in P(n, r, −1). Each of these paths has rn − 1 up steps and n down steps. So we can use the cycle method to get the following Chung-Feller theorems for them.

66 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

Theorem 5.3.1.

(1) The number of paths in P(n, r, −1) that start with an up step with exactly k up steps starting on or above the x-axis for k = 1, 2, . . . , rn − 1 is given by

1 (r+1)n−2 rn−1 n . (2) The number of paths in P(n, r, −1) that start with a down step with exactly k down steps that start on or above the x-axis for k = 1, 2, . . . , n is given by

1 (r+1)n−2 n n−1 . (3) The number of paths in P(n, r, −1) with exactly k vertices on or above the

1 (r+1)n−1 x-axis for k = 1, 2,..., (r + 1)n − 1 is given by (r+1)n−1 n .

Proof. If we reflect the paths in P(n, r, −1) about the x-axis we get paths start- ing at the origin and ending at height 1 with steps that go up by r and down by 1, i.e. paths with step set {(1, r), (1, −1)}. Let us denote the set of such paths by P∗(n, r, 1). Now the above statements can be restated as

(1) The number of paths in P∗(n, r, 1) that start with a down step with exactly k down steps that start on or below the x-axis for k = 1, 2, . . . , rn − 1 is

1 (r+1)n−2 given by rn−1 n . (2) The number of paths in P∗(n, r, 1) that start with an up step with exactly k up steps starting on or below the x-axis for k = 1, 2, . . . , n is given by

1 (r+1)n−2 n n−1 . (3) The number of paths in P∗(n, r, 1) with exactly k vertices on or below the

1 (r+1)n−1 x-axis for k = 1, 2,..., (r + 1)n − 1 is given by (r+1)n−1 n .

So the proof also follows from Theorem 2.2.1 with the same reasoning as the proof of

Theorem 5.1.1.  67 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

In the next two section we’ll consider two types of generalization of the Narayana numbers. The classical Narayana numbers are represented as a product of two bi- nomial coefficients. Considering paths in P(n, r, h) we can generalize them either as a product of two binomial coefficients or as a product of r + 1 binomial coefficients. We’ll consider the former one in the next setion and the later in section 5.5. We’ll give combinatorial interpretation of both generalizations.

68 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

5.4. Peaks and valleys

It is natural to ask how many paths are there in P(n, r, h) with a given number of peaks and valleys. To do that first we look at non-negative paths in P(n, r, 0), i.e. paths that stay weakly above the x-axis. Let F be the generating function for the non-negative paths in P(n, r, 0) with weight x on the down steps and weight t on the peaks defined by X F = xntpk n where pk stands for number of peaks. If P is the generating function for the primes then we can write F in terms of P as

1 F = . (5.4.1) 1 − P

Now the total number of peaks in such a path is the sum of the peaks of its primes. Let p be such a prime path. So we decompose p in the following way: Since p does not return to the x-axis till the end we look at the last time it leaves height one, height two, and so on. The first part of the path consists of an up step followed by a positive path, the second part of the path consists of an up step followed by another positive path, . . . , and the last part consists of a path that starts with an up step and ends at height r − 1 followed by a down step. So the prime p can be factored as

p = Up1Up2 ··· UprD

where pi is a positive path in P(ni, r, 0) for some ni. The number of peaks of p is the

sum of the number of peaks of the pi’s plus one more if pr is empty. So we can write the generating function of the primes as

P = xF r−1(F − 1 + t)

69 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

Figure 5.3. A prime path for r = 3

which together with (5.4.1) gives the functional equation

F = 1 + xF r(F − 1 + t).

G Setting F = 1 + G and replacing P by 1+G we get

G = x(1 + G)r(t + G).

Applying the second form of the Lagrange inversion given at the beginning of this chapter and taking φ(G) = 1 + G and g(u) = (1 + u)r(t + u) we get

X  u((1 + u)r(t + u))0  F = 1 + G = [un] 1 − (1 + u)((1 + u)r(t + u))nxn (1 + u)r(t + u) n X 1 rnn − 1 = tkxn. rn − k + 1 k k − 1 n,k

1 rnn−1 We denote these coefficients by Nr(n, k) = rn−k+1 k k−1 . Note that N1(n, k) gives us our familiar Narayana numbers. We also find that these coefficients can be written in five different forms as

1  rn n 1 rnn − 1 N (n, k) = = r n k − 1 k rn − k + 1 k k − 1 1 rn n − 1 1 rn + 1n − 1 = = k k − 1 k − 1 rn + 1 k k − 1

70 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

1  rn n − 1 = . n − k k − 1 k

r Note that just like the relation (4.3.1) Nr(n, k) and Cn are also related by the equation

n X 1  rn n 1 (r + 1)n = . n k − 1 k rn + 1 n k=1

As a generalization of Theorem 2.5.2 we can use the cycle method to give a combi- natorial interpretation of each of these forms as well.

Theorem 5.4.1.

(1) The number of paths in P(n, r, 1) with k − 1 peaks that start with a down step and end with an up step with exactly j peaks on or below the x-axis for

1 rn n−1 j = 0, 1, 2, . . . , k − 1 is given by k k−1 k−1 . (2) The number of paths in P(n, r, 1) with k − 1 valleys that start with an up step and end with a down step with exactly j valleys on or below the x-axis

1 rn n−1 for j = 0, 1, 2, . . . , k − 1 is given by k k−1 k−1 . (3) The number of paths in P(n, r, 1) with n − k double rises that start with an up step and end with an up step with exactly j double rises on or below the

1 rnn−1 x-axis for j = 0, 1, 2, . . . , rn − k is given by rn−k+1 k k−1 . (4) The number of paths in P(n, r, 1) with n − k − 1 double falls that start with a down step and end with a down step with exactly j double falls on or below

1 rn n−1 the x-axis for j = 0, 1, 2, . . . , n − k − 1 is given by n−k k−1 k . (5) The number of paths in P(n, r, 1) with k peaks that start with an up step with exactly j up steps on or below the x-axis for j = 1, 2, . . . , rn + 1 is given by

1 rn+1n−1 rn+1 k k−1 . 71 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

(6) The number of paths in P(n, r, 1) with k valleys that start with a down step with exactly j down steps on or below the x-axis for j = 1, 2, . . . , n is given

1 rn n by n k−1 k .

The proof is essentially same as the proof of Theorem 2.5.2 and uses similar arguments. Therefore we leave it to the reader.

72 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

5.5. A generalized Narayana number formula

Next we’ll look at generalizations of the Narayana numbers for paths in P(n − 1, r, r+1). The interpretation we have found so far of the Narayana numbers in terms of Dyck paths is keeping track of up steps in even positions. In this section we are going to generalize this interpretation for paths in P(n − 1, r, r + 1). The simplest way to approach this is to weight an up step in a position congruent

to i modulo r + 1 by αi, i ≥ 0. To do this we take the steps r + 1 at a time, i.e., we replace the original set of two steps (up by 1 and down by r) with a new set of 2r+1 steps that correspond to all possible paths made of r + 1 of the original steps. Note that each new step goes up (or down) by a multiple of r + 1. Now let us define a generating function for these new steps to be

X F = w(σ)td(σ), σ∈S

where S is the set of 2r+1 new steps, w(σ) is the weight of σ (defined in terms of the original up steps comprising σ, where an up step in a position congruent to i modulo

1 r + 1 has weight αi) and d(σ) is r+1 times the distance down that the new step goes. A new step that goes up by r + 1 is interpreted as going down by −(r + 1). It is not hard to see that this generating function can be written as

−1 F = t (α0 + t)(α1 + t) ··· (αr + t). (5.5.1)

For example, when r = 1 the 22 = 4 new steps are shown in Figure 5.4. To find a generating function for these paths we consider a more general situa- tion. Suppose we want to count paths with steps that go up by 1 or down by any nonnegative integer. We weight a step that goes down by i with the weight wi+1,

P i where we think of an up step as a step that goes down by −1. Let W (t) = i=0 wit .

73 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

α1

-1 α0α1t α0 t

Figure 5.4. Step set for r = 1

Let F be the generating function for paths that stay strictly above the x-axis and end at height r + 1. Then the generating function for strictly positive paths that end at height h(r + 1) is F h (including h = 0) and by removing the last step of a path counted by F , we see that F satisfies F = W (F ). Returning to our original problem, we see that the generating function F for paths weighted according to the positions modulo r + 1 of the up steps satisfies

F = (α0 + F )(α1 + F ) ··· (αr + F ), (5.5.2)

Applying Lagrange inversion to (5.5.2) we get

    h X X h n n n0 n1 nr F = ··· α0 α1 . . . αr . n n0 nr n n0+···+nr=(n−1)r+h(r+1)

So for h = 1 we get

    X X 1 n n n0 n1 nr F = ··· α0 α1 . . . αr . n n0 nr n n0+···+nr=nr+1

r 1 n  n  We denote these coefficient by N (n, n0, n1, . . . , nr) = ··· , where n0 + n n0 nr 1 1 n  n  ··· + nr = nr + 1. Consider the case r = 1. Then N (n, n0, n1) = = n n0 n1 1 n  n  is our well known Narayana number. We have given a combinatorial n n0 n0−1 1 interpretation for the number N (n, n0, n1) in Theorem 4.4.1. Here we state a gener- alization of Theorem 4.4.1 using congruence.

74 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

Theorem 5.5.1.

(1) The number of paths in P(n − 1, r, r + 1) that start with a down step having

exactly ni − 1 down steps starting at positions congruent to i (mod r + 1) for each i = 0, . . . , r, with j down steps starting at positions congruent to 0

(mod r+1) on or below the x-axis is independent of j, j = 1, . . . , n0 −1 and is

r 1 n−1  n  n  given by the numbers N (n, n−n0+1, . . . , n−nr+1) = ··· . n0−1 n0−2 n1−1 nr−1 (2) The number of paths in P(n − 1, r, r + 1) that start with an up step having

exactly ni up steps starting at positions congruent to i (mod r + 1) for each i = 0, . . . , r, with j up steps starting at positions congruent to 0 (mod r + 1)

on or below the x-axis is independent of j, j = 1, . . . , n0 and is given by the

r 1 n−1  n  n  numbers N (n, n0, . . . , nr) = ··· . n0 n0−1 n1 nr

Proof. We’ll prove Theorem 5.5.1(2) using the cycle method. Consider paths in P(n−1, r, r+1). They have nr+1 up steps and n−1 down steps, so a total of n(r+1) steps. There are n positions congruent to i modulo r + 1 for each i = 0, . . . , r. So n−1  n  n  there are ··· paths in P(n − 1, r, r + 1) having ni up steps at positions n0−1 n1 nr congruent to i modulo r + 1 that start with an up step. Each such path has n0 conjugates that start with an up step at positions that are a multiple of r + 1. To apply our cycle method we convert these paths to r + 1 colored free Motzkin paths by taking r + 1 steps at a time, where an r + 1 colored free Motzkin path is a path that lie in the half plane Z≥0 × Z having unit up steps (1, 1), unit down steps (1, −1), and r + 1 different colored unit flat steps. The resulting r + 1 colored free Motzkin paths will end at height 1. Therefore as in the proof of Theorem 4.4.1, we can deduce that the total number of paths in P(n − 1, r, r + 1) that start with an up step having exactly ni up steps

75 CHAPTER 5. CHUNG-FELLER THEOREMS FOR GENERALIZED PATHS

starting at positions congruent to i (mod r+1) with j up steps on or below the x-axis is 1 n−1  n  ··· n . n0 n0−1 n1 nr Similarly we get the result of Theorem 5.5.1(1) by considering paths in P(n −

1, r, r+1) that start with a down step having ni −1 down steps at positions congruent Pr to i modulo r + 1, where i=0(ni − 1) = n − 1. 

Note that when r = 1 in Theorem 5.5.1(1), the number of paths in P(n − 1, 1, 2)

that start with a down step having exactly ni − 1 down steps starting at positions congruent to i (mod r +1) for i = 0, 1, with j down steps congruent to 0 (mod r +1) on or below the x-axis is 1 n−1  n . Since the total number of down step is n0−1 n0−2 n1−1

n0 − 1 + n1 − 1 = n − 1, we have n1 = n − n0 + 1, So the total number of paths is

1 1 n−1  n  1 n−1  n  N (n, n − n0 + 1, n − n1 + 1) = = , which is exactly n0−1 n0−2 n1−1 n0−1 n0−2 n0 what we had in Theorem 4.4.1(1).

76 Bibliography

[1] Aguiar, M., and Moreira, W. Combinatorics of the free Baxter algebra. Electron. J. Com- bin. 13 (2006), R17. [2] Andersen, E. S. The equivalence principle in the theory of fluctuations of sums of random variables. Colloquium on Combinatorial Methods in Probability Theory (1962), 13–16. [3] Aval, J.-C. Multivariate Fuss-Catalan numbers. Disc. Math. 308 (2008), 4660–4669. [4] Baxter, G. Combinatorial method in fluctuation theory. Z. Wahrscheinlichkeitstheorie 1 (1963), 263–270. [5] Bernhart, F. R. Catalan, Motzkin and Riordan numbers. Disc. Math. 204 (1999), 73–112. [6] Buontempo, J., and Hopkins, B. Tableau cycling and Catalan numbers. Electron. J. Com- bin. 7 (2007), A45. [7] Callan, D. Pair them up! A visual approach to the Chung-Feller theorem. College Mathe- matics Journal 26 (1995). 1 2n 1 2n+1 1 2n  [8] Callan, D. Why is n+1 n = 2n+1 n = n n−1 . http://www.stat.wisc.edu/~callan/ notes, 2004. j kn  [9] Callan, D. A combinatorial interpretation of n n+j . http://www.citebase.org/abstract? id=oai:arXiv.org:math/0604471, 2006. [10] Chen, Y.-M. The Chung-Feller theorem revisited. Disc. Math. 308 (2008), 1328–1329. [11] Chung, K. L., and Feller, W. On fluctuations in-coin tossing. Proc. Natl. Acad. Sci. 35 (1949), 605–608. [12] Comtet, L. Advanced Combinatorics. Reidel, Boston, MA, 1974. [13] Cori, R. Words and trees. In Combinatorics on Words, M. Lothaire, Ed. Cambridge University Pres, New York, NY, 1983, pp. 215–229. [14] Dershowitz, N., and Zaks, S. The cycle lemma and some applications. Europ. J. Combi- natorics 11 (1990), 35–40. [15] Deutsch, E. Dyck path enumeration. Disc. Math. 204 (1999), 167–202. [16] Deutsch, E. A bijective proof of the equation linking the Schr¨odernumbers, large and small. Disc. Math. 241 (2001), 235–240. [17] Deutsch, E., and Shapiro, L. W. A bijection between ordered trees and 2-Motzkin paths, and its many consequences. Disc. Math. 256 (2002), 655–670. [18] Dvoretzky, A., and Motzkin, T. A problem of arrangements. Duke Math. J. 14 (1947), 305–313. [19] Eu, S.-P., Fu, T.-S., and Yeh, Y.-N. Refined Chung-Feller theorems for lattice paths. J. Combin. Theory Ser. A 112 (2005), 143–162. [20] Eu, S.-P., Liu, S.-C., and Yeh, Y.-N. Taylor expansions for Catalan and Motzkin numbers. Adv. Appl. Math. 29 (2002), 345–357. [21] Foata, D., and Schutzenberger,¨ M. P. On the principle of equivalence of Sparre Anderson. Math. Scand. 28 (1971), 308–316. [22] Gessel, I. A noncommutative generalization and q-analog of the Lagrange inversion formula. Trans. Amer. Math. Soc. 257 (1980), 455–482.

77 [23] Gessel, I. M. A combinatorial proof of the multivariable Lagrange inversion formula. J. Com- bin. Theory Ser. A 45 (1987), 178–195. [24] Gould, H. W. Catalan and Bell Numbers: Research bibliography of two special number se- quences, Mathematica Monongaliae, vol. 12. Combinatorial Research Institute, Morgantown, WV, 1977. [25] Hilton, P., and Pedersen, J. Catalan numbers, their generalization, and their uses. Math. Intelligencer 13 (1991), 64–75. [26] Jewett, R. I., and Ross, K. A. Random walks on Z. College Mathematics Journal 19 (1988). [27] Kreweras, G. Joint distributions of three descriptive parameters of bridges. In Combina- toire ´enum´erative, A. Dold and B. Eckmann, Eds., vol. 1234 of Lecture Notes in Mathematics. Springer, Berlin/Heidelberg, 1986, pp. 177–191. [28] Labelle, J., and Yeh, Y.-N. Generalized Dyck paths. Disc. Math. 82 (1990), 1–6. [29] Ma, J., and Yeh, Y.-N. Generalizations of Chung-Feller theorem ii. http://www.citebase. org/abstract?id=oai:arXiv.org:0903.0705, 2009. [30] MacMahon, P. A. Memoir on the theory of the partitions of numbers, Part IV. Philos. Trans. Roy. Soc. London Ser. A 209 (1909). [31] Mohanty, S. G. Lattice Path Counting and Applications. Academic Press, New York, NY, 1979. [32] Narayana, T. V. A partial order and its applications to probability. Sankhya 21 (1959), 91–98. [33] Narayana, T. V. Cyclic permutation of lattice paths and the Chung-Feller theorem. Skand. Aktuarietidskr. 50 (1967), 23–30. [34] Raney, G. M. Functional composition patterns and power series reversion. Trans. Am. Math. Soc. 94 (1960), 441–451. [35] Shapiro, L. W., and Sulanke, R. A. Bijections for the Schr¨odernumbers. Mathematics Magazine 73 (2000), 369–376. [36] Snevily, H. S., and West, D. B. The bricklayer problem and the strong cycle lemma. Amer. Math. Monthly 105 (1998), 131–143. [37] Stanley, R. P. Enumerative Combinatorics, vol. 2. Cambridge University Press, New York, NY, 1999. [38] Sulanke, R. A. Counting lattice paths by Narayana polynomials. Electron. J. Combin. 7 (2000), R40. [39] Sulanke, R. A. The Narayana distribution. J. Statist. Plann. Inference 101 (2002), 311–326. [40] Sulanke, R. A. Generalizing Narayana and Schr¨odernumbers to higher dimensions. Electron. J. Combin. 11 (2003), R54. [41] Woan, W.-J. Uniform partition of lattice paths and Chung-Feller generalizations. Amer. Math. Monthly 108 (2001), 556–559.

78