9
Pattern avoiding ballot paths and finite operator calculus Heinrich Niederhausen , Shaun Sullivan Department of Mathematical Sciences, Florida Atlantic University, Boca Raton, FL 33431, USA article info Available online 20 January 2010 Keywords: Pattern avoidance Ballot path Dyck path Finite operator calculus Umbral calculus abstract Counting pattern avoiding ballot paths begins with a careful analysis of the pattern. Not the length, but the characteristics of the pattern are responsible for the difficulties in finding explicit solutions. Certain features, like overlap and difference in number of - and m steps determine the solution of the recursion formula. If the recursion can be solved by a polynomial sequence, we apply the Finite Operator Calculus to find an explicit form of the solution in terms of binomial coefficients. & 2010 Elsevier B.V. All rights reserved. 1. Introduction A ballot path stays weakly above the diagonal y = x, starts at the origin and takes steps from fm; -g. A pattern is a finite string made from the same step set; it is also a path. Dyck paths are equivalent to ballot paths, taking steps from fs; rg, staying weakly above the x-axis. Dyck paths containing k strings of length 3 were discussed by Deutsch (1999). One of the most recent papers on patterns of length 4 occurring k times in Dyck paths was written by Sapounakis et al. (2007). The authors find generating functions for all 16 patterns in Dyck path returning to the x-axis. Returning to the x-axis at the end of the path has the advantage that going backwards through a path we find the reversed pattern exactly the same number of times (see Section 2). This reduces significantly the number of patterns under consideration. For easier presentation we decided to talk about ballot paths instead of Dyck paths. We will look at paths that end at any point (n, m) above or on the main diagonal. That will give us more cases to consider, because the path reversal bijection will be of no help in general. On the other hand, we will investigate pattern avoiding paths only (k =0), but we will do this for patterns of general length. We use the Finite Operator Calculus approach, as developed by Rota et al. (1973). An interpretation of this theory in view of solving recursions is given in Niederhausen (2003). The Finite Operator Calculus works with polynomials; it applies to pattern avoiding ballot paths, because for many patterns we can find a polynomial sequence whose values enumerate all possible paths. For convenience, we let u ¼ m and r ¼ -. A pattern p is a finite string of u’s and r’s. We write p 2fu; rg . Of course, avoiding the pattern p may imply avoiding a pattern that contains p twice in some overlapping form, like uruuru is contained twice in uruururuuru, but also twice in uruuruuru. This problem of overlaps makes it harder to find recursions. There are two properties of the patterns we avoid that determine the recurrence relations. Definition 1. The bifix index of a pattern p is the number of distinct nonempty patterns o different from p, such that p that can be written in the form p ¼ op 0 and p ¼ p 00 o for o; p 0 ; p 00 2fu; rg . If a pattern has bifix index 0, then we call it bifix-free. The example above, uruuru, has bifix index 2. We restrict ourselves to bifix index 0 or 1 in this paper. However, there is a notable exception; a pattern of only right steps has a high bifix index. We can avoid this pattern with a prefixed up step, Contents lists available at ScienceDirect journal homepage: www.elsevier.com/locate/jspi Journal of Statistical Planning and Inference ARTICLE IN PRESS 0378-3758/$ - see front matter & 2010 Elsevier B.V. All rights reserved. doi:10.1016/j.jspi.2010.01.026 Corresponding author. E-mail address: [email protected] (H. Niederhausen). Journal of Statistical Planning and Inference 140 (2010) 2312–2320

Pattern avoiding ballot paths and finite operator calculus

Embed Size (px)

Citation preview

Page 1: Pattern avoiding ballot paths and finite operator calculus

ARTICLE IN PRESS

Contents lists available at ScienceDirect

Journal of Statistical Planning and Inference

Journal of Statistical Planning and Inference 140 (2010) 2312–2320

0378-37

doi:10.1

� Cor

E-m

journal homepage: www.elsevier.com/locate/jspi

Pattern avoiding ballot paths and finite operator calculus

Heinrich Niederhausen �, Shaun Sullivan

Department of Mathematical Sciences, Florida Atlantic University, Boca Raton, FL 33431, USA

a r t i c l e i n f o

Available online 20 January 2010

Keywords:

Pattern avoidance

Ballot path

Dyck path

Finite operator calculus

Umbral calculus

58/$ - see front matter & 2010 Elsevier B.V. A

016/j.jspi.2010.01.026

responding author.

