Analysis of Bidirectional Ballot Sequences and Random Walks Ending in Their Maximum

Consider non-negative lattice paths ending at their maximum height, which will be called admissible paths. We show that the probability for a lattice path to be admissible is related to the Chebyshev polynomials of the first or second kind, depending on whether the lattice path is defined with a reflective barrier or not. Parameters like the number of admissible paths with given length or the expected height are analyzed asymptotically. Additionally, we use a bijection between admissible random walks and special binary sequences to prove a recent conjecture by Zhao on ballot sequences.


Introduction
Lattice paths as well as their stochastic incarnation -random walks -are interesting and classical objects of study. Several authors have investigated a variety of parameters related to lattice paths. For example, Banderier and Flajolet gave an asymptotic analysis of the number of special lattice paths with fixed length in [2]. De Brujin, Knuth, and Rice [4] analyzed the expected height of certain lattice paths, and Panny and Prodinger [14] determined the asymptotic behavior of such paths with respect to several notions of height.
The particular class of lattice paths we want to analyze in this paper is defined as follows.
for random walks on Z. Then (S k ) 0≤k≤n is said to be admissible of height h, if the random walk stays within the interval [0, h] and ends in h, i.e., S k ∈ [0, h] for all 0 ≤ k ≤ n and S n = h. It is called admissible, if it is admissible of height h for some h ∈ N.
The probability that a random walk of length n is admissible of height h is written as p (h) n and q (h) n for random walks on N 0 and Z, respectively. Furthermore, the probabilities that a random walk is admissible at all are defined as p n := ∑ h≥0 p (h) n and q n := ∑ h≥0 q (h) n , respectively. Finally, an admissible lattice path is a sequence of integers realizing an admissible random walk.
In a nutshell, this means that an admissible random walk is a non-negative random walk ending in its maximum. The definition is also visualized in Figure 1, where all admissible lattice paths of length 5 are depicted. There are three admissible lattice paths of height 3, and one of height 1 and 5, respectively. Note that when considering random walks on Z, every lattice path has the same probability 2 −n . Admissible random walks on Z are enumerated by sequence A167510 in [11]. However, in the case of random walks on N 0 , the probability depends on the number of visits to 0: if there are v such visits (including the initial state), then the path occurs with probability 2 −n+v . Note that by "folding down" (i.e., reflecting about the x-axis) some sections between consecutive visits to 0, or the section between the last visit and the end, 2 v lattice paths on Z can be formed, where the random walk is never farther away from the start than at the end. We will call such lattice paths extremal lattice paths -and by construction, the number of extremal lattice paths of length n is given by p n 2 n . To illustrate this idea of extremal lattice paths, all paths of this form of length 3 are given in Figure 2.
One of our motivations for investigating admissible random walks originates from a conjecture in [16]. There, Zhao introduced the notion of a bidirectional ballot sequence: sequence if every prefix and suffix contains strictly more 1's than 0's. The number of bidirectional ballot sequences of length n is denoted by B n .
Bidirectional ballot sequences are strongly related to admissible random walks on Z. In fact, every bidirectional ballot sequence of length n + 2 bijectively corresponds to an admissible random walk of length n on Z: given an admissible random walk, every up-step corresponds to a 1, and down-steps correspond to 0. Adding a 1 both at the beginning and at the end of the constructed string gives a bidirectional ballot sequence of length n + 2.
Therefore, bidirectional ballot walks may also be seen as lattice paths with unique minimum and maximum.
While we restrict ourselves to simple lattice paths (i.e., the path has steps ±1), Bousquet-Mélou and Ponty introduce a more general class of so-called culminating paths in [3]. Akin to bidirectional ballot walks, culminating paths are lattice paths with unique minimum and maximum -however, the lattice path has steps a and −b for fixed a, b > 0. They show that the behavior of these paths strongly depends on the drift a − b. In particular, for a = b = 1 (i.e., for bidirectional ballot walks) they determine the main term of the asymptotic expansion of B n (cf. [3,Proposition 4.1]).
In [16], Zhao also shows that B n = Θ(2 n /n), states (without detailed proof) that B n ∼ 2 n /(4n) and conjectures that In this paper, we want to give a detailed analysis of the asymptotic behavior of admissible random walks. By exploiting the bijection between admissible random walks and bidirectional ballot sequences, we also prove a stronger version of Zhao's conjecture.
In order to do so, we use a connection between Chebyshev polynomials and the probabilities p  plore in detail in Section 2. This allows us to determine explicit representations of the probabilities p n and q n , which are given in Theorem 2.5. The analysis of the asymptotic behavior of admissible random walks of given length shall focus in particular on the height of these random walks. In this context, we define random variables H n and H n by These random variables model the height of admissible random walks on N 0 and Z, respectively. Besides an asymptotic expansion for p n and q n , we are also interested in the behavior of the expected height and its variance. The asymptotic analysis of these expressions, which is based on an approach featuring the Mellin transform, is carried out in Sections 3 and 4, and the results are given in Theorems 3.5 and 4.2, respectively. Finally, Zhao's conjecture is proved in Corollary 4.5.

