15
Advances in Applied Mathematics 35 (2005) 392–406 www.elsevier.com/locate/yaama On the enumeration of parking functions by leading terms Sen-Peng Eu a,,1 , Tung-Shan Fu b,2 , Chun-Ju Lai a a Department of Applied Mathematics, National University of Kaohsiung, Kaohsiung 811, Taiwan, ROC b Mathematics Faculty, National Pingtung Institute of Commerce, Pingtung 900, Taiwan, ROC Received 2 February 2005; accepted 15 March 2005 Available online 25 July 2005 Abstract Let x = (x 1 ,...,x n ) be a sequence of positive integers. An x-parking function is a sequence (a 1 ,...,a n ) of positive integers whose non-decreasing rearrangement b 1 ··· b n satisfies b i x 1 +···+ x i . In this paper we give a combinatorial approach to the enumeration of (a,b,...,b)- parking functions by their leading terms, which covers the special cases x = (1,..., 1), (a, 1,..., 1), and (b,...,b). The approach relies on bijections between the x-parking functions and labeled rooted forests. To serve this purpose, we present a simple method for establishing the required bijections. Some bijective results between certain sets of x-parking functions of distinct leading terms are also given. 2005 Elsevier Inc. All rights reserved. 1. Introduction A parking function of length n is a sequence α = (a 1 ,...,a n ) of positive integers such that the non-decreasing rearrangement b 1 ··· b n of α satisfies b i i . Parking functions were introduced by Konheim and Weiss in [4] when they dealt with a hashing * Corresponding author. E-mail addresses: [email protected] (S.-P. Eu), [email protected] (T.-S. Fu). 1 Partially supported by National Science Council, Taiwan, ROC (NSC 93-2115-M-390-005). 2 Partially supported by National Science Council, Taiwan, ROC (NSC 93-2115-M-251-001). 0196-8858/$ – see front matter 2005 Elsevier Inc. All rights reserved. doi:10.1016/j.aam.2005.03.005

On the enumeration of parking functions by leading terms

Embed Size (px)

Citation preview

Page 1: On the enumeration of parking functions by leading terms

a

C

e

dections.lso

shing

Advances in Applied Mathematics 35 (2005) 392–406

www.elsevier.com/locate/yaam

On the enumeration of parking functionsby leading terms

Sen-Peng Eua,∗,1, Tung-Shan Fub,2, Chun-Ju Laia

a Department of Applied Mathematics, National University of Kaohsiung, Kaohsiung 811, Taiwan, ROb Mathematics Faculty, National Pingtung Institute of Commerce, Pingtung 900, Taiwan, ROC

Received 2 February 2005; accepted 15 March 2005

Available online 25 July 2005

Abstract

Let x = (x1, . . . , xn) be a sequence of positive integers. Anx-parking function is a sequenc(a1, . . . , an) of positive integers whose non-decreasing rearrangementb1 � · · · � bn satisfiesbi �x1 + · · · + xi . In this paper we give a combinatorial approach to the enumeration of(a, b, . . . , b)-parking functions by their leading terms, which covers the special casesx = (1, . . . ,1), (a,1, . . . ,1),and(b, . . . , b). The approach relies on bijections between thex-parking functions and labeled rooteforests. To serve this purpose, we present a simple method for establishing the required bijSome bijective results between certain sets ofx-parking functions of distinct leading terms are agiven. 2005 Elsevier Inc. All rights reserved.

1. Introduction

A parking functionof length n is a sequenceα = (a1, . . . , an) of positive integerssuch that the non-decreasing rearrangementb1 � · · · � bn of α satisfiesbi � i. Parkingfunctions were introduced by Konheim and Weiss in [4] when they dealt with a ha

* Corresponding author.E-mail addresses:[email protected] (S.-P. Eu), [email protected] (T.-S. Fu).

1 Partially supported by National Science Council, Taiwan, ROC (NSC 93-2115-M-390-005).2 Partially supported by National Science Council, Taiwan, ROC (NSC 93-2115-M-251-001).

0196-8858/$ – see front matter 2005 Elsevier Inc. All rights reserved.doi:10.1016/j.aam.2005.03.005

Page 2: On the enumeration of parking functions by leading terms

S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406 393

length

,7,8]).cturesments,ere

hee-is

e

oacher,

fer-

sets offor-e

f theiordan

sed on

ctionrabeled

the bi-

givens, wea