ail address: [email protected] (H. Niederhaus

a b s t r a c t

Counting pattern avoiding ballot paths begins with a careful analysis of the pattern. Not

the length, but the characteristics of the pattern are responsible for the difficulties in

finding explicit solutions. Certain features, like overlap and difference in number of -

and m steps determine the solution of the recursion formula. If the recursion can be

solved by a polynomial sequence, we apply the Finite Operator Calculus to find an

explicit form of the solution in terms of binomial coefficients.

& 2010 Elsevier B.V. All rights reserved.

1. Introduction

A ballot path stays weakly above the diagonal y=x, starts at the origin and takes steps from fm;-g. A pattern is a finitestring made from the same step set; it is also a path. Dyck paths are equivalent to ballot paths, taking steps from fs;rg,staying weakly above the x-axis. Dyck paths containing k strings of length 3 were discussed by Deutsch (1999). One of themost recent papers on patterns of length 4 occurring k times in Dyck paths was written by Sapounakis et al. (2007). Theauthors find generating functions for all 16 patterns in Dyck path returning to the x-axis. Returning to the x-axis at the endof the path has the advantage that going backwards through a path we find the reversed pattern exactly the same numberof times (see Section 2). This reduces significantly the number of patterns under consideration.

For easier presentation we decided to talk about ballot paths instead of Dyck paths. We will look at paths that end atany point (n, m) above or on the main diagonal. That will give us more cases to consider, because the path reversal bijectionwill be of no help in general. On the other hand, we will investigate pattern avoiding paths only (k=0), but we will do thisfor patterns of general length. We use the Finite Operator Calculus approach, as developed by Rota et al. (1973).An interpretation of this theory in view of solving recursions is given in Niederhausen (2003). The Finite Operator Calculusworks with polynomials; it applies to pattern avoiding ballot paths, because for many patterns we can find a polynomialsequence whose values enumerate all possible paths.

For convenience, we let u¼m and r¼-. A pattern p is a finite string of u’s and r’s. We write p 2 fu; rg�. Of course,avoiding the pattern p may imply avoiding a pattern that contains p twice in some overlapping form, like uruuru iscontained twice in uruururuuru, but also twice in uruuruuru. This problem of overlaps makes it harder to find recursions.There are two properties of the patterns we avoid that determine the recurrence relations.

Definition 1. The bifix index of a pattern p is the number of distinct nonempty patterns o different from p, such that p thatcan be written in the form p¼ op0 and p¼ p00o for o; p0; p00 2 fu; rg�. If a pattern has bifix index 0, then we call it bifix-free.

The example above, uruuru, has bifix index 2. We restrict ourselves to bifix index 0 or 1 in this paper. However, there is anotable exception; a pattern of only right steps has a high bifix index. We can avoid this pattern with a prefixed up step,

ll rights reserved.

en).

Page 2: Pattern avoiding ballot paths and finite operator calculus

ARTICLE IN PRESS

H. Niederhausen, S. Sullivan / Journal of Statistical Planning and Inference 140 (2010) 2312–2320 2313

which makes the prefixed pattern bifix free. Another exception is a pattern of only up steps. We will begin in Section 2 withthis case to explain our approach.

Definition 2. Let h(p) be the number of u’s minus the number of r’s in the pattern p. The depth of p ismaxfhðp0Þjp¼ qp0; q 2 fu; rg�g.

The depth is the maximum distance p goes below the line y=x when the end of p is attached to the line y=x. Notice thatsince the empty pattern e is in fp0jp¼ qp0g, the depth of a pattern is always a nonnegative integer.

If a is the number of r’s in p and c is the number of u’s, then we say p has dimensions a� c.We consider patterns of the following form:

(1)

r � � � r|fflffl{zfflffl}a times

¼: ra and uc for any a; cZ0.

(2)

Bifix-free patterns of depth 0 and dimensions a� c, with aZcZ1, and aZ2. (3) Patterns of depth 0 with bifix index 0 or 1 (with the same restrictions as above, and corresponding restriction about the

op0 piece of p¼ op0o).

(4) Patterns with depth at least 1 and bifix index 0 or 1 (with similar restrictions). (5) All patterns of length 4.

2. Lattice paths avoiding ra and uc

Definition 3. Let snðm; p; lÞ be the number of lattice paths from (0,0) to (n, m) staying weakly above the line y¼ x�l

avoiding the pattern p 2 fm;-g�.

