WorksMathematics
Longest run for -binary trials
Abstract
We investigate the longest-run distribution for binary trials in which the success probability varies geometrically. Exact formulae are derived for the probability mass function and the cumulative distribution function of the length of the longest success run in a sequence of -binary trials, using enumerative combinatorics. The setting covers independent but not necessarily identically distributed zero–one trials whose success probabilities follow a geometric rule, and the classical independent and identically distributed Bernoulli longest-run distribution is recovered in the limit . A simulation study confirms accurate maximum likelihood estimation of the base success probability and the geometric parameter , a well-calibrated and powerful boundary-corrected likelihood ratio test of the hypothesis that , and close agreement between the analytical cumulative distribution function and its empirical counterpart.
Introduction
Charalambides [13] investigated discrete -distributions arising from Bernoulli trials in which the probability of success varies geometrically. Let us consider a sequence consisting of Bernoulli trials that result in either zero (failure) or one (success). The trials within each subsequence, starting immediately after the st zero and continuing up to the th zero, are independent and share the same probability of failure. For , the subsequence of trials that begins after the zero at position forms the th geometric sequence. For the th geometric sequence, the probability of zero remains unchanged throughout all trials and is defined as
According to the standard definitions, it follows from equation (1) that, for , the success probability decreases geometrically. Let denote the number of zeros in the first trials. The probability of observing zeros in the th geometric sequence of trials corresponds to the conditional probability , which represents the conditional probability of occurrence of a zero at trial given that exactly zeros have occurred in the preceding trials. This relationship can be formally expressed as follows.
To clarify the previous discussion, consider the sequence 111011110111100110 for . The geometric rule indicates that each bracketed subsequence has its own success and failure probabilities, as illustrated in Figure 1.
Figure 1. A -binary sequence of length , partitioned into geometric subsequences with failure probabilities
This stochastic model (1) or (2) has interesting applications, studied as a reliability growth model by Dubman and Sherman [16], and applies to a -boson theory in physics by Jing and Fan [25] and Jing [26]. The stochastic model (1) is applicable to start-up demonstration tests, functioning as a sequential-intervention model as introduced by Balakrishnan et al. [6].
The stochastic model (1) represents the -analog of the traditional binomial distribution, where the probabilities of zeros change geometrically. This establishes a stochastic framework for independent and identically distributed (IID) trials characterized by a failure probability function defined as follows:
where .
When approaches 1, the stochastic model described in (1) simplifies to the IID (Bernoulli) model given in (3). This occurs because converges to for , or converges to for and .
Numerous scholars have explored discrete -distributions, which arise from the stochastic framework of independent Bernoulli trials. Those interested in a detailed examination and extensive bibliography on this subject should refer to the papers by Charalambides [14] and the monograph by Charalambides [15] for further reading.
From a Mathematical and Statistical point of view, Charalambides [15] mentioned in the preface of his book “It should be noticed that a stochastic model of a sequence of independent Bernoulli trials, in which the probability of success at a trial is assumed to vary with the number of trials and/or the number of successes, is advantageous in the sense that it permits incorporating the experience gained from previous trials and/or successes. If the probability of success at a trial is a very general function of the number of trials and/or the number successes, very little can be inferred from it about the distributions of the various random variables that may be defined on this model. The assumption that the probability of success (or failure) at a trial varies geometrically, with rate (proportion) , leads to the introduction of discrete -distributions”.
In recent decades, the distribution theory of runs and patterns has been extensively developed, inspired by the foundational studies of Philippou and Muwafi [37], Philippou et al. [36], and Aki et al. [1]. This area of research has gained attention due to its theoretical significance and its wide-ranging applications in fields such as hypothesis testing, system reliability, quality control, physics, psychology, radar astronomy, molecular biology, computer science, insurance, and finance. These developments have been reviewed by Balakrishnan and Koutras [9] and Fu and Lou (2003), along with the references cited therein. Additionally, more recent contributions to this field include the works of Arapis et al. [3], Eryilmaz [19], Kong [28], Makri et al. [33], Aki [2], Gera [23], and Gera [24].
The random variable of interest is , the length of the longest success run in a sequence of trials; we write when no confusion arises. Longest runs are important as they represent extreme values within the spectrum of run lengths. Let denote the number of runs of type () and represent the length of the th run of successes (failures) in . In addition, let denote the longest run of type (). To further elaborate, consider a fixed number .
For clarity, using an example, we mention that a sequence of ten trials is 0011110110. We have , , , and . Burr and Cane [7] studied the exact expression for the distribution of the longest run for IID Bernoulli trials. Fu and Koutras (1994) obtained the distribution of the longest run using a Markov-chain embedding technique. In contrast, Fu [22] developed a finite Markov-chain embedding technique to derive the exact distribution of in sequences of multistate trials. Lou [30] investigated the joint distribution of the length of the longest success run and the number of successes as well as the conditional distribution of the longest-success-run length given the number of successes in sequences of Bernoulli trials. Asymptotic results for the longest-run statistics in a multistate Markov chain were explored by Vaggelatou [43]. Meanwhile, Makri et al. [34] derived the exact probability function of the longest-run statistics for linear and circular sequences through combinatorial analysis. Numerous researchers have contributed to studying longest-run statistics in various scenarios, including Bernoulli trials, Markov-dependent trials, and exchangeable binary trials. For further insights, refer to works such as those by Philippou and Makri [38, 39, 40], Antzoulakos and Philippou [4, 5], Charalambides [11], Serkan [41]; Eryilmaz [17, 18], and Muselli [35].
As mentioned by Johnson et al. [27], “The formulas for the probabilities for these distributions are not at first sight very illuminating; also in some cases, there is more than one correct published expression for the probabilities.” Fu and Koutras (1994) mentioned that some formulas are complicated and hard to compute. In this paper, we derive explicit probability functions for the longest success run in binary trials whose success probabilities vary according to a geometric rule. Our results provide a direct longest-run formulation based on enumerative combinatorics and are complemented by numerical verification and statistical inference for the model parameters.
Herein, we study the distribution of the length of the longest success run, with the probability of ones varying according to a geometric rule. The paper is organized as follows. In § 2 we introduce basic definitions and necessary notations that will be useful throughout this article. In Section 3 we shall study the probability mass and cumulative distribution functions of the length of the longest success run. We derive the exact probability function and the cumulative distribution function (CDF) of the longest-success-run length through combinatorial analysis, and illustrate these results numerically for indicative parameter values. In § 6, we conduct a simulation study to assess the accuracy of the maximum likelihood estimator of , to evaluate the size and power of a boundary-corrected likelihood ratio test of , and to compare the derived analytical cumulative distribution function of the longest-success-run length with its empirical counterpart.
Terminology and notation
We first recall some definitions, notations, and known results, which will be used in this paper. Throughout the paper, we suppose that . First, we introduce the following notation.
: the length of the longest run of successes in ;
: the length of the longest run of failures in ;
: the total number of successes in ;
: the total number of failures in .
We write and for . For and integers , the -binomial coefficient (Gaussian polynomial) is
and the case is understood in the limiting sense . Let us consider again a sequence of independent geometric sequences of trials with probability of failure at the th geometric sequence of trials given by (1) or (2). We now focus on the number of successes in a given number of trials in this stochastic model.
Definition 2.1 Let be the number of successes in a sequence of independent Bernoulli trials, with probability of failure at the th geometric sequence of trials given by (1) or (2). The distribution of the random variable is called -binomial distribution, with parameters , , and .
We now introduce a -analog of the binomial distribution. The probability function of the number of successes in trials is given by
for and . The distribution is called a -binomial distribution. For , because
so that the -binomial distribution converges to the usual binomial distribution as , as follows
with parameters and . The -binomial distribution studied by Charalambides [14, 15] is connected with the -Bernstein polynomials. Jing [26] introduced the probability function (4) as a -deformed binomial distribution and also derived a recurrence relation for its probability distribution. In the sequel, and denote probabilities related with the stochastic model (1) and (3), respectively.
In this section, we delve into the distribution of the length of the longest success run for binary (zero and one) trials, where the probability of encountering ones follows a geometric rule. First, we derive the exact expression for the PMF , representing the distribution of the length of the longest success run. Subsequently, we obtain the cumulative distribution function for , the longest-success-run length. These results are derived through enumerative combinatorics.
Closed-form expression for the PMF of
We now present a definition and a lemma that will be used in the proofs of the theorems in the sequel.
Definition 3.1 For , we define
where the summation is over all integers satisfying
The following gives a recurrence relation useful for the computation of .
Lemma 3.1 For , obeys the following recurrence relation.
Proof. For , and , we observe that since can assume the values , then can be written as follows.
Using simple algebraic arguments to simplify, then can be rewritten as follows.
The other cases are obvious and thus the proof is completed.
Remark 3.1 We observe that is the number of integer solutions of
which is
denotes the number of ways of distributing identical balls into different cells while ensuring that each of cells receives exactly balls, with the remaining balls placed in the remaining cells such that no cell receives more than balls. In addition, represents the total number of integer solutions to the equation , subject to the condition for . Alternatively, indicates the number of ways of distributing identical balls into different cells while ensuring that each cell is occupied by at most balls. This number can be expressed as follows:
Here equals the displayed sum if , equals if , and equals otherwise (see, e.g., Charalambides [12]).
We shall study the distribution of the length of the longest success run. The probability mass function is obtained by the following theorem. It is evident that
and so we shall focus on determining the probability mass function for .
Theorem 3.1 The PMF , for , is given by
Proof We partition the event into disjoint events given by , for . Adding the probabilities, we have
We focus on the event . A typical element of this event, denoted as , consists of an ordered sequence comprising successes and failures such that the length of the longest success run is equal to . The number of such sequences can be derived as follows. First, we distribute the failures, forming cells. Next, we distribute the successes among these distinguishable cells in a way that satisfies the following conditions: among these cells, denoted as (), exactly successes occupy each of the specified cells. The remaining successes can then be distributed among the remaining cells, ensuring no cell receives more than successes. Thus, the event is defined as follows.
with 0’s and 1’s, where () represents a length of a run of 1’s. And all integers satisfy the conditions
Then the probability of the event is given by
Using simple exponentiation algebra arguments to simplify,
Using Lemma 3.1, we can rewrite as follows.
where
Therefore we can compute the probability of the event as follows.
Thus, proof is completed. □
It is worth mentioning here that the PMF approaches the PMF of the IID model as tends to 1. The details are presented in the following remark.
Remark 3.2 For , the PMF reduces to the PMF . Then , and for the PMF is given by
where
Here equals the displayed sum if , equals 1 if , and equals 0 otherwise (see, e.g., Charalambides [12]).
Closed-form expression for the CDF of
We now present a definition and a lemma that will be used in the proofs of the theorems in the sequel.
Definition 3.2 For , we define
where the summation is over all integers satisfying
The following gives a recurrence relation useful for the computation of .
Lemma 3.2 For , obeys the following recurrence relation.
Proof For and , we observe that since can assume the values , then can be written as follows.
Using simple algebraic arguments to simplify, then can be rewritten as follows.
The other cases are obvious and thus the proof is completed. □
Remark 3.3 We observe that is the number of integer solutions of
which is
where denotes the total number of integer solutions such that for . Alternatively, it is the number of ways of distributing identical balls into different cells so that each cell is occupied by at most balls. The number can be expressed as
Here equals the displayed sum if , equals if , and equals otherwise (see, e.g., [12]).
We shall study the cumulative distribution function of the length of the longest success run. The CDF is obtained by the following theorem.
Theorem 3.2 The cumulative distribution function of the length of the longest success run is given by
Proof. We partition the event into disjoint events given by , for . Adding the probabilities we have
We focus on the event . A typical element of this event, denoted as , consists of an ordered sequence comprising successes and failures such that the length of the longest success run is less than or equal to . The number of such sequences can be derived as follows. First, we distribute the failures, forming cells. Next, we distribute the successes among these distinguishable cells, ensuring that each cell is occupied by at most successes. Thus, the event is defined as follows:
, with 0’s and 1’s, where () represents a length of a run of 1’s. In addition, all integers satisfy the conditions
Then the probability of the event is given by
Using simple exponentiation algebra arguments to simplify,
Using Lemma 3.2, we can rewrite as follows.
where
Therefore we can compute the probability of the event as follows.
Thus proof is completed. □
It is worth mentioning here that the CDF approaches the CDF of the IID model in the limit as tends to 1. The details are presented in the following remark.
Remark 3.4 For , the CDF reduces to the CDF , which is given by
where
Here equals the displayed sum if , equals 1 if , and equals 0 otherwise (see, e.g., Charalambides (2002)).
Remark 3.5 Let denote the number of success runs of length at least in a -sequence, as studied by Makri and Psillakis [32]. Since
we have
Thus, the CDF of the longest success run can also be expressed as a zero-count probability from the distribution of . The expression in Theorem 3.2 therefore provides an alternative closed-form representation of this CDF directly in terms of the longest-run statistic.
Remark 3.6 Using CDF in Theorem 3.2 an alternative expression for the th raw moment (alternatively the th uncorrected moment or the th moment about zero) is given by
which is directly computable, as is finite.
Numerics
Some numerics are next presented, computed by implementation of the PMF and CDF of obtained in Theorems 3.1 and 3.2. Table 1 depicts the PMF , the mean and variance , while Table 2 depicts the CDF , for and for the indicative values , .
| , | ||||||||||
| 3 | 0.25 | 0.25 | 0.6921 | 0.2424 | 0.0498 | 0.0156 | – | – | 0.3889 | 0.4310 |
| 3 | 0.25 | 0.75 | 0.5237 | 0.3875 | 0.0732 | 0.0156 | – | – | 0.5808 | 0.4837 |
| 3 | 0.75 | 0.25 | 0.1936 | 0.2351 | 0.1494 | 0.4219 | – | – | 1.7996 | 1.3912 |
| 3 | 0.75 | 0.75 | 0.0632 | 0.2952 | 0.2197 | 0.4219 | – | – | 2.0002 | 0.9700 |
| 5 | 0.25 | 0.25 | 0.6888 | 0.2448 | 0.0505 | 0.0119 | 0.0029 | 0.0010 | 0.3984 | 0.4672 |
| 5 | 0.25 | 0.75 | 0.4314 | 0.4500 | 0.0951 | 0.0187 | 0.0039 | 0.0010 | 0.7165 | 0.5711 |
| 5 | 0.75 | 0.25 | 0.1908 | 0.2305 | 0.1540 | 0.1081 | 0.0794 | 0.2373 | 2.3668 | 3.4205 |
| 5 | 0.75 | 0.75 | 0.0330 | 0.2148 | 0.2443 | 0.1665 | 0.1041 | 0.2373 | 2.8060 | 2.4158 |
Table 1. PMF , mean and variance , for and .
| , | ||||||||
| 3 | 0.25 | 0.25 | 0.6921 | 0.9346 | 0.9844 | 1.0000 | – | – |
| 3 | 0.25 | 0.75 | 0.5237 | 0.9111 | 0.9844 | 1.0000 | – | – |
| 3 | 0.75 | 0.25 | 0.1936 | 0.4287 | 0.5781 | 1.0000 | – | – |
| 3 | 0.75 | 0.75 | 0.0632 | 0.3584 | 0.5781 | 1.0000 | – | – |
| 5 | 0.25 | 0.25 | 0.6888 | 0.9336 | 0.9841 | 0.9961 | 0.9990 | 1.0000 |
| 5 | 0.25 | 0.75 | 0.4314 | 0.8814 | 0.9765 | 0.9952 | 0.9990 | 1.0000 |
| 5 | 0.75 | 0.25 | 0.1908 | 0.4212 | 0.5752 | 0.6833 | 0.7627 | 1.0000 |
| 5 | 0.75 | 0.75 | 0.0330 | 0.2477 | 0.4920 | 0.6586 | 0.7627 | 1.0000 |
Table 2. CDF , for and .
The mean and variance are obtained using the CDF from the -th moment formula (6).
For instance, for , , Theorem 3.1 gives , and (Table 1), so that , in agreement with the value obtained directly from Theorem 3.2 and reported in Table 2. Moreover, by (6) with ,
which coincides with the entry of Table 1.
The entries of Table 1 and Table 2 illustrate the effect of , and on the distribution of . For fixed and , the expected longest success run length increases substantially as increases from to , reflecting the larger mass placed on longer runs. For fixed and , it also increases with , though less markedly than with . For fixed and , the mean increases slightly with , except when , where the increase from to is considerable, as a longer sequence affords substantially more room for extended runs. Interestingly, does not follow the mean’s pattern uniformly in . For , it increases with (as does the mean), whereas for it decreases as increases from to , e.g., from to for , indicating that the higher success probability concentrates the distribution of around its larger mean rather than spreading it out further.
Figure 2 and Figure 3 display the CDF and PMF of , respectively, for and the four combinations of reported in Table 1 and Table 2. The plots corroborate the observations above: the CDF curves for lie visibly below those for over most of the support of , indicating a stochastically larger longest success run length, and the corresponding PMF curves are shifted, and less peaked, toward larger values of .
Figure 2. CDF of the longest success run length , for and .
Figure 3. PMF of the longest success run length , for and . The function is defined only at integer and the connecting lines serve only as visual guides.
Simulation study
In this section, the distributional results established in Theorems 3.1 and 3.2 are verified by means of a simulation study. Three aspects are investigated: the accuracy of the maximum likelihood estimator of the parameter vector , the power of the likelihood ratio test of the hypothesis against the alternative , and the pointwise agreement between the analytical and empirical cumulative distribution functions of . The study is conducted over a grid of parameter values , , and sequence lengths , yielding twelve parameter configurations in total. For each configuration, independent -binary sequences of length are generated according to Algorithm 1 below, and the length of the longest success run is recorded from each sequence, yielding a random sample of size per replicate dataset. The configurations with correspond to interior parameter values, while lies at the boundary of the parameter space , where the -binary model reduces to a sequence of independent and identically distributed Bernoulli trials with success probability .
Maximum likelihood estimation
Let be an observed random sample of longest success run lengths from a -binary sequence of length . The log-likelihood function for the parameter vector is
Algorithm 1 Simulation of independent realisations of from -binary trials of length
Require: , , ,
for do
Set , ,
for do
Generate
if then
Set , ,
else
Set , ,
end if
end for
Output
end for
where is given by Theorem 3.1. The maximum likelihood estimator is the value of that maximises (7) over the parameter space . The evaluation of (7) requires repeated computation of , which depends on the recursive function defined in Lemma 3.1, posing numerical challenges for maximization. To reduce the number of likelihood evaluations, the maximization proceeds in two stages: a grid search over a uniform grid on provides an initial estimate, which is subsequently refined by the
Limited-memory Broyden–Fletcher–Goldfarb–Shanno algorithm with box constraints [10]. As no closed form for the gradient of the log-likelihood is available, it is approximated numerically via finite differences with Richardson extrapolation [8].
For the interior parameter values, , the maximum likelihood estimator satisfies the standard regularity conditions and is asymptotically normally distributed [29],
where is the expected Fisher information matrix. Asymptotic confidence intervals for and are therefore constructed only for interior configurations. They are obtained from the observed Fisher information matrix , which is a consistent estimator of [29] and is approximated numerically via Richardson extrapolation. Specifically, the asymptotic 95% confidence interval for is , and analogously for , where denotes the -th diagonal entry of the inverse of the observed Fisher information matrix.
At the boundary , the standard regularity conditions for asymptotic normality are not satisfied [29], but the MLE remains consistent.
The performance of the estimator is assessed over replicate datasets for each of the twelve parameter configurations. For each configuration, we report the root mean squared error (RMSE)
For the configurations in the interior of the parameter space, the empirical coverage of the asymptotic 95% confidence interval is also reported. The same quantities are computed for . The results are presented in Table 3 and illustrated in the scatter plots of Figure 4.
Figure 4. Joint distribution of the maximum likelihood estimates () across 1000 replicate datasets, each consisting of 1000 longest success run lengths recorded from simulated -binary sequences of length . Top: ; bottom: . True parameter values are indicated by the cross markers
| RMSE() | RMSE() | Asymp. 95% CI coverage () | Asymp. 95% CI coverage () | |||
| 10 | 0.25 | 0.25 | 0.0162 | 0.0664 | 0.962 | 0.95 |
| 10 | 0.25 | 0.75 | 0.0193 | 0.0312 | 0.941 | 0.943 |
| 10 | 0.25 | 1 | 0.0159 | 0.0169 | – | – |
| 10 | 0.75 | 0.25 | 0.00697 | 0.0409 | 0.956 | 0.947 |
| 10 | 0.75 | 0.75 | 0.00777 | 0.0146 | 0.949 | 0.949 |
| 10 | 0.75 | 1 | 0.0067 | 0.0059 | – | – |
| 20 | 0.25 | 0.25 | 0.0173 | 0.0701 | 0.947 | 0.937 |
| 20 | 0.25 | 0.75 | 0.0164 | 0.0221 | 0.952 | 0.951 |
| 20 | 0.25 | 1 | 0.0175 | 0.0097 | – | – |
| 20 | 0.75 | 0.25 | 0.00684 | 0.0417 | 0.954 | 0.949 |
| 20 | 0.75 | 0.75 | 0.00745 | 0.0136 | 0.955 | 0.934 |
| 20 | 0.75 | 1 | 0.0067 | 0.0035 | – | – |
Table 3. Root mean squared error of and and empirical coverage of the asymptotic 95% confidence intervals across replicate datasets, each consisting of longest success run lengths recorded from simulated -binary sequences of length , for , , and . Dashes indicate that asymptotic confidence intervals are not constructed at the boundary .
The entries of Table 3 show that RMSE is small throughout, including at the boundary , confirming consistency of the MLE across all configurations. For the interior configurations, is consistently more precise than , with the discrepancy most pronounced at . This reflects the fact that strong geometric decay in the success probability is harder to distinguish from moderate decay on the basis of the longest run alone. The empirical coverage of the asymptotic 95% confidence intervals is close to the nominal level for both parameters across all interior configurations. As asymptotic normality holds in the limit for interior parameter values, the coverage is not expected to be exact at any finite . The results confirm that at the normal approximation is adequate. These findings are corroborated by Figure 4, which displays the joint distribution of across replicates.
For the interior configurations, the estimates are centred near the true values in all panels, with the spread along the axis visibly wider than along the axis, and the approximately elliptical shape of the point clouds is consistent with the bivariate normal limiting distribution established in (8). For the boundary configurations , the estimates of accumulate near the upper boundary of the parameter space, producing the asymmetric, non-elliptical point clouds visible in the rightmost column of Figure 4, as expected when the true parameter lies on the boundary.
Likelihood ratio test of
A natural question in practice is whether the observed longest success run lengths are consistent with a standard sequence of independent and identically distributed Bernoulli trials, or whether the geometric variation in the success probability characteristic of the -binary model is supported by the data. This is formalized as the hypothesis testing problem
where under the -binary model reduces to a sequence of IID Bernoulli trials with success probability , which remains a free nuisance parameter. The likelihood ratio test statistic is
where is the restricted maximum likelihood estimator of under , obtained by maximizing the log-likelihood with fixed at 1.
Because lies on the boundary of the parameter space , the likelihood ratio does not asymptotically follow a chi-squared distribution with degree 1, denoted as , under as [42]. Instead, the null distribution of is the equal-weight mixture
where denotes a point mass at zero. The boundary-corrected -value is accordingly
and is rejected at the nominal level when , which is equivalent to using the critical value at level .
The power of the test is examined across the eight interior configurations with , and the empirical size is verified at the four boundary configurations with . The results are summarized in Table 4, which reports the mean and standard deviation of , the mean and maximum boundary-corrected -value, and the rejection rate across replicates.
| Mean | SD() | Mean -value | Max -value | Rejection rate | |||
| 10 | 0.25 | 0.25 | 165.9 | 34.0 | 1 | ||
| 10 | 0.25 | 0.75 | 50.4 | 16.3 | 1 | ||
| 10 | 0.25 | 1 | 0.4 | 1 | 0.638 | 1 | 0.043 |
| 10 | 0.75 | 0.25 | 2208.4 | 159.3 | 0 | 0 | 1 |
| 10 | 0.75 | 0.75 | 571.7 | 102.8 | 1 | ||
| 10 | 0.75 | 1 | 0.5 | 1.1 | 0.628 | 1 | 0.044 |
| 20 | 0.25 | 0.25 | 255.2 | 105.9 | 0.011 | 1 | 0.989 |
| 20 | 0.25 | 0.75 | 136.8 | 84.6 | 0.057 | 1 | 0.942 |
| 20 | 0.25 | 1 | 0.3 | 1.1 | 0.698 | 1 | 0.041 |
| 20 | 0.75 | 0.25 | 3552.5 | 253.0 | 0 | 0 | 1 |
| 20 | 0.75 | 0.75 | 1112.3 | 165.6 | 1 | ||
| 20 | 0.75 | 1 | 0.5 | 1.1 | 0.640 | 1 | 0.048 |
Table 4. Summary of the likelihood ratio test of against across replicate datasets, each consisting of longest success run lengths recorded from simulated -binary sequences of length , for , , and . -values are boundary-corrected following Self and Liang [42]. Size rows correspond to ; power rows correspond to . Rejection is at the nominal level
The empirical rejection rates at are 0.043, 0.044, 0.041, and 0.048 across the four null configurations, all close to the nominal level of 0.05, confirming that the boundary-corrected test is well calibrated. For the interior configurations, the test achieves high power throughout, with rejection rates between 0.94 and 1. Overall, the results confirm that the likelihood ratio test based on the probability mass function established in Theorem 3.1 is correctly sized under and achieves high power against , as expected.
Comparison of analytical and empirical cumulative distribution functions
The cumulative distribution function established in Theorem 3.2 is assessed by comparing it pointwise against the empirical cumulative distribution function of constructed from the pooled sample of observations for each of the twelve parameter configurations. Let denote the analytical CDF given by Theorem 3.2 and the corresponding empirical CDF. Since the support of is the finite set , pointwise convergence of to at each is equivalent to uniform convergence, and the Kolmogorov-Smirnov statistic
therefore reduces to a maximum over finitely many points. As the Kolmogorov-Smirnov statistic is not distribution-free for discrete distributions, is reported as a descriptive measure of the maximum pointwise discrepancy only, without performing the Kolmogorov-Smirnov test of equality of CDFs.
Instead, formal inference is based on exact two-sided binomial tests. Let denote the true cumulative distribution function of . The pointwise hypothesis
is examined for each interior support point . Under , each observation for satisfies , so the indicators are independent Bernoulli random variables with success probability . Consequently, the count
follows a binomial distribution with parameters and under , from which an exact two-sided -value is obtained. The point is excluded as holds trivially for any distribution on . Because hypotheses of the form (4.3) are tested simultaneously on the same pooled sample, the tests are not mutually independent. The Bonferroni correction controls the family-wise error rate at level without requiring independence of the individual tests ([31]), and the family-wise rejection threshold for each individual test is accordingly with .
The results are presented in Table 5 and the analytical and empirical CDFs are displayed in Figure 5. The null hypothesis is not rejected at any support point in any of the twelve configurations. The values of are of order to throughout, reflecting negligible pointwise discrepancy between the analytical and empirical CDFs at the pooled sample size of . These results confirm the correctness of the cumulative distribution function established in Theorem 3.2 across all parameter configurations considered.
| Bonferroni threshold | Min -value | ||||
| 10 | 0.25 | 0.25 | 0.0050 | 0.0083 | |
| 10 | 0.25 | 0.75 | 0.0050 | 0.0373 | |
| 10 | 0.25 | 1 | 0.0050 | 0.2071 | |
| 10 | 0.75 | 0.25 | 0.0050 | 0.0472 | |
| 10 | 0.75 | 0.75 | 0.0050 | 0.4198 | |
| 10 | 0.75 | 1 | 0.0050 | 0.2765 | |
| 20 | 0.25 | 0.25 | 0.0025 | 0.0560 | |
| 20 | 0.25 | 0.75 | 0.0025 | 0.1683 | |
| 20 | 0.25 | 1 | 0.0025 | 0.0042 | |
| 20 | 0.75 | 0.25 | 0.0025 | 0.0173 | |
| 20 | 0.75 | 0.75 | 0.0025 | 0.0818 | |
| 20 | 0.75 | 1 | 0.0025 | 0.1112 |
Table 5. Bonferroni-corrected exact binomial test results and maximum pointwise discrepancy between the empirical CDF constructed from observations and the analytical CDF of Theorem 3.2, for , , and . The null hypothesis is not rejected in any configuration at .
Figure 5. Analytical (blue, hollow) and empirical (red, solid) cumulative distribution functions of for (top) and (bottom), constructed from observations per configuration. The two functions are visually indistinguishable in all panels
Discussion
In the present work, we introduce and study the distribution of the length of the longest success run for -binary trials. We have obtained the exact expression for the PMF of the random variable which follows a distribution. More specifically, we derive the exact expression for the PMF , representing the distribution of the length of the longest success run and the cumulative distribution function for through enumerative combinatorics. These theoretical results are further validated by a simulation study, which confirms the accuracy of maximum likelihood estimation of , the correct size and high power of a boundary-corrected likelihood ratio test of , and close agreement between the derived analytical cumulative distribution function of and its empirical counterpart.
Another random variable that is closely associated with is the , which represents the waiting time until the first occurrence of a sequence of consecutive successes. In the context of a -geometric model, the distribution of the is referred to as -geometric distribution of order , can be denoted as . Given that the event is equivalent to , we can directly establish the following
relationship
This relationship provides straightforward methods for determining the exact distribution (probability mass function) of by utilizing the formulae derived in this study for the longest run . The probability of the event can be expressed as follows.
Using dual relationship (10), we can rewrite as follows.
Using simple mathematical algebra arguments, we can rewrite as follows.
Using Formula (11) and Theorem 3.2, we can compute the PMF for a -geometric distribution of order . Alternatively, we can compute the PMF values for the -geometric distribution of order using the formulae derived by Yalcin and Eryilmaz [44] in a manner similar to that used in Theorem 3.2.
As a possible direction for future research, one could consider deriving the recursive expressions for the PMF of the RV . The preliminary results from the investigation of this RV are promising. To give a specific example, the PMF of , , satisfies for the recursive scheme
Acknowledgements
Acknowledgements. The authors would like to thank Dr. habil. Tommy Rene Jensen, whose comments led to significant improvements in this manuscript. The authors would like to thank Professor Frosso S. Makri for drawing our attention to the connection between the longest success run and the number of success runs exceeding a fixed threshold. The first author is grateful to Prof. Dr. Mihaela Zavolan and her research group at the Biozentrum, University of Basel, for hosting a research stay that significantly influenced the computational work presented in this paper.
Declarations
Funding This work was supported by the Ministry of Education of the Republic of Korea and the National Research Foundation of Korea.(NRF-2025S1A5B5A16008020)
Conflict of interest The authors have no competing interests to declare that are relevant to the content of this article.
Ethics approval Not applicable.
Consent to participate Not applicable.
Consent for publication Not applicable.
Data availability No external datasets were used. The numerical results are based on simulated -binary sequences generated as described in the simulation study.
Materials availability Not applicable.
Code availability Computational code used to evaluate the derived formulae and to run the simulation study will be made available in a public repository upon acceptance of the manuscript.
Author contribution Jungtaek Oh: conceptualization, methodology, theoretical derivation, writing (original draft), review and editing. Nurzhan Sapargali: simulation study, numerical experiments, review and editing. Both authors read and approved the final manuscript.
References
- [1]Aki, S., Kuboki, H., Hirano, K.: On discrete distributions of order k. Annals of the Institute of Statistical Mathematics 36(1), 431–440 (1984)
- [2]Aki, S.: Waiting time for consecutive repetitions of a pattern and related distributions. Annals of the Institute of Statistical Mathematics 71(2), 307–325 (2019)DOI
- [3]Arapis, A.N., Makri, F.S., Psillakis, Z.M.: Distributions of statistics describing concentration of runs in non homogeneous markov-dependent trials. Communications in Statistics-Theory and Methods 47(9), 2238–2250 (2018)DOI
- [4]Antzoulakos, D.L., Philippou, A.N.: Probability distribution functions of succession quotas in the case of markov dependent trials. Annals of the Institute of Statistical Mathematics 49(3), 531–539 (1997)DOI
- [5]Antzoulakos, D.L., Philippou, A.N.: Longest success and failure runs and new polynomials related to the fibonacci-type polynomials of order k. In: Bergum, G.E., Philippou, A.N., Horadam, A.F. (eds.) Applications of Fibonacci Numbers: Volume 7, pp. 29–38. Springer, Dordrecht (1998). https://doi.org/10.1007/978-94-011-5020-0_5 . https://doi.org/10.1007/978-94-011-5020-0_5
- [6]Balakrishnan, N., Balasubramanian, K., Viveros, R.: Note: start-up demonstration tests under correlation and corrective action. Naval Research Logistics 42(8), 1271–1276 (1995)
- [7]Burr, E., Cane, G.: Longest run of consecutive observations having a specified attribute. Biometrika 48(3/4), 461–465 (1961)DOI
- [8]Burden, R.L., Faires, J.D.: Numerical Analysis, 9th edn. Thomson Brooks/Cole Cengage Learning, Belmont, CA (2011)
- [9]Balakrishnan, N., Koutras, M.V.: Runs and Scans with Applications. Wiley, New York (2002)
- [10]Byrd, R.H., Lu, P., Nocedal, J., Zhu, C.: A limited memory algorithm for bound constrained optimization. SIAM Journal on Scientific Computing 16(5), 1190–1208 (1995)
- [11]Charalambides, C.A.: Success runs in a circular sequence of independent bernoulli trials. Runs and patterns in probability, 15–30 (1994)DOI
- [12]Charalambides, C.A.: Enumerative Combinatorics. CRC Press, Boca Raton, FL (2002)
- [13]Charalambides, C.A.: Discrete q-distributions on bernoulli trials with a geometrically varying success probability. Journal of statistical planning and inference 140(9), 2355–2383 (2010)DOI
- [14]Charalambides, C.A.: The q-bernstein basis as a q-binomial distribution. Journal of Statistical Planning and Inference 140(8), 2184–2190 (2010)DOI
- [15]Charalambides, C.A.: Discrete q-distributions. John Wiley & Sons, Hoboken, NJ (2016)
- [16]Dubman, M., Sherman, B.: Estimation of parameters in a transient markov chain arising in a reliability growth model. The Annals of Mathematical Statistics 40(5), 1542–1556 (1969)DOI
- [17]Eryilmaz, S.: The longest run statistic associated with exchangeable binary variables. Turkish Journal of Engineering and Environmental Sciences 29(2), 105–112 (2005)
- [18]Eryilmaz, S.: Some results associated with the longest run statistic in a sequence of markov dependent trials. Applied mathematics and computation 175(1), 119–130 (2006)DOI
- [19]Eryilmaz, S.: On success runs in a sequence of dependent trials with a change point. Statistics & Probability Letters 132, 91–98 (2018)DOI
- [22]Fu, J.C.: Distribution theory of runs and patterns associated with a sequence of multistate trials. Statistica Sinica, 957–974 (1996)
- [23]Gera, A.E.: Acceptance testing for a planar array. Communications in Statistics - Simulation and Computation 49(5), 1198–1209 (2020) https://doi.org/10.1080/ 03610918.2018.1493506
- [24]Gera, A.E.: From runs to patterns. Communications in Statistics - Simulation and Computation 50(12), 4300–4314 (2021) https://doi.org/10.1080/03610918.2019.1642486
- [25]Jing, S.-c., Fan, H.-y.: q-deformed binomial state. Physical Review A 49(4), 2277 (1994)pubmed.ncbi.nlm.nih.gov/9910495
- [26]Jing, S.: The q-deformed binomial distribution and its asymptotic behaviour. Journal of Physics A: Mathematical and General 27(2), 493 (1994)DOI
- [27]Johnson, N.L., Kotz, S., Kemp, A.W.: Univariate Discrete Distributions. John Wiley & Sons, Hoboken, NJ (2005)
- [28]Kong, Y.: Joint distribution of rises, falls, and number of runs in random sequences. Communications in Statistics-Theory and Methods 48(3), 493–499 (2019)DOI
- [29]Lehmann, E.L., Casella, G.: Theory of Point Estimation. Springer, New York (1998)
- [30]Lou, W.W.: On runs and longest run tests: a method of finite markov chain imbedding. Journal of the American Statistical Association 91(436), 1595–1601 (1996)DOI
- [31]Lehmann, E.L., Romano, J.P.: Testing Statistical Hypotheses, 4th edn. Springer, Cham (2022)
- [32]Makri, F.S., Psillakis, Z.M.: On runs of ones defined on a q-sequence of binary trials. Metrika 79(5), 579–602 (2016) https://doi.org/10.1007/s00184-015-0568-2
- [33]Makri, F.S., Psillakis, Z.M., Arapis, A.N.: On the concentration of runs of ones of length exceeding a threshold in a markov chain. Journal of Applied Statistics 46(1), 85–100 (2019)
- [34]Makri, F.S., Philippou, A.N., Psillakis, Z.M.: Shortest and longest length of success runs in binary sequences. Journal of Statistical Planning and Inference 137(7), 2226–2239 (2007)
- [35]Muselli, M.: Simple expressions for success run distributions in bernoulli trials. Statistics & Probability Letters 31(2), 121–128 (1996)
- [36]Philippou, A.N., Georghiou, C., Philippou, G.N.: A generalized geometric distribution and some of its properties. Statistics & Probability Letters 1(4), 171–175 (1983)
- [37]Philippou, A., Muwafi, A.: Waiting for the kth consecutive success and the fibonacci sequence of order k. Fibonacci Quarterly 20(1), 28–32 (1982)
- [38]Philippou, A.N., Makri, F.S.: Longest success runs and fibonacci-type polynomials. The Fibonacci Quarterly 23(4), 338–346 (1985)DOI
- [39]Philippou, A.N., Makri, F.S.: Successes, runs and longest runs. Statistics & Probability Letters 4(2), 101–105 (1986)
- [40]Philippou, A.N., Makri, F.S.: Longest circular runs with an application in reliability via the fibonacci-type polynomials of order k. In: Bergum, G.E., Philippou, A.N., Horadam, A.F. (eds.) Applications of Fibonacci Numbers: Volume 3 Proceedings of ‘The Third International Conference on Fibonacci Numbers and Their Applications’, Pisa, Italy, July 25–29, 1988, pp. 281–286. Springer, Dordrecht (1990). https://doi.org/10.1007/978-94-009-1910-5_31 . https://doi.org/10.1007/978-94-009-1910-5_31
- [41]Serkan, E.: On the distribution and expectation of success runs in nonhomogeneous markov dependent trials. Statistical Papers 46(1), 117–128 (2005)DOI
- [42]Self, S.G., Liang, K.-Y.: Asymptotic properties of maximum likelihood estimators and likelihood ratio tests under nonstandard conditions. Journal of the American Statistical Association 82(398), 605–610 (1987) https://doi.org/10.1080/01621459.1987.10478472
- [43]Vaggelatou, E.: On the length of the longest run in a multi-state markov chain. Statistics & probability letters 62(3), 211–221 (2003)DOI
- [44]Yalcin, F., Evrlimaz, S.: q-geometric and q-binomial distributions of order k. Journal of Computational and Applied Mathematics 271, 31–38 (2014)DOI




