On the Height of One-Dimensional Random Walk

: Consider the one-dimensional random walk X n : as it evolves (at each unit of time), it either increases by one with probability p or resets to 0 with probability 1 − p . In the present paper, we analyze the law of the height statistics H n , corresponding to our model X n . Also, we prove that the limiting distribution of the walk X n is a shifted geometric distribution with parameter 1 − p and ﬁnd the closed forms of the mean and the variance of X n using the probability-generating function


Introduction
Let (X n ) n∈N be a discrete random walk with one dimension defined as follows: The walk starts from the origin at Time 0. After one unit of time, the process X n shifts by one positive unit with probability p ∈ (0, 1) or resets to 0 with probability 1 − p.We provide three examples of the evolution of our random walk until time n = 10: In the above examples, the height of the preceding walks are equal to 7, 4, and 2, respectively.
In this work, we are interested in analyzing the height statistics, denoted by H n , of the random walk X n .Our analysis of the height is based on the combinatorial analysis of the coefficient a (n, r, k) = Card I n, r, k , representing the number of ways to choose r distinct integers n 1 , • • • , n r satisfying the following conditions: Our contribution in this current paper is finding a closed form of the distribution of the height statistics H n using a combinatorial analysis of the coefficient a (n, r, k) and the distribution of the return time N n of the random walk X n .The closed form of the probability distribution of H n is given by: Furthermore, we study the statistical properties of the random walk X n , like the mean, the variance, and the limiting distribution of X n .Precisely, we prove that the limiting distribution of the random walk X n is a shifted geometric distribution with parameter 1 − p, and we give the closed forms of the mean and the variance of X n .
This analysis of the height statistics is very important, and it is applicable to many aspects of renewable energy.For example, electricity today plays a very important role in daily activities and is very essential for transport, education, healthcare, and many other sectors.For this reason, controlling electricity consumption is necessary and is performed by estimating the maximum amount of electricity consumption.Electricity consumption is estimated via statistical methods such as time series models [1,2], regression models [3], and ARIMA models [4].Furthermore, this maximum amount is similar to the height of the electricity consumption in a given period of time.
In the literature, the statistical properties of the height statistics are studied in one dimension via the kernel method and singularity analysis (see [5,6]).For example, we can mention the distribution of the ranked heights of the excursions of a Brownian bridge, investigated by Pitman and Yor in [7].Similarly, Csaki and Hu analyzed the asymptotic properties of ranked heights in Brownian excursions in [8].Also, Csaki and Hu analyzed the lengths and heights of random walk excursions in [9].Furthermore, Katzenbeisser and Panny studied the maximal height of simple random walks, which were revisited in [10].In addition, Banderier and Nicodème [11] studied the height of discrete bridges/meanders/excursions for bounded discrete walks.Also, Aguech, Althagafi, and Banderier in [12] analyzed the height of walks with resets and the Moran model.This paper is organized as follows.In Section 2, we introduce our model in detail and define the return time and the height statistics, denoted by H n , of our random walk X n .In Section 3, we present our main result concerning the distribution of the height statistics of the random walk X n .In Section 4, we use the R program to find all possibilities of the integers n 1 , . . ., n r satisfying the conditions defined in Equation ( 4) and compute the combinatorial coefficient for different values of n, r, and k.In Section 5, we prove that the limiting distribution of the random walk X n is a shifted geometric distribution with parameter 1 − p.Also, we use the probability-generating function of the random walk X n to obtain their mean and variance.In Section 6, we present some conclusions concerning our results and some perspectives.