Note that if l=0 we count pattern avoiding ballot paths. A ballot path must start with an up step; if the pattern to avoid isra, we are really avoiding ura. In other words, snðm; ra;0Þ ¼ snðm;ura;0Þ. This means that the bifix-rich pattern ra can bereplaced by the bifix-free pattern ura. We lose this property if l40. However, the recursion

snðm; ra; lÞ ¼ sn�1ðm; r

a; lÞþsnðm�1; ra; lÞ�sn�aðm�1; ra; lÞ

still holds for all mZn40. Only the initial values change with l, snð0; ra; lÞ ¼ 1 for 0rnrminða�1; lÞ, and 0 otherwise. Therecursion says that we must subtract from the ballot recursion the paths reaching (n, m) with exactly a down steps at theend, and one up step in the beginning. These are counted by sn�aðm�1; ra; lÞ.

The table shows the number of paths avoiding r4 or rrrr above the zeros and extending below the boundary using therecurrence to obtain a polynomial sequence.

Induction over n shows that (sn) is a polynomial sequence with deg sn=n. Using operators on polynomials, we can writethe recurrence as

1�E�1 ¼ B�BaE�1;

where the linear operators B and Ev are defined by linear extension of BsnðxÞ ¼ sn�1ðxÞ and EvsnðxÞ ¼ snðxþvÞ, the shift by v.The operators r¼ 1�E�1 and E�1 both have power series expansions in D, the derivative operator. Such operators arecalled shift-invariant. Hence B must be shift-invariant too, and therefore commutes with r and Ev. The power series for B

must be of order 1, because B reduces degrees by 1. Such linear operators are called delta operators. The basic sequenceðbnðxÞÞnZ0 of a delta operator B is a sequence of polynomials such that deg bn ¼ n, BbnðxÞ ¼ bn�1ðxÞ (like the Sheffer sequence

snðxÞ for B), and initial conditions bnð0Þ ¼ d0;n for all n 2 N0. In our special case, the basic sequence is easily determined.

Page 3: Pattern avoiding ballot paths and finite operator calculus

ARTICLE IN PRESS

H. Niederhausen, S. Sullivan / Journal of Statistical Planning and Inference 140 (2010) 2312–23202314

Solving for E1 shows that

E1 ¼Xa�1

i ¼ 0

Bi:

Finite Operator Calculus tells us (Niederhausen, 2003, (2.5)) that if E1 ¼ 1þsðBÞ, where sðtÞ is a power series of order 1,then the basic sequence bnðxÞ of B has the generating functionX

nZ0

bnðxÞtn ¼ ð1þsðtÞÞx:

Thus, in our case bnðxÞ ¼ ½tn�ð1þtþt2þ � � � þta�1Þx.

Definition 4. The geometric coefficient is defined as

x

n

� �a

¼ ½tn�ð1þtþ � � � þta�1Þx¼Xbn=ac

i ¼ 0

ð�1Þix

i

� �xþn�ai�1

n�ai

� �:

Note that for a=2 the geometric coefficient equals the binomial coefficient ðxnÞ. These numbers have already been studiedby Euler (1801). Therefore they are also called Eulerian coefficients. Some interesting properties of geometric coefficients aregiven in Niederhausen and Sullivan (2007).

Thus bnðxÞ ¼ ðxn Þa. For l=0 the Sheffer sequence (sn) has initial values snðn�1Þ ¼ dn;0. Abelization (Niederhausen, 2003)gives us

snðx; ra;0Þ ¼

x�nþ1

xþ1bnðxþ1Þ ¼

x�nþ1

xþ1

xþ1

n

� �a

so the number of ballot paths avoiding ra is

snðn; ra;0Þ ¼

1

nþ1

xþ1

n

� �a

: ð1Þ

The reflection of a pattern p is the pattern where every up step becomes a right step, and vice versa. The pattern ~p is thereverse of the pattern p, if it is the reflection of p read backwards; for example if p=uruuruu, then ~p ¼ rrurrur. It is afundamental principal in pattern avoidance, proved by reflection, that the number of fm;-g lattice paths weakly above y=x

ending at ðn;nþ lÞ avoiding p equals the number of fm;-g lattice paths weakly above y¼ x�l ending at ðnþ l; lÞ avoiding thereverse pattern ~p,

snðnþ l; p;0Þ ¼ snþ lðn; ~p; lÞ:

