COUNTING PEAKS AT HEIGHT k IN A DYCK PATH

TOUFIK MANSOUR

LaBRI, Université Bordeaux 1, 351 cours de la Libération 33405 Talence Cedex, France

                        toufik@labri.fr

Abstract

A Dyck path is a lattice path in the plane integer lattice ℤ × ℤ consisting of steps (1, 1) and (1, −1), which never passes below the x-axis. A peak at height k on a Dyck path is a point on the path with coordinate y = k that is immediately preceded by a (1, 1) step and immediately followed by a (1, −1) step. In this paper we find an explicit expression for the generating function for the number of Dyck paths starting at (0, 0) and ending at (2n, 0) with exactly r peaks at height k. This allows us to express this function via Chebyshev polynomials of the second kind and the generating function for the Catalan numbers.

Keywords: Dyck paths, Catalan numbers, Chebyshev polynomials.

1. Introduction and main results

The Catalan sequence is the sequence

{C_{n}}_{n≥0} = {1, 1, 2, 5, 14, 132, 429, 1430, … },

where C_{n} = \frac{1}{n+1} \binom{2n}{n} is called the nth Catalan number. The generating

function for the Catalan numbers is denoted by C(x) = \frac{1−\sqrt{1−4x}}{2x}. The Catalan numbers provide a complete answer to the problem of counting certain properties of more than 66 different combinatorial structures (see Stanley [S, Page 219 and Exercise 6.19]). The structure of use to us in the present paper is Dyck paths.

Figure 1. Two Dyck paths.

Chebyshev polynomials of the second kind are defined by

U_{r}(cos θ) = \frac{sin(r + 1)θ}{sin θ}

for r ≥ 0. Evidently, U_{r}(x) is a polynomial of degree r in x with integer coefficients. Chebyshev polynomials were invented for the needs of approximation theory, but are also widely used in various other branches of mathematics, including algebra, combinatorics, number theory, and lattice paths (see [K, Ri]). For k ≥ 0 we define R_{k}(x) by

R_{k}(x) = \frac{U_{k−1} (\frac{1}{2\sqrt{x}})}{\sqrt{x}U_{k} (\frac{1}{2\sqrt{x}})}.

For example, R_{0}(x) = 0, R_{1}(x) = 1, and R_{2}(x) = 1/(1 − x). It is easy to see that for any k, R_{k}(x) is a rational function in x.

A Dyck path is a lattice path in the plane integer lattice ℤ × ℤ consisting of up-steps (1, 1) and down-steps (1, −1), which never passes below the xaxis (see Figure 1). Let P be a Dyck path; we define the weight of P to be the product of the weights of all its steps, where the weight of every step (up-step or down-step) is \sqrt{x}. For example, Figure 1 presents two Dyck paths, each of length 12 and weight x^{6}.

A point on the Dyck path is called a peak at height k if it is a point with coordinate y = k that is immediately preceded by a up-step and immediately followed by a down-step. For example, Figure 1 presents two Dyck paths; the path on the left has two peaks at height 2 and two peaks at height 3; and the path on the right has one peak at height 1, one peak at height 2, and one peak at height 3. A point on the Dyck path is called a valley at height k if it is a point with coordinate y = k that is immediately preceded by down-step and immediately followed by up-step. For example, in Figure 1, the path on the left has two valleys at height 1 and one valley at height 2, and the path on the right has only two valleys at height 0. The number of all Dyck paths starting at (0, 0) and ending at (2n, 0) with exactly r peaks (resp. valleys) at height k we denote by peak_{k}^{r}(n) (resp. valley_{k}^{r}(n)). The corresponding generating function is denoted by Peak_{k}^{r}(x) (resp. Valley_{k}^{r}(x)).

Deutsch [D] found the number of Dyck paths of length 2n starting and ending on the x-axis with no peaks at height 1 is given by the nth Fine number: 1, 0, 1, 2, 6, 18, 57, … (see [D, DS, F] and [SP, Sequence M1624]). Recently, Peart and Woan [PW] gave a complete answer for the number of Dyck paths of length 2n starting and ending on the x-axis with no peaks at height k. This result can be formulated as follows.

Theorem 1.1. (see [PW, Section 2]) The generating function for the number of Dyck paths of length 2n starting and ending on the x-axis with no peaks at height k is given by

\frac{1}{1 − \frac{x}{1 − \frac{x}{1 − \frac{...}{1 − \frac{x}{1 − x^{2}C^{2}(x)}}}}} ,

where the continued fraction contains exactly k levels.

Theorem 1.1 is in fact a simple consequence of Theorem 1.2 (as we are going to show in Section 3).