Definitions and Presentation of the Model
In this section, we define an elegant tool called the probability-generating function, which plays an important role in finding the mean and variance of the random walk.Next, we present our model: a one-dimensional random walk.Finally, we finish this section by providing definitions of some statistics like the return time and the height.
Let U be a discrete random variable with distribution P(U = r) = p r , r ∈ N. The probability-generating function, denoted by G, of the variable U is defined by: The probability-generating functions constitute an elegant tool to study the statistical characteristics of a random walk.Precisely, the probability density functions associated with discrete stochastic processes and their moments can be obtained from the derivatives of the probability-generating function.In fact, we can obtain the closed forms of the mean and the variance of the process if we derive the probability-generating function, at u = 1.For more details, see [6,13,14].
Furthermore, we introduce the following important equations, which are related to the mean and variance of U and G U (u): Consider the one-dimensional random walk X n .It starts from 0 at Time 0 (i.e., X 0 = 0), parameterized by a probability p ∈ (0, 1).It is given by the following system: where p ∈ (0, 1).We denote by the statistics N n the number of return times of the random walk X n to 0 up to time n and H n the height of the random walk X n :

Main Result
The goal of this section is to obtain the distribution of H n .To reach this goal, we apply at first a very important result concerning the distribution of the return time N n of the random walk X n (see Theorem 3 in [15]).For the second setup, we analyze the joint distribution of (H n , N n ) using the conditional probability and the marginal distribution of the return time N n .Finally, we deduce the marginal distribution of H n .Now, we present a very important result concerning the distribution of the return time, N n , of the random walk X n .Lemma 1 ([15]).The exact distribution of N n is given by Consider the following event H n ≤ k|N n = r representing the height statistics H n , bounded by k, given that the return time N n equals r of the random walk X n : where G i are i.i.d.geometric random variables with parameter 1 − p and such that n 0 = 1 and n r+1 = n.We define the combinatorial coefficient a n,r,k : representing the number of ways to choose r distinct integers n 1 , • • • , n r satisfying the conditions in Equation ( 4).

Remark 1.
The combinatorial coefficient a n,r,k depends on the parameters n, r, and k, where n represents the length of the random walk X n and a k integer less than n.
We present a closed form of the combinatorial coefficient a n,r,k in the next lemma.
Lemma 2. The coefficient a n,r,k is given by where [z m ]G(z) stands for the coefficient of z m in the power series G(z).
, and then: Remark 2. From Equation ( 6), the combinatorial coefficient a n,r,k is the coefficient of z n−r−1 in the power series G(z).
Next, we give some results about the height H n of the random walk X n .It represents the maximal height attained by the walk X n , in all of the past from 1 to n.This means that, for all n and for all k ≤ n, the values of X n are between 0 and k.For this purpose, firstly, we compute the joint distribution of the discrete return time N n and the height H n of the random walk X n .Secondly, for all k ∈ {0, . . ., n − 1} and for all r ∈ {1, . . ., n − 1}, we find the conditional probability of the height H n bounded by the integer k given that the return time N n equals r.Furthermore, we determine the probability of the intersection between the events {H n ≤ k} and {N n = r}.Finally, we deduce the marginal distribution of H n .
The next theorem leads to the conditional probability that the height H n of the random walk X n is bounded by k given that the return time N n equals r.
Using the conditional probability, we obtain Thus, From Theorem 1, we deduce the joint distribution of the following events {N n = r} and {H n ≤ k}.
Corollary 1.The joint distribution of (N n , H n ) satisfies the following relation: where a (n, r, k) is defined in Lemma 1.
Proof.One has Applying Lemma 1 and Theorem 1, we obtain where a (n, r, k) is defined in Lemma 1.
We deduce here some information about the distribution of H n .By summing over r in Equation ( 7), we obtain the marginal distribution of H n , as follows: Corollary 2. The probability distribution of the height statistics H n of the random walk X n is given by the following equation: where I n,r,k is defined in Equation (4).