Chebyshev Polynomials and Random Walks
We denote the Chebyshev polynomials of the first and second kind by T h and U h , respectively, i.e., In the following propositions, we show that these polynomials occur when analyzing admissible random walks. As usual, the notation [z n ] f (z) denotes the coefficient of z n in the series expansion of f (z).
Proposition 2.1. The probability that a simple symmetric random walk (S k ) 0≤k≤n of length n on Z is admissible of height h is for h ≥ 0 and n ≥ 0.
Proof. We consider the (h + 1) × (h + 1) transfer matrix which has the following simple yet useful property: if w n, k is the probability that 0 ≤ S 0 , S 1 , . . . , S n ≤ h and S n = k, then the following recursion for the vectors w The initial vector is w (h) 0 = e 0 = (1, 0, . . . , 0). Since we also want that S n = h, we multiply by the vector e h = (0, . . . , 0, 1) at the end to extract only the last entry w Cramer's rule yields Comparing this with the recursion for the Chebyshev polynomials and checking the initial values, we find that 2 h+1 det(I−zM h ) z h+1 from which (2.1) follows by extracting the coefficient of z n .
An analogous statement holds for admissible random walks on N 0 with the sole difference that in this case, the Chebyshev polynomials of the first kind occur. Proposition 2.2. The probability that a random walk (S k ) 0≤k≤n of length n on N 0 is admissible of height h is given by for h ≥ 0 and n ≥ 1.
Proof. For random walks with a reflective barrier at 0, the (h + 1) × (h + 1) transfer matrix has the form B.Hackletal. 6 B. Hackl et al.
By the same approach involving Cramer's rule as in the proof of Proposition 2.1, we find the generating function where we have the recursion , which can be proved again by verifying that the same recursion holds for the Chebyshev-T polynomials and that the initial values agree.

Remark 2.3. The coefficients of 1
T h (1/z) have also been studied in [9]. There, the case of fixed h is investigated, whereas we mostly focus on the asymptotic behavior of ∑ h≥0 p  In the following theorem and throughout the rest of the paper, m will denote a halfinteger, i.e., m ∈ 1 2 N = 1 2 , 1, 3 2 , 2, . . . . While this convention may seem unusual, it simplifies many of our formulae and is therefore convenient for calculations.
Proof. We begin with the analysis of p n . The probabilities are related to the Chebyshev-T polynomials by Proposition 2.2. It is a well-known fact (cf. [12, 22:3:3]) that these polynomials have the explicit representation AnalysisofBidirectionalBallotSequences 781 Analysis of Bidirectional Ballot Sequences 7 which immediately yields By applying Cauchy's integral formula, we obtain the coefficients of the factor Y (t) encountered in (2.5). We choose a sufficiently small circle around 0 as the integration contour γ. Thus, we get We want to simplify the expression √ 1 − t in this integral. This can be achieved by . Also, the new integration contour isγ, which is still a contour that winds around the origin once. Then, again by Cauchy's integral formula, we obtain Expanding the factor (1+u) 2n+h−1 1+u h into a series with the help of the geometric series and the binomial theorem yields and therefore, This allows us to expand the expression encountered before, that is, Using the binomial identity the expression above can be simplified so that, together with (2.5), we find By plugging this into (2.2), we obtain Combinatorially, it is clear that p (h) n = 0 for n and h of different parity, as only heights of the same parity as the length can be reached by a random walk starting at the origin. This can also be observed in the representation above. Assuming n ≡ h mod 2, we can write n − h = 2 or equivalently n−h 2 = . This gives us .
For the second part, we consider the explicit representation of the Chebyshev-U polynomials, which is equivalent to

Formula (2.4) is now obtained in the same way as (2.3).
With explicit formulae for the probabilities p n , we can start to work towards the analysis of the asymptotic behavior of admissible random walks.

Admissible Random Walks on N 0
In this section, we begin to develop the tools required for a precise analysis of the asymptotic behavior of admissible random walks on N 0 . Analysis of Bidirectional Ballot Sequences 9 Recalling the result of Theorem 2.5, we find that in the half-integer representation p (h) 2m−1 , the shifted central binomial coefficient 2m m−τ h, k appears. Hence, for the purpose of obtaining an expansion for p 2m−1 = ∑ h≥0 p (h) 2m−1 , analyzing the asymptotics of binomial coefficients in the central region is necessary. In the following, we will work a lot with asymptotic expansions. The notation for all integers R > −L, even if the series does not converge. Likewise, an asymptotic expansion in two variables given by for all R > −L.