If we are only interested in paths returning to the diagonal (l=0), we can see how this principal saves us a great deal ofwork. For general l40, this will not be the case, because we will not be able to find the paths avoiding ~p staying weaklyabove y¼ x�l. There is one notable exception, p¼ ra. For general l, the initial values snð0; ra; lÞ agree up to n¼ l with bnð1Þ,and therefore snðx; ra; lÞ ¼ bnðxþ1Þ for all nr l. For n4 l we have snðn�l�1; ra; lÞ ¼ 0. The Binomial Theorem for Sheffer

Sequences (Niederhausen, 2003) expands (sn) under these and similar initial values.

Theorem 5. If ðtnÞ is a Sheffer sequence and (qn) the basic sequence for the same delta operator, then

tnðxþyÞ ¼Xn

k ¼ 0

tkðyþvkÞx�vn

x�vkqn�kðx�vkÞ

for all v 2 R.

Hence

snþ lðn; ra; lÞ ¼

Xnþ l

k ¼ 0

skðk�l�1; ra; lÞ1

nþ lþ1�kbnþ l�kðnþ lþ1�kÞ ¼

Xl

k ¼ 0

1

nþ lþ1�k

k�l

k

� �a

nþ lþ1�k

nþ l�k

!a

:

Of course, this expansion reduces to (1) if l=0.Because we were able to find the number of paths weakly above y¼ x�l for general l as polynomials, we are also able to

apply the above general principle, saying that snðnþ l;uc ;0Þ ¼ snþ lðn; rc ; lÞ. Thus

snðm;uc ;0Þ ¼

Xm�n

k ¼ 0

1

mþ1�k

k�mþn

k

� �c

mþ1�k

m�k

� �c

;

Page 4: Pattern avoiding ballot paths and finite operator calculus

ARTICLE IN PRESS

H. Niederhausen, S. Sullivan / Journal of Statistical Planning and Inference 140 (2010) 2312–2320 2315

3. Bifix-free patterns with depth 0

From now on we will only look at paths weakly above the diagonal y=x. We write snðx; pÞ instead of snðx; p;0Þ, and wealso may omit the pattern p from the notation. As with the pattern ra, we can find a single recurrence relation that holdseverywhere in the octant. If the pattern is bifix-free, we need only to subtract paths that would end in the pattern, thus wehave the recurrence

snðm; pÞ ¼ sn�1ðm; pÞþsnðm�1; pÞ�sn�aðm�c; pÞ; ð2Þ

where p has dimensions a� c. For example uurrurrur has dimensions 5�4, and depth 0. The recurrence has a polynomialsolution if the depth is 0, and aZcZ1, aZ2 (If a=1 then p=ur, a pattern we do not want to avoid.). In operators:

r¼ Bð1�Ba�1E�cÞ:

Since the delta operator r can be written as a delta series in B, the operator B is also a delta operator. The basic sequencecan be expressed via the Transfer Formula (Niederhausen, 2003, Theorem 1):

bnðxÞ ¼ xXn=ða�1Þ

i ¼ 0

ð�1Þi

x�ci

n�ða�1Þi

i

� �xþn�ðaþc�1Þi�1

n�ða�1Þi

!:

Since our initial values are snðn�1;pÞ ¼ dn;0, we use Abelization (Niederhausen, 2003, (2.5)) to obtain

snðxÞ ¼ ðx�nþ1ÞXn=ða�1Þ

i ¼ 0

ð�1Þi

x�ciþ1

n�ða�1Þi

i

� �xþn�ðaþc�1Þi

n�ða�1Þi

!:

Therefore the number of ballot paths avoiding p and returning to the diagonal (Dyck paths) is

snðnÞ ¼Xn=ða�1Þ

i ¼ 0

ð�1Þi

n�ciþ1

n�ða�1Þi

i

� �2n�ðaþc�1Þi

n�ða�1Þi

!:

4. Patterns with depth 0 and bifix index 1

The pattern p has bifix index 1 if there exists a unique nonempty pattern o such that p¼ op0o. If p has dimensions a� c

and op0 has dimensions b� d, we have a recurrence of the form

snðxÞ ¼ sn�1ðxÞþsnðx�1Þ�XiZ0

ð�1Þisn�a�biðx�c�diÞ: ð3Þ

For example p¼ urruurr has depth 0, with dimensions 4� 3 and bifix urr, so b=2 and d=2. From the paths reachingðn�a; x�cÞ those ending in urru cannot be included in the recurrence and must be subtracted, and from those again wecannot include paths ending in urru, and so on. The op0 piece of the pattern that is responsible for this exclusion–inclusionprocess may not go below the diagonal; hence it must have depth ra�c.