Simulation of the Combinatorial Coefficient a n,r,k
In this section, we use the R program to compute the combinatorial coefficient a (n, r, k) for different values of n, r, and k.In the first case, we find the value of the coefficient a n,r,k and count all the possibilities of the integers n 1 , . . . ,n r for n = 7, k ∈ {2, 3} and r ∈ {4, 5, 6}.In the second case, we determine the possibilities of the integers n 1 , . . ., n r for n = 5, k ∈ {2, 3} and r ∈ {3, 4}.Also, we list the values of the combinatorial coefficient a n,r,k for different values of n (4, 5, 6, and 7), r (2, 3, 4, and 5), and k (2, 3, 4, 5, and 6).
In Table 1, we find all the possibilities of the integers n 1 , . . ., n r under the conditions defined in Equation ( 4) for different values of r and k when n equals 7 and compute the corresponding combinatorial coefficient a n,r,k .Precisely, in the first case, when n and k are fixed at 7 and 2, respectively, and the number r takes values of 4, 5, and 6, then the combinatorial coefficient a n,r,k takes the values 17, 12, and 7.This means that, when r increases, then the coefficient a n,r,k decreases.In the second case, if n and k equal 7 and 2 and r increases from 2 to 3, then the coefficient a n,r,k increases from 12 to 18, respectively.This means that the coefficient a n,r,k increases when k increases.Also, from Table 1, we observe that a n,r,k is fixed at 7 when r is near n and k byat least 2 (r = 6 and k ≥ 2).Table 2 lists all the possibilities of the integers n 1 , . . ., n r under the conditions defined in Equation ( 4) for different values of r and k when n equals 5. Also, we deduce the value of the combinatorial coefficient a n,r,k for each list.Furthermore, Table 2 shows two cases of the increasing of the combinatorial coefficient a n,r,k , which depends on the parameters r (the number of integers n 1 , . . ., n r ) and h (the bound of the height H n of the random walk X n ).Precisely, in the first case, when n and k are fixed at 5 and 2 and r increases from 3 to 4, then the combinatorial coefficient a n,r,k decreases from 8 to 5.This means that the coefficient a n,r,k decreases when r increases.In the second case, if n and r are equal to 5 and 3 and k increases from 2 to 3, then the coefficient a n,r,k increases from 8 to 10, respectively.This means the coefficient a n,r,k increases when k increases for fixed n and r.Table 3 shows that the combinatorial coefficient a n,r,k depends on the three parameters n, r, and K. Precisely, this coefficient is increasing or decreasing if the parameters n, r, and p change.From Table 3, we distinguish three cases concerning the computation of a n,r,k : In the first case, when n is increasing, r and k are fixed, then we observe that the coefficient a n,r,k increases.For example, if n takes values of 4, 5, 6, and 7 and r and k equal 2 and 4, then a n,r,k takes values of 6, 10, 14, and 16, respectively.Sometimes, this increasing of a n,r,k is very quick, and it takes values of 4, 5, 15, and 32 when n takes values of 4, 5, 6, and 7 and r and k equal 4 and 3, respectively.But, sometimes, a n,r,k decreases under the same conditions.For example, a n,r,k takes values of 5, 5, 3, and 1 when n equals 4, 5, 6, and 7 and r and k equal 2.
In the second case, the combinatorial coefficient a n,r,k decreases or increases when n and k are fixed but r increases.This means that there exists a maximal coefficient a n,r,k for special values of n, r, and k.Firstly, if n equals 5, k equals 3, and r takes values of 2, 3, and 4, then the coefficient a n,r,k increases from 9 to 10 and decreases to 5, respectively.Secondly, the coefficient a n,r,k increases from 3 to 11 and decreases to 6 when n equals 6, k equals 2, and r takes values of 2, 3, 4, and 5. Finally, the coefficient a n,r,k increases from 16 to 35 and decreases to 21 when n equals 7, k equals 4, and r takes values of 2, 3, 4, and 5.
In the third case, the combinatorial coefficient a n,r,k increases when n and r are fixed, but k increases.This means that a n,r,k and k are proportionally related.Firstly, if n equals 5, r equals 3, but k takes values of 1, 2, 3, and 4, then the coefficient a n,r,k equals 1, 8, 10, and 10, respectively.Secondly, if n equals 6, r equals 4, but k takes values of 2, 3, and 4, then the coefficient a n,r,k equals 11, 15, and 10, respectively.Finally, if n equals 7, r equals 3, but k takes values of 2, 3, 4, 5, and 6, then the coefficient a n,r,k equals 6, 25, 33, 35, and 35, respectively.
Furthermore, Table 3 shows that there exists a maximal combinatorial coefficient a n,r,k for special values of n, r, and k.Firstly, a n,r,k equals 6 when n = 4, r = 2, and k increases from 3 to n.Secondly, a n,r,k equals 10 when n = 5, r = 2, and k increases from 4 to n or r = 3 and k increases from 3 to n. Next, a n,r,k equals 20 when n = 6, r = 3, and k increases from 4 to n.Finally, a n,r,k equals 35 when n = 7, r = 3, and k increases from 5 to n or r = 4 and k increases from 4 to n.
Finally, we observe a very nice property of the combinatorial coefficient a n,r,k .This property depends on the parity of n and the length of the random walk X n .Precisely, we mention that, if n is an even number, r equals (n/2), and k takes any value from r + 1 to n, then a n,r,k is maximal.For example, when n = 4, r = 2, and 3 ≤ k ≤ 4 or n = 6, r = 3, and 4 ≤ k ≤ 6, the combinatorial coefficient a n,r,k is maximal and equals 10 and 20, respectively.But, if n is an odd number, r equals n−1 2 and k takes any value from r + 2 to n or r equals n+1 2 and k takes any value from r to n, then a n,r,k is maximal.For the first example, when n = 5, r = 2, and 4 ≤ k ≤ 5 or r = 3 and 3 ≤ k ≤ 5, the combinatorial coefficient a n,r,k is maximal and equals 10.For the second example, when n = 7, r = 3, and 5 ≤ k ≤ 7 or r = 4 and 4 ≤ k ≤ 7, the combinatorial coefficient a n,r,k is maximal and equals 35.We perform the computation of the combinatorial coefficient a n,r,k for different values of the parameters n, r, and k by the following setups: First setup: 1.
We fix the three parameters n, r, and k; 2.
we initialize the combinatorial coefficient a n,r,k to 0; 3.
We fix the integers (n 1 , . . ., n r ) to (1, . . ., r), then we guarantee that the difference between two consecutive integers is less than k; 4.
We change n r by a value from r + 1 to n, and we stop if n r − n r−1 > k; 5.
When n r − n r−1 ≤ k, then a n,r,k ← a n,r,k + 1.
We change n r+1 by a value from r + 2 to n, and we stop if a n,r,k ← a n,r,k + 1.
We repeat the same procedure from the first and second setups; 2.
a n,r,k ← a n,r,k + 1.If n 2 − n 1 > k, we stop the procedure in the third setup.
We repeat the preceding setups for n 1 from 2 to an integer c such that c − 1 = k; 2.
a n,r,k ← a n,r,k + 1.