Theorem 1.2. (see [RV, Proposition 1]) For given a Dyck path P we give every up-step the weight 1, every down-step from height k to height k − 1 not following a peak the weight λ_{k}, and every down-step following a peak of height k the weight μ_{k}. The weight of w(P) of the path P is the product of the weights of its steps. Then the generating function ∑_{P} w(P), where the sum over all the Dyck paths, is given by

\frac{1}{1 − (μ_{1} − λ_{1}) − \frac{λ_{1}}{1 − (μ_{2} − λ_{2}) − \frac{λ_{2}}{1 − (μ_{3} − λ_{3}) − ...}}}

In this paper we find an explicit formulas for the generating functions Peak_{k}^{r}(x) and Valley_{k}^{r}(x) for any k, r ≥ 0. This allows us to express these functions via Chebyshev polynomials of the second kind U_{k}(x) and generating function for the Catalan numbers C(x). The main result of this paper can be formulated as follows:

Main Theorem 1.1.

(i) For all k ≥ 2,

Peak_{k}^{r}(x) = Valley_{k−2}^{r}(x);

(ii) For all k, r ≥ 0,

Valley_{k}^{r}(x) = δ_{r,0}R_{k+1}(x) + \frac{x^{r}C^{r+1}(x)}{U_{k+1}^{2} (\frac{1}{2\sqrt{x}}) (1 − x(R_{k+1}(x) − 1)C(x))^{r+1}} ;

(iii) For all r ≥ 0,

Peak_{1}^{r}(x) = δ_{r,0} + \frac{x^{3r+2}C^{2r+2}(x)}{(1 − x^{2}C^{2}(x))^{r+1}} .

We give two proofs of this result. The first proof, given in Section 2, uses a decomposition of the paths under consideration, while the second proof, given in Section 3, uses the continued fraction theorem due to Roblet and Viennot (see Theorem 1.2) as the starting point.

Remark 1.3. By the first part and the second part of the Main Theorem, we obtain an explicit expression for the generating function for the number of Dyck paths starting at (0, 0) and ending on the x-axis with no peaks at height k ≥ 2, namely

Peak_{k}^{0}(x) = R_{k−1}(x) + \frac{x^{r}C^{r+1}(x)}{U_{k−1}^{2} (\frac{1}{2\sqrt{x}}) (1 − x(R_{k−1}(x) − 1)C(x))^{r+1}} .

We also provide a combinatorial explanation for certain facts in Main Theorem. For example, we provide a combinatorial proof for the fact (ii) in the Main Theorem for r = k = 0. Acknowledgments. The author expresses his appreciation to the referees for their careful reading of the manuscript and helpful suggestions.

2. Proofs: directly from definitions

In this section we present a proof for the Main Theorem which is based on the definitions of the Dyck paths. Proof of the Main Theorem(i). We start by proving the first part of the Main Theorem by introducing a bijection Ψ between the set of Dyck paths of length 2n with r peaks at height k and the set of Dyck paths of length 2n with r valleys at height k − 2.

Theorem 2.1. Peak_{k}^{r}(x) = Valley_{k−2}^{r}(x) for all k ≥ 2.

Proof. Let P = P_{1}, P_{2}, …, P_{2n} be a Dyck path of length 2n with exactly r peaks at height k ≥ 2 where P_{j} are the points of the path P. For any point P_{j} we define another point Ψ(P_{j}) = Q_{j} as follows. If P_{j} appears as a point of a valley at height k − 2 then we define Q_{j} = P_{j} + (0, 2). If P_{j} appear as a point of a peak at height k then we define Q_{j} = P_{j} − (0, 2) (this is possible since k ≥ 2). Otherwise, we define Q_{j} = P_{j}. Therefore, we obtain a new path Q = Q_{1}, Q_{2}, …, Q_{2n}, and by definition of Q it is easy to see that Q is a Dyck path of length 2n with exactly r valleys at height k − 2 (see Figure 2).

Figure 2. Bijection Ψ.

In fact, it is easily verified that the map which maps P to Q is a bijection. This establishes the theorem. □

Formula for Valley_{0}^{0}(x). Let P be a Dyck path with no valleys at height 0. It is easy to see that P has no valleys at height 0 if and only if there exists a Dyck path P′ of length 2n − 2 such that

P = up-step, P′, down-step.

Let P′′ be the path that results by shifting P′ by (−1, −1). Then the map Θ which sends P → P′′ is a bijection between the set of all Dyck paths starting at (0, 0) and ending at (2n, 0) with no valleys, and the set of all Dyck paths starting at point (0, 0) and ending at (2n − 2, 0). Hence

Valley_{0}^{0}(x) = 1 + xC(x),