From examining the summation in the recurrence, we notice that we must have bZd. If bod, then at some point wewould be using numbers below the y=x boundary, which are only the polynomial extensions and do not count paths.

Page 5: Pattern avoiding ballot paths and finite operator calculus

ARTICLE IN PRESS

H. Niederhausen, S. Sullivan / Journal of Statistical Planning and Inference 140 (2010) 2312–23202316

Notice in our above example b�d¼ 0, thus the recurrence formula applies to the pattern urruurr.

The condition bZd implies that the depth of op0 is less or equal to a�c, because of the following lemma.

Lemma 6. Let s and t be patterns in fu; rg�. Then

depthðstÞZdepthðsÞþhðtÞ

(see Definition 2).

Proof.

depthðstÞZmaxfhðp0tÞjst¼ qp0t; q 2 fu; rg�g ¼ depthðsÞþhðtÞ;

because hðp0tÞ ¼ hðp0ÞþhðtÞ. &

We let our pattern p be op0o and s¼ op0, t=o. Hence

d¼ depthðpÞZdepthðop0ÞþhðoÞ

and

depthðop0Þrd�hðoÞ ¼ d�ðhðpÞ�hðop0ÞÞrdþa�c ð4Þ

because we assumed that hðop0Þr0.Summary of the conditions on p when d¼ 0:

(1)

p¼ op0o, where o is nonempty and unique (bifix index=1). (2) p has dimensions a� c, where aZcZ1, a41. (3) op0 has dimensions b� d, where bZd, bZ1.

We assume that bZ1, because otherwise p¼ uc , a case we considered already. Under these conditions (sn) is a Sheffersequence, and the recursion (3) can be written in terms of the operator B : sn/sn�1 as

1¼ BþE�1�XiZ0

ð�1ÞiBaþbiE�c�di ¼ BþE�1�BaE�c

1þBbE�d

or

r¼ BþBbþ1E�dþBbE�d�1�BaE�c�BbE�d ¼ B�BaE�cþBbþ1E�d�BbE�dr: ð5Þ

We view r as a formal power series in B with coefficients in the ring of shift-invariant operators. The generalized TransferFormula (Niederhausen, 2003, Theorem 2) tells us that

bnðxÞ ¼ xXn

i ¼ 1

Cn;i1

i

i�1þx

i�1

� �

is the basic polynomial for B, where

Cn;i ¼ ½Bn�ðB�BaE�cþBbþ1E�d�BbE�drÞi:

Hence

bnðxÞ ¼ xX

j;k;lZ0: ða�1Þjþbkþðb�1Þlrn�1

n�ða�1Þj�bk�ðb�1Þl

j; k; l

!ð�1Þjþ l E�cj�dk�dlr

l

n�ða�1Þj�bk�ðb�1Þl

n�ða�1Þj�bk�ðb�1Þl�1þx

n�ða�1Þj�bk�ðb�1Þl�1

!

Page 6: Pattern avoiding ballot paths and finite operator calculus

ARTICLE IN PRESS

H. Niederhausen, S. Sullivan / Journal of Statistical Planning and Inference 140 (2010) 2312–2320 2317

¼ xXn�1=ða�1Þ

j ¼ 0

Xn�1�ða�1Þj=b

k ¼ 0

Xn�1�ða�1Þj=b�k

l ¼ 0

n�ða�1Þj�bk�ðb�1Þl

j; k; l

!ð�1Þjþ l

n�ða�1Þj�bk�ðb�1Þl

n�ðaþc�1Þj�ðbþdÞðkþ lÞ�1þx

n�ða�1Þj�bðkþ lÞ�1

!:

Because snðn�1Þ ¼ d0;n we still get snðxÞ ¼ ððx�nþ1Þ=ðxþ1ÞÞbnðxþ1Þ.

Example 7. For the pattern urruurr we find the parameters a¼ #r’s¼ 4, c¼ #u’s¼ 3, b=2, d¼ 2. Because thedepthðurruurrÞ ¼ 0, we obtain the explicit solution

sðn; xÞ ¼Xbðn�1Þ=3c

j ¼ 0

Xbðn�1�3jÞ=2c

k ¼ 0

Xbðn�1�3j�2kÞ=2c

l ¼ 0

n�3j�2k�l

j

!n�4j�2k�l

k

� �n�4j�3k�l

l

� �

�ðx�nþ1Þð�1Þjþ l

n�3j�2k�l

n�6j�4ðkþ lÞþx