Distribution of the Random Walk X n
In this section, we analyze some statistical properties like the limiting distribution, the mean, and the variance of the random walk X n using a very nice tool called the probability-generating function.Firstly, we find the relation between the probabilities of the random walk X .at two consecutive times n and n + 1 using the conditional probability.Secondly, we determine a recursive equation between f n (x) and f n+1 (x), where f n (x) = E x X n represents the probability-generating function of X n .Next, we use f n (x) to prove that the random walk X n converges to a shifted geometric distribution with parameter 1 − p asymptotically.Also, we derive f n (x) to obtain the mean and the variance of the random walk X n .Start by the definition of the probability mass function of X n .Denote, for all r ∈ {0, . . ., n + 1}, P n+1 (r) = P(X n+1 = r).
The following lemma presents the recursion of the probabilities.
Lemma 3.For all n ≥ 0, we have Proof.This proof is based on the utility of the conditional probability that the Moran walk X .equals r at time n + 1 given that it equals l at time n, then: 1.
For r ≥ 1, we have For r = 0, we have Next, we define the sequence of polynomials f n (x) (for n ∈ N) by the fact that the coefficient of x r in f n (x) is the probability that, at time n, the position of the process X . is at level r, that is From Equation ( 9) and Lemma 3, we deduce a recursive equation relating f n+1 (x), f 0 (x), and f n (x).It is presented in the next proposition.Proposition 1.For all x ∈ R, the explicit expression of the sequence of polynomials f n (x) satisfies the following recurrence: with the initial condition f 0 (x) = P 0 (0) = 1.
Proof.Using Equation ( 9) and for all n ≥ 1, the function f n+1 (x) can be developed as: x r P n+1 (r).
Due to Lemma 3, we have: x r P n+1 (r) = p x f n (x).
Now, we use Equation (10) to show that the random walk X n converges to a shifted geometric distribution with parameter 1 − p asymptotically.It is introduced in the next theorem.
Theorem 2. The limiting distribution of the process X n converges to a shifted geometric distribution with parameter 1 − p, with a probability-generating function given by the following: for all n ≥ 0, for all x ∈ R, such that |1 − p x| < 1.
Proof.Iterating the recursive equation defined in (10) n times, we obtain and passing to the limit of f n (x), then we have this is exactly the generating function of a shifted geometric distribution with parameter 1 − p.
To derive the probability-generating function f n (x) given in Theorem 2, we deduce the closed expressions of the mean and the variance of the random walk X n .
Corollary 3. The mean and the variance of the random walk X n are given by Proof.The first derivative of f n (x) defined in Equation (11) with respect to x: Using Equation (1), we obtain To derive the variance of X n , we need to define the following sequences of functions: Observe that the first and second derivatives of f n (x) are given by The first derivative of K n (x) and L n (x) with respect to x at x = 1 is given by Combining Equations ( 14)-( 16), we obtain Applying Equations ( 1), (12), and (17), we obtain