where we count 1 for the empty path, x for the up-step and the down-step, and C(x) for all Dyck paths P′′. Proof of the Main Theorem(ii). First of all, let us present two facts. The first fact concerns the generating function for the number of Dyck paths from the southwest corner of a rectangle to the northeast corner.

Fact 2.2. (see [K, Theorem A2 with Fact A3]) Let k ≥ 0. The generating function for the number of Dyck paths which lie between the lines y = k and y = 0, starting at (0, 0) and ending at (n, k) is given by

F_{k}(x) := \frac{1}{\sqrt{x}U_{k+1} (\frac{1}{2\sqrt{x}})}.

The second fact concerns the generating function for the number of Dyck paths starting at (a, k + 1) and ending at (a + n, k + 1) with no valleys at height k.

Fact 2.3. The generating function for the number of Dyck paths starting at (a, k + 1) and ending at (a + n, k + 1) with no valleys at height k is given by

\frac{C(x)}{1 − x(R_{k+1}(x) − 1)C(x)}.

Proof. Let P be a Dyck path starting at (k+1, 0) and ending at (k+1, n) with no valleys at height k. It is easy to see that P has a unique decomposition of the form

P = W_{1}, down-step, V_{1}, up-step, W_{2}, down-step, V_{2}, …, up-step, W_{m},

where the following conditions holds for all j:

(i) W_{j} is a path consisting of up-steps and down-steps starting and ending at height k + 1 and never passes below the height k + 1;

(ii) V_{j} is a path consisting of up-step and down-steps starting and ending at height k and never passes over the height k (see Figure 3).

Figure 3. A decomposition of a Dyck path starting at (a, k + 1) and ending at (a + n, k + 1) with no valleys at height k.

Using [K, Theorem 2] we get that the generating function for the number of paths of type V_{j} (shift for a Dyck path) is given by R_{k+1}(x) − 1. Using the fact that W_{j} is a shift for a Dyck paths starting and ending on the x-axis we obtain the generating function for the number of Dyck paths of type W_{j} is given by C(x). If we sum over all the possibilities of m then we have

C(x) ∑_{m≥0} (xC(x)(R_{k+1}(x) − 1))^{m} = \frac{C(x)}{1 − x(R_{k+1}(x) − 1)C(x)}.

□

Now we are ready to prove the second part of the Main Theorem.

Theorem 2.4. The generating function Valley_{k}^{r}(x) is given by

δ_{r,0}R_{k+1}(x) + \frac{x^{r}C^{r+1}(x)}{U_{k+1}^{2} (\frac{1}{2\sqrt{x}}) (1 − x(R_{k+1}(x) − 1)C(x))^{r+1}} .

Proof. Let P be a Dyck path starting (0, 0) and ending at (2n, 0) with exactly r valleys at height k. It is easy to see that P has a unique decomposition of the form

P = E_{1}, up-step, D_{0}, down-step, up-step, D_{1}, down-step, up-step, …, D_{r}, down-step, E_{2},

where the following conditions holds:

(i) E_{1} is a Dyck path that lies between the lines y = k and y = 0, starting at (0, 0), and ending at point on height k;

(ii) D_{j} is a Dyck path starting and ending at points on height k + 1

without valleys at height k, for all j; (iii) E_{2} is a Dyck path that lies between the lines y = k and y = 0,

starting at point on height k, and ending at (2n, 0). Using Fact 2.2 and Fact 2.3 we get the the desired result for all r ≥ 1. Now, if we assume that r = 0, then we must consider another possibility which is that all the Dyck paths lie between the lines y = k and y = 0, starting at (0, 0), and ending on the x-axis. Hence, using [K, Theorem 2] we get that the generating function for the number of these paths is given by R_{k+1}(x). □

As a corollary of the Main Theorem(ii) for k = 0 (using [M, Example 1.18]) we get

Theorem 2.5. For all r ≥ 0,

Valley_{0}^{r}(x) = δ_{r,0} + x^{r+1}C^{r+1}(x).

In other words, the number of Dyck paths starting at (0, 0) and ending at (2n, 0) with exactly r valleys at height 0 is given by

\frac{r + 1}{n}\binom{2n − r − 1}{n + 1}.

Proof of the Main Theorem(iii). If we merge the first two parts of Main Theorem, then we get an explicit formula for Peak_{k}^{r}(x) for all r ≥ 0 and k ≥ 2. Besides, by definition there are no peaks at height 0. Thus, it is left to find Peak_{1}^{r}(x) for all r ≥ 0.

Theorem 2.6. For all r ≥ 0,

Peak_{1}^{r}(x) = δ_{r,0} + \frac{x^{3r+2}C^{2r+2}(x)}{(1 − x^{2}C^{2}(x))^{r+1}} .