n�3j�2ðkþ lÞ�1

!:

The above operator equation (5) simplifies when a¼ bþ1 and c=d. This corresponds to a pattern of the form rp0r. For thiscase we get

r¼ Bð1þBbE�dÞ�1

and

snðxÞ ¼ðx�nþ1Þ

xþ1bnðxþ1Þ ¼

Xbn=bc

i ¼ 0

ð�1Þi

x�diþ1

n�ðb�1Þi�1

i

� �xþn�ðdþbþ1Þi

n�bi

� �:

The number of paths returning to the diagonal equals

snðnÞ ¼Xbn=bc

i ¼ 0

ð�1Þi

n�diþ1

n�ðb�1Þi�1

i

� �2n�ðdþbþ1Þi

n�bi

� �:

5. Patterns with depth at least 1 and bifix index 0 or 1

Up to now we studied patterns such that the pattern avoiding ballot numbers could be continued to Shefferpolynomials below the diagonal, using the notation snðxÞ. Because that is no longer true in this section, we begin with thenew notation Dðn;mÞ for the pattern avoiding ballot numbers reaching (n, m). It is easy to see that if the pattern has depthd40, then the recurrence for all points (n, m) between the lines y=x and y¼ xþd is

Dðn;mÞ ¼Dðn�1;mÞþDðn;m�1Þ

since by definition of depth a path ending at (n, m) with nþd4mZn cannot contain the pattern p. In general, thesenumbers cannot be extended to polynomials of degree n. As initial values we have Dðn;n�1Þ ¼ d0;n for all nZ0.

If (n, m) falls weakly above the line y¼ xþd we have the recurrence

Dðn;mÞ ¼Dðn�1;mÞþDðn;m�1Þ�Dðn�a;m�cÞ ð6Þ

Page 7: Pattern avoiding ballot paths and finite operator calculus

ARTICLE IN PRESS

H. Niederhausen, S. Sullivan / Journal of Statistical Planning and Inference 140 (2010) 2312–23202318

for bifix index 0, and

Dðn;mÞ ¼Dðn�1;mÞþDðn;m�1Þ�XiZ0

ð�1ÞiDðn�a�bi;m�c�diÞ ð7Þ

for bifix index 1 (see (2) and (3)).We obtain a Sheffer sequence (sn), say, but only weakly above the line y¼ xþd,

Dðn;mÞ ¼ snðmÞ for all mZnþd;

if the correction terms Dðn�a;m�cÞ (orP

iZ0 ð�1ÞiDðn�a�bi;m�c�diÞ) in (6) and (7) are taken at points weakly above thesame line, thus aZc and bZd. Finally, we must enforce in case of a nonempty bifix o that depth ðop0Þ, where p¼ op0o, doesnot exceed dþa�c. However, this condition holds automatically when bZd (see (4)).

Looking closer at the boundary m¼ nþd,

snðnþdÞ ¼ sn�1ðnþdÞþsnðnþd�1Þ�XiZ0

ð�1Þisn�a�biðnþd�c�diÞ

we see that snðnþd�1Þ and Dðn;nþd�1Þ also agree. We utilized this fact in the previous sections to determine the initialvalues snðn�1Þ ¼ d0;n when the depth was 0.

Example 8. The following table shows the number of ballot paths avoiding the pattern rrruuurrruu, which has depth d¼ 2,a�c¼ 1, one bifix rrruu, op0 ¼ rrruuu of depth 3, and b�d¼ 0. In this table, the path (-) to (6,8) shows the first instancewhen the occurrence of the pattern is subtracted. The double path ()) to (9,11) shows the first instance when theoccurrence of the subpattern op0 is added.

How can we determine initial values for the Sheffer sequence (sn) if d40? There are several ways of doing this; one wayapplies the following lemma to obtain a (recursive) formula for the values snðnþd�1Þ. Such a recursion will be enough forexplicitly representing the Sheffer polynomials in terms of their basic sequence.

Lemma 9. Let d be a positive integer. Suppose the ballot recursion

Dðn;mÞ ¼Dðn�1;mÞþDðn;m�1Þ

holds for all 0rnrmrnþd�1, with initial values Dð0;mÞ ¼ 1 for all m 2 Z, Dðn;nþdÞ given for all nZ0, and Dðn;n�1Þ ¼ 0for all nZ1. Then

Dðn;nþ j�1Þ ¼Xj=2

i ¼ 1

j�i

i

� �ð�1Þi�1Dðn�i;n�iþ j�1Þþ