problem in computer science. They derived that the number of parking functions ofn is (n + 1)n−1, which coincides with the number of labeled trees onn + 1 vertices byCayley’s formula. Several bijections between the two sets are known (e.g., see [1Parking functions have been found in connection to many other combinatorial strusuch as acyclic mappings, polytopes, non-crossing partitions, hyperplane arrangeetc. Refer to [1–3,6,9,10] for more information. The notion of parking functions wfurther generalized in [6]. Letx = (x1, . . . , xn) be a sequence of positive integers. Tsequenceα = (a1, . . . , an) is called anx-parking functionif the non-decreasing rearrangmentb1 � · · · � bn of α satisfiesbi � x1 + · · · + xi . Thus the ordinary parking functionthe casex = (1, . . . ,1). The number ofx-parking functions for an arbitraryx was obtainedby Kung and Yan [5] in terms of the determinantal formula of Goncarove polynomials. Sealso [12–14] for the explicit formulas and properties for some specified cases ofx.

Motivated by the work of Foata and Riordan in [1], we give a combinatorial apprto the enumeration of(a, b, . . . , b)-parking functions by their leading terms in this papwhich covers the special casesx = (1, . . . ,1), (a,1, . . . ,1), and(b, . . . , b). An x-parkingfunction (a1, . . . , an) is said to bek-leading if a1 = k. Let pn,k denote the number ok-leading ordinary parking functions of lengthn. Foata and Riordan [1] derived the genating function forpn,k algebraically,

n∑k=1

pn,kxk = x

1− x

(2(n + 1)n−2 −

n∑k=1

(n − 1

k − 1

)kk−2(n − k + 1)n−k−1xk

). (1)

One of our main results is that we obtain some bijective results between certain(a,1, . . . ,1)-parking functions of distinct leading terms, which lead to the explicitmulas for the number ofk-leading(a,1, . . . ,1)-parking functions. In particular, for thcasea = 1, we deduce (1) combinatorially. These results rely on a bijectionϕ between(a,1, . . . ,1)-parking functions and labeled rooted forests, which is a generalization osecond bijection between acyclic mappings and parking functions of Foata and R[1, Section 3]. The key that opens the way is a simple object, calledtriplet-labeled rootedforest, which not only serves as an intermediate stage of the bijectionϕ but also enable(a,1, . . . ,1)-parking functions to be manipulated on forests easily. Furthermore, basthe bijectionϕ, we establish an immediate bijection between(a, b, . . . , b)-parking func-tions and labeled rooted forests with edge-colorings, which is equivalent to a bijegiven by C.H. Yan in [14], so as to enumerate(a, b, . . . , b)-parking functions by theileading terms. In the end we propose a structure, by using a generalized triplet-lrooted forest, for generalx-parking functions.

We organize this paper as follows. The notion of triplet-labeled rooted forests andjectionϕ are given in Section 2. How the bijectionϕ is applied to enumerate(a,1, . . . ,1)-parking functions (and hence ordinary parking functions) by the leading terms isin Section 3. Making use of the notion of labeled rooted forests with edge-coloringinvestigate the casesx = (b, . . . , b) and(a, b, . . . , b) in Section 4. Finally, we proposestructure for generalx-parking functions in Section 5.

Page 3: On the enumeration of parking functions by leading terms

394 S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406

o

allt

d

2. Triplet-labeled rooted forests and the bijection ϕ

For a rooted forestF and two verticesu,v ∈ F , we say thatu is adescendantof v ifv is contained in the path fromu to the root of the component that containsu. If also u

andv are adjacent, thenu is called achild of v, andv is called theparentof u. Let T (u)

denote the subtree ofF consisting ofu and the descendants ofu, and letF − T (u) denotethe remaining part ofF when the subtreeT (u) and the edgeuv are removed. For any twintegersm < n, we use the notation[m,n] = {m,m + 1, . . . , n}. In particular, we write[n] = {1, . . . , n}.

In this section we consider the casex = (a,1, . . . ,1). We call such anx-parkingfunction α an (a,1)-parking function. Note that the non-decreasing rearrangementb1 �· · · � bn of α satisfiesbi � i + a − 1. Let Pn(a,1) denote the set of(a,1)-parkingfunctions of lengthn. It is known that|Pn(a,1)| = a(a + n)n−1 (see [6,14]). Given anα = (a1, . . . , an) ∈Pn(a,1), for 1� i � n, we define

πα(i) = Card{aj ∈ α | eitheraj < ai, or aj = ai andj < i}. (2)

Note that(πα(1), . . . , πα(n)) is a permutation of[n]. In fact,πα(i) is the position of theterm ai in the non-decreasing rearrangement ofα. Moreover, we defineτα(i) = πα(i) +a − 1, for 1� i � n. Note thatai � τα(i). We associateα with ana-component forestFα ,calledtriplet-labeled rooted forest. The vertex set ofFα is the set{(

i, ai, τα(i)) | ai ∈ α

} ∪ {(ρi,0, i) | 0� i � a − 1

}of triplets(i.e., here we identify each vertex with a triplet), whereρi /∈ [n] is just an artificiallabel for discriminating the additional triplets. Let(ρ0,0,0), . . . , (ρa−1,0, a − 1) be theroots of distinct trees ofFα . For any two verticesv = (x1, y1, z1) andu = (x2, y2, z2), u isa child ofv whenevery2 = z1 + 1.

For example, takea = 2 and n = 9. Consider the(2,1)-parking function α =(2,5,9,1,5,7,2,4,1). We have the permutation(πα(1), . . . , πα(n)) = (3,6,9,1,7,8,

4,5,2) and the sequence(τα(1), . . . , τα(n)) = (4,7,10,2,8,9,5,6,3). The triplet-labeledrooted forest associated withα is shown on the left of Fig. 1.

LetFn(a,1) denote the set ofa-component rooted forests on the set{ρ0, . . . , ρa−1}∪[n]such that thea specified verticesρ0, . . . , ρa−1 are the roots of distinct trees. We shestablish a bijectionϕ betweenPn(a,1) andFn(a,1) with the triplet-labeled rooted foresas an intermediate stage.

Fig. 1. The triplet-labeled rooted forest associated withα = (2,5,9,1,5,7,2,4,1) and the corresponding labelerooted forestϕ(α) (in the canonical form).

Page 4: On the enumeration of parking functions by leading terms

S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406 395

in

f.g fromhenh

e

ht by

ing

ons of

tive

The bijectionϕ :Pn(a,1) → Fn(a,1). Define the mappingϕ by carryingα ∈ Pn(a,1)

into ϕ(α) ∈ Fn(a,1), whereϕ(α) is the same as the triplet-labeled rooted forestFα as-sociated withα with vertices labeled by the first entries of the triplets ofFα , i.e., ϕ(α)

is obtained fromFα simply by erasing the last two entries of all triplets. As illustratedFig. 1, the forest on the right is the corresponding forestϕ(α) of the(2,1)-parking functionα = (2,5,9,1,5,7,2,4,1).

To describeϕ−1, for eachF ∈ Fn(a,1), first we expressF in a form, calledcanonicalform, of a plane rooted forest. We writeF = (T0, . . . , Ta−1), whereTi denotes the tree oF that is rooted atρi , for 0 � i � a − 1. Let T0, . . . , Ta−1 be placed from left to rightIf a vertex has more than one child then the labels of these children are increasinleft to right. For example, the forest on the right of Fig. 1 is in the canonical form. Twe associate the rootρi with the triplet (ρi,0, i), for 0 � i � a − 1, and associate eacnon-root vertexj ∈ [n] with a triplet (j,pj , qj ), wherepj andqj are determined by thfollowing algorithm. Here traversingF by a breadth-first search means that we viewF asa rooted treeF by connecting the roots ofF to a virtual vertexx and then traverseF by abreadth-first search fromx.

Algorithm A.

(i) TraverseF by a breadth-first search and label the third entriesqj of the non-rootvertices froma to a + n − 1.

(ii) For any two verticesv = (x1, y1, z1) andu = (x2, y2, z2), y2 = z1 + 1 wheneveru is achild of v.

As shown in Fig. 1, the forest on the left can be recovered from the one on the rigAlgorithm A. Note that ifu is a child ofv thenz2 > z1, and hencey2 = z1+1� z2. Sortingthe triplets of non-root vertices by the first entries, the sequenceϕ−1(F ) = (p1, . . . , pn),which is formed by their second entries, is the required(a,1)-parking function.

Remark. For the special casea = 1, ϕ is a bijection between the set of ordinary parkfunctions of lengthn and the set of labeled rooted trees on[0, n] with root ρ0 = 0, whichis equivalent to the second bijection between acyclic mappings and parking functiFoata and Riordan [1, Section 3].

3. Enumerating (a,1)-parking functions by leading terms

Let Pn,k(a,1) denote the set ofk-leading(a,1)-parking functions of lengthn, and let

p(a,1)n,k = ∣∣Pn,k(a,1)

∣∣.Let F∗

n,k(a,1) denote the set of triplet-labeled rooted forestsFα associated withα ∈ Pn(a,1). For eachα = (a1, . . . , an) ∈ Pn,k(a,1), we observe thatπα(1) + a − 1 �a1 = k. With the benefit of triplet-labeled rooted forests, we obtain the following bijecresult.

Page 5: On the enumeration of parking functions by leading terms

396 S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406

ions

rd

f

ies, we

re,al

Theorem 3.1. For a � k � a + n − 2, there is a bijection between the setsR andPn,k+1(a,1), whereR is the set ofk-leading(a,1)-parking functionsα of lengthn thatsatisfy at least one of the two conditions: (i) α has more than one term equal tok, (ii) α hasat leastk − a + 1 terms less thank, andPn,k+1(a,1) is the set of(k + 1)-leading(a,1)-parking functions of lengthn.

Proof. Let F∗(R) ⊆ F∗n,k(a,1) be the set of forests associated with the parking funct

in R. It suffices to establish a bijectionφ :F∗(R) → F∗n,k+1(a,1). Given anFα ∈F∗(R),

let u = (1, k, τα(1)) ∈ Fα . Note that the condition (ii) can be rephrased asτα(1) > k. Sinceα satisfies at least one of the two conditions (i) and (ii), there are at leastk + 1 verticesin the subsetFα − T (u). TraverseFα − T (u) by a breadth-first search and locate thekthvertex, sayv (we mean that the root of the first tree ofFα − T (u) is the 0th vertex). Themappingφ is defined by carryingFα into φ(Fα), whereφ(Fα) is obtained fromFα −T (u)

with T (u) attached tov so thatu is the first child ofv. Updating the second and the thientries of all non-root vertices by Algorithm A, the triplet ofu becomes(1, k + 1, τ (1)),for someτ(1) � k + 1. Henceφ(Fα) ∈ F∗

n,k+1(a,1).

To find φ−1, given anFβ ∈ F∗n,k+1(a,1) for someβ ∈ Pn,k+1(a,1), let u = (1, k + 1,

τβ(1)) ∈ Fβ and letv be the parent ofu. In Fβ we locate the vertex, sayw, the thirdentry of which is equal tok − 1. Thenφ−1(Fβ) is obtained fromFβ − T (u) with T (u)

attached tow so thatu is the first child ofw. By Algorithm A, the updated triplet ou becomes(1, k, τ (1)). We observe that eitherτ(1) = k if v is another child ofw, orτ(1) > k otherwise. Henceφ−1(Fβ) ∈F∗(R). �

For example, takea = 2 andn = 9. Consider the 2-leading(2,1)-parking functionα =(2,5,9,1,5,7,2,4,1). On the left of Fig. 2 is the forestFα associated withα. Let u =(1,2,4). Note thatv = (4,1,2) is the second vertex ofFα − T (u) that is visited by abreadth-first search. On the right of Fig. 2 is the corresponding forestφ(Fα), which isobtained fromFα −T (u) with T (u) attached tov and with the second and the third entrof the triplets updated. Sorting the triplets of non-root vertices by the first entriesretrieve the corresponding 3-leading(2,1)-parking function(3,6,9,1,6,7,2,4,1) fromtheir second entries.

The following recurrence relations forp(a,1)n,k can be derived from Theorem 3.1. He

unless specified, the labeled rooted forests inFn(a,1) are considered to be in the canonicform. Recall that|Fn(a,1)| = |Pn(a,1)| = a(a + n)n−1.

Fig. 2. The forests associated with the(2,1)-parking functions(2,5,9,1,5,7,2,4,1) and(3,6,9,1,6,7,2,4,1).

Page 6: On the enumeration of parking functions by leading terms

S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406 397

er the

4).

r

Theorem 3.2. For a � k � a + n − 2, we have

p(a,1)n,k − p

(a,1)n,k+1 =

(n − 1

k − a

)akk−a−1(n − k + a)n−k+a−2. (3)

Proof. By Theorem 3.1,p(a,1)n,k −p

(a,1)n,k+1 is equal to the number ofk-leading(a,1)-parking

functionsα such that the first term ofα is the unique term equal tok, andτα(1) = k. Weshall count the number of forests that are mapped by such parking functions undmappingϕ. Let F = ϕ(α) ∈ Fn(a,1) and letu = 1 ∈ F . We observe thatF − T (u) is ana-component labeled forest onk vertices containing the rootsρ0, . . . , ρa−1, andT (u) is alabeled tree onn− k + a vertices containingu. Since there are

(n−1k−a

)ways to choosek − a

numbers from[2, n] for the non-root vertices ofF − T (u) and since there areakk−a−1

and(n − k + a)n−k+a−2 possibilities for the induced forestF − T (u) and treeT (u), thenumber of the required forests is

(n−1k−a

)akk−a−1(n − k + a)n−k+a−2. �

In order to evaluatep(a,1)n,k by Theorem 3.2, we need the following initial conditions (

Since an(a,1)-parking function of lengthn with leading termk (1 � k � a), is simply ajuxtaposition ofk and an(a + 1,1)-parking function of lengthn − 1, we have

p(a,1)n,k = (a + 1)(a + n)n−2, for 1� k � a. (4)

Now we can derive the explicit formula forp(a,1)n,k by (3) and (4). In particular, we have

p(a,1)n,a+n−1 = a(a + n − 1)n−2

since an(a + n − 1)-leading(a,1)-parking function of lengthn is a juxtaposition ofa +n − 1 and an(a,1)-parking function of lengthn − 1. We derive the following enumeratofor (a,1)-parking functions by the leading terms.

Theorem 3.3. If P (a,1)(x) = ∑a+n−1k=1 p

(a,1)n,k xk , then

P (a,1)(x) = x

1− x

((a + 1)(a + n)n−2 −

a+n−1∑k=a

(n − 1

k − a

)akk−a−1(n − k + a)n−k+a−2xk

).

Proof. We have(1

x− 1

)P (a,1)(x) = p

(a,1)n,1 −

(a+n−2∑

k=1

(p

(a,1)n,k − p

(a,1)n,k+1

)xk

)− p

(a,1)n,a+n−1x

a+n−1

= (a + 1)(a + n)n−2 −a+n−1∑k=a

(n − 1

k − a

)akk−a−1(n − k + a)n−k+a−2xk,

as required. �

Page 7: On the enumeration of parking functions by leading terms

398 S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406

ew.

g

set of

e 1--

ee that

nds

Remark. For the casea = 1, we deduce that the numberpn,k of k-leading ordinary parkingfunctions satisfies the recurrence relations

pn,k − pn,k+1 =(

n − 1

k − 1

)kk−2(n − k + 1)n−k−1, (5)

for 1� k � n − 1, with the initial condition

pn,1 = 2(n + 1)n−2.

The enumerator (1) for ordinary parking functions by the leading terms is derived an

Making use of the bijectionϕ for the casea = 1, we derive the following interestinresult for ordinary parking functions.

Theorem 3.4. If n is even, then there is a two-to-one correspondence between the1-leading parking functions of lengthn and the set of(n/2+ 1)-leading parking functionsof lengthn.

Proof. Let A (respectivelyB) denote the set of labeled trees corresponding to thleading (respectively(n/2 + 1)-leading) parking functions of lengthn under the mapping ϕ. We shall establish a two-to-one correspondenceφ betweenA andB. For eachT ∈A, the two verticesu = 1 andv = 0 of T are adjacent. LetT (v) = T − T (u). SinceT

hasn + 1 vertices andn is even, one ofT (v) andT (u) contains more thann/2 vertices. If|T (v)| > n/2, then we traverseT (v) from v by a breadth-first search and locate the(n/2)thnon-root vertex, sayw. The treeφ(T ) ∈ B is obtained fromT (v) with T (u) attached towso thatu becomes the first child ofw. Otherwise|T (u)| > n/2. Locate the(n/2)th non-root vertex ofT (u), sayw′, by a breadth-first search. Thenφ(T ) is obtained fromT (u)

with T (v) attached tow′ so thatv becomes the first child ofw′ and with a relabelingu = 0andv = 1.

To find φ−1, given a treeT ′ ∈ B, let u = 1, v = 0, andT (v) = T ′ − T (u). We retrievetwo trees ofA from T (u) andT (v). One is obtained by attachingT (u) to v so thatubecomes the first child ofv, and the other is obtained by attachingT (v) to u so thatvbecomes the first child ofu and relabelingu = 0 andv = 1. �

For example, taken = 6. On the left of Fig. 3 are the labeled treesT correspondingto the 1-leading parking functions(1,4,1,2,4,1) and (1,5,2,1,5,2), respectively. Letu = 1, v = 0 andT (v) = T − T (u). For the first tree, we observe that|T (v)| > 3 and thevertex 2 is the third non-root vertex ofT (v) that is visited by a breadth-first search. WattachT (u) to 2 to obtain the required tree on the right. For the second tree, we observ|T (u)| > 3 and again the vertex 2 is the third non-root vertex ofT (u). Likewise, we attachT (v) to 2 and relabelu = 0 andv = 1. Note that the tree on the right of Fig. 3 correspoto the 4-leading parking function(4,3,1,6,3,1).

Page 8: On the enumeration of parking functions by leading terms

S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406 399

ses

neat

gi-

f

d-

eateded

on

Fig. 3. An example of the two-to-one correspondence forn = 6.

4. Edge-colored labeled rooted trees and forests

In this section we shall enumeratex-parking functions by the leading terms for the cax = (b, . . . , b) and (a, b, . . . , b). First, we define the required structure for the casex =(b, . . . , b). Let Tn(b) denote the set of labeled trees, calledb-trees, on the vertex set[0, n],whose edges are colored with the colors 0,1, . . . , b − 1. There is no further restrictioon the colorings of edges. Unless specified, eachT ∈ Tn(b) is rooted at 0 and is in thcanonical form regarding the vertex-labeling. Letκ(i) denote the color of the edge thconnects the vertexi and its parent. It is known that|Tn(b)| = bn(n + 1)n−1.

For the casex = (b, . . . , b), we call suchx-parking functions(b)-parking functions. LetPn(b) denote the set of(b)-parking functions of lengthn. Note that the non-decreasinrearrangementb1 � · · · � bn of α ∈ Pn(b) satisfiesbi � bi. We shall establish a bjection ψb :Pn(b) → Tn(b) based on the bijectionϕ for the casea = 1. Given anα = (a1, . . . , an) ∈ Pn(b), we associateα with two sequencesβ = (p1, . . . , pn) andγ = (r1, . . . , rn), wherepi = �ai/b� (the least integer that is greater than or equal toai/b)andri = bpi − ai , for 1� i � n. It is easy to see thatβ is an ordinary parking function olengthn andγ ∈ [0, b − 1]n, and thatα is uniquely determined by such a pair(β, γ ), i.e.,ai = bpi − ri , for 1� i � n. To establish the mappingψb, we first locate the corresponing labeled treeϕ(β) ∈Fn(1,1) of β, and then defineψb by carryingα into ϕ(β) with theedge-coloringκ(i) = ri , for 1� i � n.

For example, takeb = 2. For the(2)-parking functionα = (2,7,4,18,1,9,2,9,8), wehave the associated ordinary parking functionβ = (1,4,2,9,1,5,1,5,4) and the sequencγ = (0,1,0,0,1,1,0,1,0). On the left of Fig. 4 is the triplet-labeled rooted tree associwith β. The 2-tree corresponding toα is shown on the right of Fig. 4, where the dottedges and solid edges represent the colors 0 and 1, respectively.

To find ψ−1b , given a T ∈ Tn(b), we can retrieve the ordinary parking functi

(p1, . . . , pn) from the vertex-labeling ofT , and then derive the require(b)-parking func-tion ψ−1

b (T ) = (a1, . . . , an) ∈Pn(b) by settingai = bpi − κ(i), for 1� i � n.

Proposition 4.1. The mappingψb :Pn(b) → Tn(b) mentioned above is a bijection.

Let p(b)n,m denote the number ofm-leading(b)-parking functions of lengthn. Recall that

we have determined the numberpn,k of k-leading ordinary parking functions of lengthn

by (5) and an initial condition. We derivep(b)n,m as follows.

Page 9: On the enumeration of parking functions by leading terms

400 S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406

f[1].

nt

t

at the

Fig. 4. The triplet-labeled rooted tree associated with the parking function(1,4,2,9,1,5,1,5,4) and the 2-treecorresponding to(2,7,4,18,1,9,2,9,8).

Proposition 4.2. For 1� k � n and(k − 1)b + 1� m � kb, we havep(b)n,m = bn−1pn,k .

Proof. If (k − 1)b + 1 � m � kb, then eachm-leading(b)-parking function of lengthnis associated with a pair(β, γ ), whereβ is a k-leading parking function of lengthn andγ ∈ [0, b − 1]n with the first term equal tobk − m. Since there arebn−1pn,k possibilitiesfor such a pair(β, γ ), the assertion follows. �

Let us turn to the casex = (a, b, . . . , b). In [14] C.H. Yan introduced the notion osequences of rootedb-forests in order to generalize a bijection of Foata and RiordanA rootedb-forestis a labeled rooted forest with edges colored with the colors 0, . . . , b − 1(note that each component may be rooted at any vertex). Consider a sequence(S0, . . . , St )

of rootedb-forests on[n] such that (i) eachSi is a rootedb-forest, (ii)Si andSj are disjointif i = j , and (iii) the union of the vertex setsSi (0� i � t) is [n]. Let Si denote the rootedtree obtained by connecting the roots ofSi to a new root vertexρi , where the edges incideto ρi are not colored with any color, denoted by−1 for such an edge. LetFn(a, b) denotethe set ofa-component rooted forests of the form(S0, . . . , Sa−1), where(S0, . . . , Sa−1) isa sequence of rootedb-forest on[n]. We call members ofFn(a, b) extendedb-forests. Letκ(i) denote the color of the edge that connects the vertexi and its parent. It is known tha|Fn(a, b)| = a(a + nb)n−1 (see [6,14]).

Remark. It can also be derived by the Lagrange inversion formula. We observe thexponential generating functionT (x) for the number of rootedb-trees on[n] satisfiesthe equationT (x) = ebT (x) and the exponential generating functionF(x) for |Fn(a, b)|satisfies the equationF(x) = (eT (x))a = eaT (x). By [11, Corollary 5.4.3] withH(x) = eax

andG(x) = ebx , we have

[xn

]F(x) = [

xn]H

(T (x)

) = 1

n

[xn−1]H ′(x)G(x)n = 1

n

[xn−1]{aeaxenbx

}.

Hence

1

n!∣∣Fn(a, b)

∣∣ = a

n· (a + nb)n−1

(n − 1)! .

Page 10: On the enumeration of parking functions by leading terms

S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406 401

a

s

hh

-d the

es

Fig. 5. The extended 2-forest corresponding to the(2,2)-parking function(2,7,15,1,8,12,2,5,1).

For x = (a, b, . . . , b), we call such anx-parking functionα an (a, b)-parking function.In this case the non-decreasing rearrangementb1 � · · · � bn of α satisfiesbi � a+(i−1)b.Let Pn(a, b) denote the set of(a, b)-parking functions of lengthn. We shall establishbijection ϕb :Pn(a, b) → Fn(a, b) based on the bijectionϕ :Pn(a,1) → Fn(a,1) givenin Section 2. Given anα = (a1, . . . , an) ∈ Pn(a, b), we associateα with two sequenceβ = (p1, . . . , pn) andγ = (r1, . . . , rn), where

pi ={

ai, if ai � a,⌈ai−a

b

⌉ + a, otherwise, and ri ={−1, if ai � a,

b(pi − a) − ai + a, otherwise.

(6)

It is straightforward to verify thatβ is an (a,1)-parking function of lengthn and γ ∈[−1, b − 1]n with ri = −1 wheneverai � a. Moreover,α is uniquely determined by suca pair(β, γ ), i.e.,ai = pi if pi � a, andai = b(pi − a) − ri + a otherwise. To establisthe mappingϕb, we first locate the corresponding labeled forestϕ(β) ∈ Fn(a,1) of β andthen defineϕb by carryingα into ϕ(β) with the edge-coloringκ(i) = ri , for 1� i � n.

For example, takea = 2 andb = 2. For theα = (2,7,15,1,8,12,2,5,1), we have theassociated pair(β, γ ), whereβ = (2,5,9,1,5,7,2,4,1) andγ = (−1,1,1,−1,0,0,−1,

1,−1). As shown in Fig. 1, we have obtained the labeled forestϕ(β). The required extendedb-forestϕb(α) is shown in Fig. 5, where the arrowed edges are not colored, andotted and solid edges represent the colors 0 and 1, respectively.

To find ϕ−1b , given an F ∈ Fn(a, b), we can retrieve an(a,1)-parking function

(p1, . . . , pn) from the vertex-labeling ofF and then derive the require(a, b)-parking func-tion ϕ−1

b (F ) = (a1, . . . , an) by settingai = pi if pi � a, andai = b(pi − a) − κ(i) + a

otherwise.

Proposition 4.3. The mappingϕb :Pn(a, b) → Fn(a, b) mentioned above is a bijection.

The bijectionϕb is equivalent to Yan’s bijection in [14]. Our method not only simplifithe construction but also provides an approach to the enumeration of(a, b, . . . , b)-parkingfunctions by the leading terms. LetPn,m(a, b) denote the set ofm-leading(a, b)-parkingfunctions of lengthn and let

p(a,b)n,m = ∣∣Pn,m(a, b)

∣∣.

Page 11: On the enumeration of parking functions by leading terms

402 S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406

teof

,

val

o

give

n

Lemma 4.4. For 0 � k � n − 2 anda + kb + 1 � i, j � a + (k + 1)b, there is a bijection

betweenPn,i(a, b) andPn,j (a, b), and hencep(a,b)n,i = p

(a,b)n,j .

Proof. Given anα = (a1, . . . , an) ∈ Pn,i(a, b), if the first term (a1 = i) is replaced byj ,wherea + kb + 1 � i, j � a + (k + 1)b, then it corresponds to replace the colorκ(1) =b(k + 1) − i + a of ϕb(α) by the colorb(k + 1) − j + a. Hence there is an immediabijection betweenPn,i(a, b) andPn,j (a, b) by using Proposition 4.3 and an interchangethe colorκ(1). �

The following result is extended from Theorem 3.1.

Theorem 4.5. For 0� k � n−2, there is a bijection between the setsR andPn,a+kb+1(a, b)

whereR is the set of(a + kb)-leading(a, b)-parking functionsα of lengthn that satisfyat least one of the two conditions: (i) α has more than one term belong to the inter[a + (k−1)b+1, a +kb] (or α has more than one term equal toa in casek = 0), (ii) α hasat leastk +1 terms less thena + kb, andPn,a+kb+1(a, b) is the set of(a + kb+1)-leading(a, b)-parking functions of lengthn.

Proof. Given anα ∈ R, let (β, γ ) be the pair associated withα determined by (6). Weobserve thatβ is an(a + k)-leading(a,1)-parking function with at least one of the twproperties: (i)β has more than one term equal toa + k, (ii) πβ(1) = πα(1) > k + 1. ByTheorem 3.1, there is a bijectionφ that carriesβ into an(a + k +1)-leading(a,1)-parkingfunctionφ(β) of lengthn. From the pair(φ(β), γ ), we retrieve an(a + (k + 1)b)-leading(a, b)-parking function. The assertion follows from Lemma 4.4.�

The following theorem is analogous to Theorem 3.2, and the proof is similar. Wethe proof here for completeness.

Theorem 4.6. If 0� k � n − 2, then

p(a,b)n,a+kb − p

(a,b)n,a+kb+1 =

(n − 1

k

)abn−k−1(a + kb)k−1(n − k)n−k−2. (7)

Proof. By Theorem 4.5, it suffices to count the number of(a + kb)-leading(a, b)-parkingfunctionsα with only one term belong to[a + (k − 1)b + 1, a + kb] (or with only oneterm equal toa in casek = 0) andπα(1) = k + 1. LetF = ϕb(α) andu = 1∈ F . Note thatκ(1) = 0 (or −1 in casek = 0) is specified. We observe thatF − T (u) is an extendedb-forest witha + k vertices (including the rootsρ0, . . . , ρa−1), andT (u) is ab-tree onn − k

vertices containingu. Since there are(n−1k

)ways to choosek numbers from[2, n] as the

non-root vertices ofF − T (u), and since there area(a + kb)k−1 andbn−k−1(n − k)n−k−2

possibilities for the induced forestF − T (u) and treeT (u), respectively, the assertiofollows. �

Page 12: On the enumeration of parking functions by leading terms

S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406 403

ndi-

e-

d

d

To evaluatep(a,b)n,m by Lemma 4.4 and Theorem 4.6, we need the following initial co

tions (8). Note that an(a, b)-parking function of lengthn with leading termm (1� m � a)is a juxtaposition ofm and an(a + b, b)-parking function of lengthn − 1. Hence

p(a,b)n,m = (a + b)(a + nb)n−2, for 1� m � a. (8)

By a similar argument of Theorem 3.3, we derive the enumerator for(a, b)-parking func-tions by the leading terms.

Theorem 4.7. If P (a,b)(x) = ∑a+(n−1)bm=1 p

(a,b)n,m xm, then

P (a,b)(x) = x

1− x

((a + b)(a + nb)n−2

−n−1∑k=0

(n − 1

k

)abn−k−1(a + kb)k−1(n − k)n−k−2xa+kb

).

5. A structure for general x-parking functions

In this section we propose a forest structure for generalx-parking functions. Given asequencex = (x1, . . . , xn) of positive integers, letPn(x) denote the set of thex-parkingfunctionsα = (a1, . . . , an) of lengthn and letb1 � · · · � bn be the non-decreasing rarrangement ofα. Likewise, we define the permutation(πα(1), . . . , πα(n)) by (2). Letdi = x1 + · · · + xi , for 1 � i � n. We associateα with an x1-component triplet-labelerooted forestFα satisfying the following conditions:

(i) The roots ofFα are the triplets(0,0,0) and(ρ(0,1),0,1), . . . , (ρ(0,x1−1),0, x1 − 1).(ii) For 1� j � n−1, there arexj+1 triplets inFα associated withbj . If bj is the termai ,

for somei ∈ [n] (i.e., πα(i) = j ), thenFα contains the triplet(i, ai, dj ) and the ad-ditional xj+1 − 1 triplets(ρ(j,1), ai, dj + 1), . . . , (ρ(j,xj+1−1), ai, dj+1 − 1). Finally,there is a triplet(k, ak, dn) associated withbn, wherebn is the termak , for somek ∈ [n] (i.e.,πα(k) = n).

(iii) For any two verticesv = (x1, y1, z1) andu = (x2, y2, z2), u is a child ofv if y2 =z1 + 1.

Note that the third entries of the triplets are from 0 tox1 + · · · + xn. If we erase the seconand the third entries of the triplets, then we turnFα into a rooted forestF with x1 + · · · +xn + 1 vertices satisfying the following conditions:

(C.1) The vertex set ofF is [0, n]⋃n−1j=0{ρ(j,1), . . . , ρ(j,xj+1−1)}.

(C.2) The roots ofF are 0 andρ(0,1), . . . , ρ(0,x1−1).(C.3) The verticesρ(j,1), . . . , ρ(j,xj+1−1) share the same parent with a vertexuj ∈ [n], for

1� j � n − 1, such thatui = uj if i = j .

Page 13: On the enumeration of parking functions by leading terms

404 S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406

easydijection

er

tsf

f

d

Fig. 6. The triplet-labeled rooted tree associated with the(4,3)-inflating parking functionα = (5,1,4,

5,1,10,3,3,7) and the tree associated withφ(α).

(C.4) There is an ordering amongρ(j,i), which is created by a breadth-first search inF ,ρ(j,i) < ρ(j ′,i′) if j < j ′, or j = j ′ andi < i′.

Let Fn(x) denote the set of rooted forests satisfying conditions (C.1)–(C.4). It isto see that there is a bijectionϕx betweenPn(x) andFn(x), with the triplet-labeled rooteforests as the intermediate stage, which is established in a similar manner to the bϕ given in Section 2.

Let us considerx-parking functionsα for a specified casex = (1, . . . ,1, a,1, . . . ,1),wherea occurs at thekth entry ofx andk � 2. We callα a(k, a)-inflating parking function.Let Qn(k, a) denote the set of(k, a)-inflating parking functions of lengthn. Given anα =(a1, . . . , an) ∈ Qn(k, a), we observe that the non-decreasing rearrangementb1 � · · · � bn

of α satisfiesbi � i if i � k − 1, andbi � i + a − 1 otherwise. Defineτα(i) = πα(i), for1� πα(i) � k − 1, andτα(i) = πα(i) + a − 1, for k � πα(i) � n.

In addition to the triplets(0,0,0) and{(i, ai, τα(i)) | 1 � i � n}, we locate the(k −1)thterm in the non-decreasing rearrangement ofα, saybk−1 = ar , and associate it with anotha − 1 triplets (ρ1, ar , k), . . . , (ρa−1, ar , k + a − 2). The treeTα associated withα is onthe above triplets with the root at(0,0,0). For any two verticesv = (x1, y1, z1) andu =(x2, y2, zz), u is a child ofv if y2 = z1 + 1.

For example, takek = 4 and a = 3. Consider the(4,3)-inflating parking α =(5,1,4,5,1,10,3,3,7). We have the permutation(πα(1), . . . , πα(n)) = (6,1,5,7,2,9,

3,4,8) and (τα(1), . . . , τα(n)) = (8,1,7,9,2,11,3,6,10). Note thata7 = 3 is the thirdterm in the non-decreasing rearrangement ofα. There associate two additional triplew1 = (ρ1,3,4) andw2 = (ρ2,3,5). The tree associated withα is shown on the left oFig. 6.

Theorem 5.1. There is a bijection between the set of(k, a)-inflating parking functions olengthn and the set of ordinary parking functions of lengthn+ a − 1 with the initiala − 1terms equal tok.

Proof. We shall establish a bijectionφ between two sets. LetTα be the tree associatewith α mentioned above. Locate the vertex ofTα with the third entry equal tok − 1,say u = (r, ar , k − 1), and letwj = (ρj , ar , k + j − 1) ∈ Tα , for 1 � j � a − 1. We

Page 14: On the enumeration of parking functions by leading terms

S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406 405

ts byg,

s.p

tede

ed

he two

tions,

2.

7/198

266–

003)

nd the

form a new triplet-labeled rooted tree fromTα − (T (w1) ∪ · · · ∪ T (wa−1)) by attachingT (w1), . . . , T (wa−1) to u so thatw1, . . . ,wa−1 become the firsta − 1 children ofu. Thenupdate the second and the third entries of all triplets by Algorithm A. Sorting the triplethe first entries in the orderρ1, . . . , ρa−1 and then 1, . . . , n, we obtain the correspondinordinary parking functionφ(α) = (aρ1, . . . , aρa−1, a1, . . . , an) from their second entrieswhereaρ1 = · · · = aρa−1 = k. �

As illustrated in Fig. 6, the triplet-labeled rooted tree associated withφ(α) is shownon the right, wherew1 = (ρ1,4,5) andw2 = (ρ2,4,6) andφ(α) = (4,4,6,1,4,6,1,11,3,3,5). Note that so far we have solved explicitly the number of(k, a)-inflating parkingfunctions for the casea = 2. We are interested to know explicit formulas for other case

The forest structure reveals that the number ofk-leadingx-parking functions is a stefunction ink.

Theorem 5.2. For any x = (x1, . . . , xn), let di = x1 + · · · + xi (1 � i � n) and d0 = 0.If dk−1 + 1 � p,q � dk , then the number ofp-leadingx-parking functions of lengthn isequal to the number ofq-leadingx-parking functions of lengthn.

Proof. Given ap-leadingα ∈ Pn(x), let Fα be the triplet-labeled rooted forest associawith α. Suppose thatπα(1) = s, we havek � s sincep � dk � ds . We observe that therexistxk vertices(j, aj , dk−1), (ρ(k−1,1), aj , dk−1 + 1), . . . , (ρ(k−1,xk−1), aj , dk − 1) in Fα ,for someaj � dk−1, and the vertexu = (1,p, ds) is adjacent to one of thexk vertices.If p is replaced byq, for someq ∈ [dk−1 + 1, dk], then the corresponding triplet-labelrooted forest can be obtained by switchingu adjacent to another one of thexk vertices andupdating the subsequent triplets. Hence there is an immediate bijection between tsets ofx-parking functions by an interchange of the leading terms.�

Acknowledgment

The authors would like to thank an anonymous referee for many helpful suggesespecially the simplification of (4) and (8) in the current forms.

References

[1] D. Foata, J. Riordan, Mappings of acyclic and parking functions, Aequationes Math. 10 (1974) 10–2[2] J. Françon, Acyclic and parking functions, J. Combin. Theory Ser. A 18 (1975) 27–35.[3] J.D. Gilbey, L.H. Kalikow, Parking functions, valet functions and priority queues, Discrete Math. 19

(1999) 351–373.[4] A.G. Konheim, B. Weiss, An occupancy discipline and applications, SIAM J. Appl. Math. 14 (1996) 1

1274.[5] J.P.S. Kung, C.H. Yan, Goncarov polynomials and parking functions, J. Combin. Theory Ser. A 102 (2

16–37.[6] J. Pitman, R. Stanley, A polytope related to empirical distributions, plane trees, parking functions, a

associahedron, Discrete Comput. Geom. 27 (4) (2002) 603–634.[7] J. Riordan, Ballots and trees, J. Combin. Theory 6 (1969) 408–411.

Page 15: On the enumeration of parking functions by leading terms

406 S.-P. Eu et al. / Advances in Applied Mathematics 35 (2005) 392–406

) 2620–

bin. 4

8–

.th. 27

[8] M.P. Schützenberger, On an enumeration problem, J. Combin. Theory 4 (1968) 219–221.[9] R.P. Stanley, Hyperplane arrangements, interval orders and trees, Proc. Natl. Acad. Sci. 93 (1996

2625.[10] R.P. Stanley, Parking functions and non-crossing partitions, in: The Wilf Festschrift, Electron. J. Com

(1997) R20.[11] R.P. Stanley, Enumerative Combinatorics, vol. 2, Cambridge University Press, Cambridge, 1999.[12] C.H. Yan, Generalized tree inversions andk-parking functions, J. Combin. Theory Ser. A 79 (1997) 26

280.[13] C.H. Yan, On the enumeration of generalized parking functions, Congr. Numer. 147 (2000) 201–209[14] C.H. Yan, Generalized parking functions, tree inversions and multicolored graphs, Adv. in Appl. Ma

(2001) 641–670.