AnalysisofBidirectionalBallotSequences 785
Analysis of Bidirectional Ballot Sequences 11 By expanding the logarithm into a power series, we can simplify this expression to We also use 1 n ± α = 1 n By the symmetry of the binomial coefficient, the resulting asymptotic expansion has to be symmetric in α. Assembling all these expansions yields the asymptotic formula where S(α, n) is defined as in the statement of the lemma. Note that d 0 = 1, and thus the first summand of the series in (3.1) is 1 -which gives c 00 = 1. Summands where the exponent of α exceeds the exponent of 1/n only occur in the last series, with the maximal difference being induced by α 4r /n 3r . Thus, if j > 2 3 , we have c j = 0. Together with |α| ≤ n 2/3 , this implies the estimate for S(α, n).
For |α| > n 2/3 , we can use the monotonicity of the binomial coefficient to obtain where τ h, k = (h + 1)(2k + 1)/2. Therefore, the total probability for a random walk of length 2m − 1 on N 0 to be admissible is given by The terms where τ h, k > m 2/3 can be neglected in view of the last statement in Since the sum clearly contains O m 4/3 terms, the error is at most O(m −1/2+4/3+2/3(2J(L)+1)−(L+1) ) = O(m 1/2−L/9 ). The exponent can be made arbitrarily small by choosing L accordingly. Finally, if we extend the sum to the full range (all integers h, k ≥ 0 such that h + 1 ≡ 2m mod 2) again, we only get another error term of order O exp − m 1/3 , which can be neglected. In summary, we have This sum can be analyzed with the help of the Mellin transform and the converse mapping theorem (cf. [6]). In order to follow this approach, we will investigate those terms in (3.4) whose growth is not obvious more precisely. That is, we will focus on the contribution of terms of the form We are also interested in the expected height and the corresponding variance and higher moments of admissible random walks. Asymptotic expansions for these can be obtained by analyzing moments of the random variable H n with P(H n = h) := p (h) n p n , as stated in the introduction. For the sake of convenience, let us consider the r-th shifted moment E(H 2m−1 + 1) r . We know AnalysisofBidirectionalBallotSequences 787 Analysis of Bidirectional Ballot Sequences 13 The asymptotic behavior of the denominator is related to the behavior of the sum from above -and fortunately, the behavior of the numerator is related to the behavior of the very similar sum ∑ h, k≥0 h+1≡2m mod 2 The following lemma analyzes sums of this structure asymptotically.