Xðjþ1Þ=2

i ¼ 1

j�i

i�1

� �ð�1Þi�1Dðn�i;n�iþ jÞ

for all nZ1 and 0r jrd.

Page 8: Pattern avoiding ballot paths and finite operator calculus

ARTICLE IN PRESS

H. Niederhausen, S. Sullivan / Journal of Statistical Planning and Inference 140 (2010) 2312–2320 2319

Proof. For n=1 we get

Dð1; jÞ ¼j�1

1

� �Dð0; j�1Þþ

j�1

0

� �Dð0; jÞ ¼ j;

which is right. For j=0 we obtain Dðn;n�1Þ ¼ 0 as required. The double induction over nZ1 and 1r jrd uses only therecursion Dðn;n�1þ jÞ ¼Dðn�1;n�1þ jÞþDðn;n�2þ jÞ. &

Suppose we have a Sheffer sequence (sn) such that snðnþ jÞ ¼Dðn;nþ jÞ for all jZd�1, as it is the case for the problem inthis section. To get Dð1; jÞ ¼ j we must require that p contains more than one r. Under this condition the lemma says that

snðnþd�1Þ ¼Xd=2

i ¼ 1

d�i

i

� �ð�1Þi�1sn�iðn�iþd�1Þþ

Xðdþ1Þ=2

i ¼ 1

d�i

i�1

� �ð�1Þi�1sn�iðn�iþdÞ:

Summarizing the conditions on p we get

(1)

the bifix of p is 0 or 1, (2) a41, aZc and bZd:

Example 10 (Continuation of Example 8). In the example avoiding the pattern rrruuurrruu, which has d¼ 2, we findsnðnþ1Þ ¼ sn�1ðnÞþsn�1ðnþ1Þ.

Using the above initial values from Lemma 9 to find snðxÞ above the line y¼ xþd requires the Functional ExpansionTheorem (Niederhausen, 2003, Theorem 3):

Theorem 11. Suppose (sn) is a Sheffer sequence for the delta operator B with basic sequence (bn), and L a functional such that

/Lj1Sa0. Then

snðxÞ ¼Xn

k ¼ 0

/LjskS ~L�1

bn�kðxÞ;

where ~L�1

is the operator inverse to ~L ¼P

iZ0/LjbiSBi.

Lemma 9 tells us how to choose the functional L,

/LjsnðnþxÞS¼ snðnþd�1Þ�Xd=2

i ¼ 1

d�i

i

� �ð�1Þi�1sn�iðn�iþd�1Þ�

Xðdþ1Þ=2

i ¼ 1

d�i

i�1

� �ð�1Þi�1sn�iðn�iþdÞ ¼ d0;n:

Note that we applied the functional L to snðnþxÞ, a Sheffer polynomial for the delta operator B1 :¼ E�1B, with basicpolynomials ðxþnÞbnðxÞ=x (see Niederhausen, 2003, Remark 1). In terms of the evaluation functional Evalzf ðxÞ ¼ f ðzÞwe canwrite

/LjsnðnþxÞS¼ Evald�1�Evald�1

Xd=2

i ¼ 1

d�i

i

� �ð�1Þi�1Bi

1

�Evald

Xðdþ1Þ=2

i ¼ 1

d�i

i�1

� �ð�1Þi�1Bi

1

!snðnþxÞ:

According to Niederhausen (2003, (2.7)) we get

~L ¼ Ed�1�Ed�1Xd=2

i ¼ 1

d�i

i

� �ð�1Þi�1Bi

1�EdXðdþ1Þ=2

i ¼ 1

d�i

i�1

� �ð�1Þi�1Bi

1

and finally

~L�1¼ E1�d 1�

Xðdþ1Þ=2

i ¼ 1

d�i

i

� �þE1 d�i

i�1

� �� �ð�1Þi�1Bi

1

!:

,

Therefore, the Functional Expansion Theorem writes snðxÞ in terms of bnðxÞ as

snðnþxÞ ¼ ~L�1 x

nþxbnðnþxÞ ¼

E1�d

1þPðdþ1Þ=2

i ¼ 1

d�i

i

� �þE1

d�i

i�1

� �� �ð�1ÞiBi

1

x

nþxbnðnþxÞ

¼XjZ0

ð�1ÞjXðdþ1Þ=2

i ¼ 1

d�i

i

� �þE1 d�i

i�1

� �� �ð�1ÞiBi

1

!j

�xþ1�d