Proof. Let P be a Dyck path starting at (0, 0) and ending at (2n, 0) with exactly r peaks at height 1. It is easy to see that P has a unique decomposition of the form

P = D_{0}, up-step, down-step, D_{1}, up-step, down-step, …, up-step, down-step, D_{r}, where D_{j} is a nonempty Dyck path starting and ending at point on the x-axis with no peaks at height 1. Hence, the rest is easy to obtain by using [D]. □

For example, for r = 0 the above theorem yields the main result of [D].

3. Proofs: Directly from Theorem 1.2

In this section we present another proof for the Main Theorem which is based on Roblet and Viennot [RV, Proposition 1] (see Theorem 1.2).

Let λ_{j} = x for all j, μ_{j} = x for all j ≠ k, and μ_{k} = z. Theorem 1.2 yields

∑_{r≥0} Peak_{k}^{r}(x)z^{r} = \frac{1}{1 − \frac{x}{1 − \frac{x}{1 − \frac{...}{1 − \frac{x}{1 − \frac{x}{1 − (z − x) − \frac{x}{1 − \frac{x}{1 − \frac{x}{1 − ...}}}}}}}}} ,

(1)

where z appears in the kth level. On the other hand, xC^{2}(x) = C(x) − 1, we have that

C(x) = \frac{1}{1 − \frac{x}{1 − \frac{x}{1 − ...}}} .  (2)

Using the identities (1) and (2) with xC^{2}(x) = C(x) − 1 we get

Theorem 3.1. The generating function ∑_{r≥0} Peak_{k}^{r}(x)z^{r} is given by

\frac{1}{1 − \frac{x}{1 − \frac{x}{1 − \frac{...}{1 − \frac{x}{1 − \frac{x}{1 − z − x^{2}C^{2}(x)}}}}}} ,

where the continued fraction contains exactly k levels.

For example, Theorem 3.1 yields for z = 0 the generating function Peak_{k}^{0}(x) as in the statement of Theorem 1.1. More generally, Theorem 3.1 yields an explicit expression for Peak_{k}^{r}(x) for any r ≥ 1 by using the following lemma.

Lemma 3.2. For all k ≥ 1,

\frac{1}{1 − \frac{x}{1 − \frac{x}{1 − \frac{...}{1 − \frac{x}{1 − z − xA}}}}} = R_{k}(x) · \frac{1 − zR_{k−1}(x) − xAR_{k−1}(x)}{1 − zR_{k}(x) − xAR_{k}(x)}.

where the continued fraction contains exactly k levels.

Proof. Immediately, by using the identity R_{m+1}(x) = 1/(1 − xR_{m}(x)) and induction on k. □

Therefore, using Theorem 3.1, the above lemma, and the identity R_{m+1}(x) = 1/(1 − xR_{m}(x)), together with definitions of R_{k}(x), we get the explicit expression for the generating function Peak_{k}^{r}(x) for any r ≥ 1 (see the Main Theorem).

References

[D] E. Deutsch. Dyck path enumeration, Disc. Math. 204 (1999), 167–202.

[DS] E. Deutsch and L.W. Shapiro, A survey of the Fine numbers, Disc. Math. 241 (2001), 241–265.

[F] T. Fine, Extrapolation when very little is known about the source, Information and Control 16 (1970), 331–359.

[K] C. Krattenthaler, Permutations with restricted patterns and Dyck paths, Adv. in Applied Math. 27 (2001), 510–530.

[M] S. G. Mohanty, Lattice Path Counting and Applications, Academic Press, 1979.

[PW] P. Peart and W.J. Woan, Dyck paths with no peaks at height k, J. of Integer Sequences 4 (2001), Article 01.1.3.

[RV] E. Roblet and X.G. Viennot, Théorie combinatoire des T-fractions et approximants de Padé en deux points, Disc. Math. 153 (1996), 271–288.

[Ri] Th. Rivlin, Chebyshev Polynomials: From Approximation Theory to Algebra and Number Theory, John Wiley, New York, 1990.

[SP] N.J.A. Sloane and S. Plouffe, The Encyclopedia of Integer Sequences, Academic Press, New York, 1995.

[S] R. Stanley, Enumerative Combinatorics, vol. 1, Wadsworth and Brooks/Cole, Pacific Grove, CA, 1986; second printing, Cambridge University Press, Cambridge, 1996.

(Mentions sequence A000108.)

Received March 21, 2002; revised version received April 14, 2002. Published in Journal of Integer Sequences May 1, 2002.

10 Toufik Mansour Return to Journal of Integer Sequences home page.