Proof of Lemma 3.2.
If we substitute m = x −2 , the left-hand side of (3.5) becomes This is a typical example of a harmonic sum, cf. [6, §3], and the Mellin transform can be applied to obtain its asymptotic behaviour. First of all, it is well known that the Mellin transform of a harmonic sum of the form f (x) = ∑ k≥1 a k g(b k x) can be factored as ∑ k≥1 a k b −s k g * (s) [6, Lemma 2], provided that the half-plane of absolute convergence of the Dirichlet series Λ(s) = ∑ k≥1 a k b −s k has non-empty intersection with the fundamental strip of the Mellin transform g * of the base function g. In this particular case, the Dirichlet series is Now we simplify the Dirichlet series. For s ∈ C with ℜ(s) > 2 j + 2 + r, the sum converges absolutely because it is dominated by the zeta function. In view of the definition of the β function, this simplifies to where κ 2m (s) depends on the parity of 2m. We find Thus, the Mellin transform of f is By the converse mapping theorem (see [6,Theorem 4]), the asymptotic growth of f (x) for x → 0 can be found by considering the analytic continuation of f * (s) further to the left of the complex plane and investigating its poles. The theorem may be applied because Λ(s) has polynomial growth and Γ(s/2) decays exponentially along vertical lines of the complex plane.
We find that f * (s) has a simple pole at s = 2 j + 2 + r, which comes from the zeta function in the definition of κ 2m . There are no other poles: β is an entire function, and the poles of Γ cancel against the zeros of β (at all odd negative integers, see the earlier remark).
The asymptotic contribution from the pole of f * is which does not depend on the parity of 2m, as the respective residue of κ 2m is 1 2 in either case. Finally, the O-term in (3.5) comes from the fact that f * may be continued analytically arbitrarily far to the left in the complex plane without encountering any additional poles. At this point, all that remains to obtain asymptotic expansions is to multiply the contributions resulting from Lemma 3.2 with the correct coefficients and contributions from (3.4).
Theorem 3.5. (Asymptotic analysis of admissible random walks on N 0 ) The probability that a random walk on N 0 is admissible can be expressed asymptotically as (3.6) where π/2 ≈ 1.25331. The expected height of admissible random walks is given by where 2G 2/π ≈ 1.46167, and the variance of H n can be expressed as where π 3 − 32G 2 /(4π) ≈ 0.33092. Generally, the r-th moment is asymptotically given by Moreover, if η = h/ √ n satisfies 3/ √ log n < η < √ log n/2 and h ≡ n mod 2, we have the local limit theorem Remark 3.6. The fact that the two series in (3.10) and (3.11) that represent the density φ (η) are equal is a simple consequence of the Poisson sum formula. We also note that the asymptotic behavior of the moments of H n readily implies that the normalized random variable H n / √ n converges weakly to the distribution whose density is given by φ (η) (see [7,Theorem C.2]). The local limit theorem (3.10) is somewhat stronger. as well as some numerical comparisons can be found at http://arxiv.org/src/ 1503.08790/anc/random-walk_NN.ipynb), an asymptotic expansion in the halfinteger m is obtained. Substituting m = (n + 1)/2 then gives (3.6). The results in (3.7) and (3.8) are obtained by considering making use of (3.4) and Lemma 3.2 again. Note that we have EH n = E(H n + 1) − 1, as well as VH n = E(H n + 1) 2 − [E(H n + 1)] 2 . For higher moments, we only give the principal term of the asymptotics, which corresponds to the coefficient c 00 in (3.4), but in principle it would be possible to calculate further terms as well. It remains to prove (3.10). To this end, we revisit the explicit expression (recall that we set n = 2m − 1) First of all, we can eliminate all k with τ h, k > m 2/3 , since their total contribution is at most O m exp − m 1/3 as before. For all other values of k, we replace the binomial coefficient according to Lemma 3.1 by Note here that It follows that We are assuming that τ h,k ≤ m 2/3 = ((n+1)/2) 2/3 , which implies hk 2 /n = O(n 1/3 /h).
In view of our assumptions on h, this means that the error term is O n −1/6 √ log n . Thus we have Adding all terms τ h, k > m 2/3 = ((n + 1)/2) 2/3 back only results in a negligible contribution that decays faster than any power of n again, but we need to be careful with the O-term inside the sum, as we have to bound the accumulated error by the sum of the absolute values. We have which can be seen, e.g., by approximating the sum by an integral (or by means of the Mellin transform again), so For η ≥ 1, the sum is bounded below by a constant multiple of exp − η 2 /2 (as can be seen by bounding the sum of all terms with k ≥ 1), which in turn is at least exp(−(log n)/8) = n −1/8 by our assumptions on η. Thus the first term indeed dominates the error term in this case. If η < 1, we use the alternative representation (3.11), which shows that φ (η) is bounded below by a constant multiple of η −2 exp − π 2 /(8η) 2 . This in turn is at least (1/9)n −π 2 /72 log n by the assumptions on η, and since π 2 /72 < 1/6, we can draw the same conclusion.
Remark 3.7. As stated in the introduction, the number 2 n p n gives the number of extremal lattice paths on Z -and thus, with the asymptotic expansion of p n , we also have an asymptotic expansion for the number of extremal lattice paths on Z of given length.
This concludes our analysis of admissible random walks on N 0 . In the next section, we investigate admissible random walks on Z.

Ballot Sequences and Admissible Random Walks on Z
In principle, the approach we follow for the analysis of the asymptotic behavior of admissible random walks on Z is the same as in the previous section. However, due to the different structure of (2.4), some steps will need to be adapted. B. Hackl et al.
With the notation of Lemma 3.1, we are able to express q 2m−2 for a half-integer m ∈ 1 2 N with m ≥ 1 as In analogy to our investigation of admissible random walks on N 0 , we also want to determine the expected height and variance of admissible random walks. These are related to the random variable H n , which we defined by To make things easier, we will investigate moments of the form E H n + 2 r . They can be computed by Therefore, we are interested in the asymptotic contribution of which is discussed in the following lemma.   Furthermore, in the introduction we illustrated that admissible random walks are strongly related to bidirectional ballot sequences. Since every bidirectional ballot sequence of length n + 2 corresponds to an admissible random walk of length n on Z i.e., B n = 2 n−2 q n−2 , we are able to prove Zhao's conjecture that was mentioned in the introduction. In Figure 3 we compare the exact values of B n /2 n with the values obtained from the asymptotic expansion in (4.11).