nþxþ1�dbnðnþxþ1�dÞ

Page 9: Pattern avoiding ballot paths and finite operator calculus

ARTICLE IN PRESS

H. Niederhausen, S. Sullivan / Journal of Statistical Planning and Inference 140 (2010) 2312–23202320

We leave the final expansion to the reader. Note that

Bk1

xþd�1

nþxþd�1bnðnþxþ1�dÞ ¼

xþd�1

n�kþxþd�1bn�kðn�kþxþ1�dÞ:

Of course, the values snðnþxÞ agree with the pattern avoiding path counts only for xZd�1.

Example 12 (Continuation of Examples 8 and 10). In the example above, avoiding the pattern rrruuurrruu, which has d¼ 2,we find

snðnþxÞ ¼XjZ0

ð1þE1ÞjBj

1

x�1

nþx�1bnðnþx�1Þ ¼ 2n

þXn

j ¼ 1

Xn�j

i ¼ 0

n�j

i

� �xþ i�1

jþxþ i�1bjðjþxþ i�1Þ:

Finally, we also have to expand the ballot like numbers between the lines y=x and y¼ xþd in terms of those weaklyabove the line y¼ xþd�1.

Lemma 13. We have for all 0r jrd�1

Dðn;nþd�1�jÞ ¼Xj=2

i ¼ 0

j�i

i

� �ð�1Þisn�iðn�iþd�1Þþ

Xðjþ1Þ=2

i ¼ 1

j�i

i�1

� �ð�1Þisn�iðn�iþdÞ:

Proof. Similar to the proof of Lemma 9. &

Example 14. In the above example, avoiding the pattern rrruuurrruu, we have d¼ 2. We findDðn;nþ1�jÞ ¼ snðnþ1Þ�ðj�1

0 Þsn�1ðnþ1Þ for j=1, 2. For example, Dð10;10Þ ¼ s10ð11Þ�s9ð11Þ ¼ 58572�41821¼ 16751.

6. The patterns of length 4

Sapounakis et al. (2007) find generating functions for all patterns of length 4 occurring k times in Dyck paths, i.e., inballot paths returning to the diagonal. Their case k=0 is our pattern avoiding case. All patterns of length four are included inthe above considerations, except uuur, uuru, uruu, and ruuu. The path counts in these four cases are not (eventually) Shefferpolynomial; the Finite Operator Calculus does not directly apply.

ruuu

After differencing, this case is similar to u3, and we obtain for mZ1

Dðn;nþm; ru3Þ ¼n

n

� �3

þn

n�m

� �3

þ2Xm�1

i ¼ 1

n

n�i

� �3

:

Note that Dðn;n; ru3Þ ¼Dðn�1;n; ru3Þ.

uuur In a similar way as in the case ru3, we obtain

Dðn;nþm;u3rÞ ¼Xm

i ¼ 0

Xiþ1

k ¼ 0

1

nþ iþ1�k

k�i�1

k

� �3

nþ iþ1�k

nþ i�k

!3

;

which also holds for m¼ 0.

uuru and uruu Both cases are avoided by the same ballot paths. We obtain Dðn;nþm;uuruÞ ¼Dðn;nþm;uruuÞ

¼Xn

k ¼ 0

m�1

n�k

� �ð�1Þn�k

Xk =2

i ¼ 0

2i�k�1

i

� �1

kþ1�2i� m

2kþm�3i

k�2i�1

� �þ

2kþm�3i

k�2i

� �� �:

Note that except for the special cases u4 and r4 no pattern of length 4 has a bifix index larger than 1.

References

Deutsch, E., 1999. Dyck path enumeration. Discrete Math. 204, 167–202.Euler, L., 1801. De evolutione potestatis polynomialis cuiuscunque ð1þxþx2þx3þx4þetc:Þn. Nova Acta Acad. Sci. Imperialis Petropolitinae 12, 47–57.Niederhausen, H., Sullivan, S., 2007. Euler coefficients and restricted Dyck paths. Congr. Numer. 188, 196–210.Niederhausen, H., 2003. Rota’s umbral calculus and recursions. Algebra Univers. 49, 435–457.Rota, G.-C., Kahaner, D., Odlyzko, A., 1973. On the foundations of combinatorial theory VIII: Finite operator calculus. J. Math. Anal. Appl. 42, 684–760.Sapounakis, A., Tasoulas, I., Tsikouras, P., 2007. Counting strings in Dyck paths. Discrete Math. 307, 2909–2924.