Conclusions and Perspectives
In this current paper, we stated our main result concerning the height of the random walk X n .Precisely, we found the joint distribution between the height and the return time statistics.This is given by the following formula: P(H n ≤ k, N n = r) = a (n, r, k) (1 − p) r p n−r P(N n = r), where a (n, r, k) is a combinatorial coefficient.Also, we analyzed this coefficient numerically using the R program and took some properties: 1.
If n increases and r and k are fixed, then the combinatorial coefficient a (n, r, k) increases; 2.
The combinatorial coefficient a n,r,k decreases or increases when n and k are fixed, but r increases.This means that there exists a maximal coefficient a n,r,k for special values of n, r, and k; 3.
The combinatorial coefficient a n,r,k increases when n and r are fixed, but k increases.This means that a n,r,k and k are proportionally related.
Also, we observe from Table 3 a very nice property of the combinatorial coefficient a n,r,k .This property depends on the parity of n and special values of r and k.Precisely, we mention that, if n is an even number, r equals (n/2), and k takes any value from r + 1 to n, then a n,r,k is maximal.But, if n is an odd number, r equals n−1 2 , and k takes any value from r + 2 to n or r equals n+1 2 and k takes any value from r to n, then a n,r,k is maximal.Furthermore, we studied the statistical properties of the random walk X n like the limit distribution, the mean, and the variance.Firstly, we found the closed form of the probability-generating function of the random walk X n from the recursive equation defined in Equation (10).Next, we proved that the limiting distribution of X n is a shifted geometric distribution with parameter 1 − p. Finally, we derived the probability-generating function of X n to obtain the closed forms of the mean and the variance of X n .In the next work, we plan to work on the following questions: 1.
Can we find a closed form of the probability-generating function of the height?2.
Can we explicitly calculate the mean and variance of the height statistics using the probability-generating function of H n ?

such that n 1 =
1 and n r = n and based on the probability distribution of the return time, denoted by N n , of the random walk X n , given by P(N n = r) = p n 1 −

Table 3 .
The combinatorial coefficient a (n,r,k) for different values of n.