Tutorials › Statistical Theory I - Probability and Distribution Theory › Beta Laws for Individual and Aggregated Spacings

Ranks, Spacings, and Empirical Laws · Tutorial 479 of 994

Beta Laws for Individual and Aggregated Spacings

Use the beta distribution of a uniform spacing or an aggregated gap to calculate exact probabilities from its position and the number of spacing components it contains.

Advanced 10 min read

What You'll Learn

  • Define the \(n+1\) spacings formed by a sample of \(n\) independent uniform observations.
  • Derive the beta distribution for one spacing and for a sum of selected spacings.
  • Match the number of summed components to the two beta parameters.
  • Calculate threshold and interval probabilities for specified gaps.
  • Avoid confusing the sample size with the total number of spacing components.

Why Uniform Gaps Have Beta Laws

A uniform sample divides the unit interval into random gaps. The gaps are constrained: they are positive and must add to one. Consequently, a gap is not distributed like an unconstrained uniform observation. The useful fact is that the length of a single gap, or of a union of selected gaps, has a beta distribution. Its parameters can be read directly from how many spacing components are included and how many are left over.

This gives an exact route from a question about sample gaps to a probability calculation. For example, it can answer how likely it is that two specified order statistics are separated by more than a given distance. The key bookkeeping detail is that a sample of size \(n\) creates \(n+1\) spacings, including the two end gaps.

Definition: Let \(U_1,\ldots,U_n\) be independent \(U(0,1)\) random variables, with order statistics \(U_{(1)}<\cdots<U_{(n)}\), an event of probability one. Define the spacings $$ D_1=U_{(1)},\qquad D_i=U_{(i)}-U_{(i-1)}\quad (2\leq i\leq n),\qquad D_{n+1}=1-U_{(n)}. $$ There are \(n+1\) spacings, and \(\sum_{i=1}^{n+1}D_i=1\).

The distribution of the full spacing vector is the Dirichlet law of uniform spacings. Here we need its implication for sums of components. In particular, an interior gap between \(U_{(i)}\) and \(U_{(j)}\), for \(i<j\), is \(U_{(j)}-U_{(i)}=D_{i+1}+\cdots+D_j\): it contains \(j-i\) spacings.

The Beta Law for a Selected Sum of Spacings

Theorem: Let \(D_1,\ldots,D_{n+1}\) be the spacings from an independent \(U(0,1)\) sample of size \(n\). Select any \(m\) distinct spacing components, where \(1\leq m\leq n\), and let \(S\) be their sum. Then $$ S\sim \operatorname{Beta}(m,n+1-m). $$ Its density on \(0<s<1\) is $$ f_S(s)=\frac{s^{m-1}(1-s)^{n-m}}{B(m,n+1-m)}, \qquad B(a,b)=\int_0^1 t^{a-1}(1-t)^{b-1}\,dt. $$

The first parameter counts the selected components; the second counts the components not selected. This follows from the joint spacing density, as the proof shows.

The joint density of the order statistics is \(n!\) on \(0<u_{(1)}<\cdots<u_{(n)}<1\). The transformation from the order statistics to \(D_1,\ldots,D_n\), with \(D_{n+1}=1-\sum_{i=1}^nD_i\), has absolute Jacobian one. Thus the spacing density is \(n!\) on the simplex \(d_i>0,\ \sum_{i=1}^n d_i<1\), using \(d_1,\ldots,d_n\) as coordinates.

By symmetry, take the selected components to be the first \(m\), and write the other \(q=n+1-m\) components as the remainder. For a fixed sum \(s\) of the first group, the volume of the possible positive components in that group, in sum coordinates, is \(s^{m-1}/(m-1)!\). The corresponding volume for the remainder is \((1-s)^{q-1}/(q-1)!\). These simplex volumes follow by integrating over all but one component in each group; a positive \(r\)-component group with total \(t\) has volume \(t^{r-1}/(r-1)!\). Changing from the group coordinates to the group total and the within-group coordinates has absolute Jacobian one. Multiplying the two volumes by the joint density therefore gives

$$ f_S(s)=\frac{n!}{(m-1)!(q-1)!}\,s^{m-1}(1-s)^{q-1},\qquad 0<s<1. $$

Since \(q=n+1-m\), the coefficient is \(1/B(m,q)\): for positive integers \(m,q\), \(B(m,q)=(m-1)!(q-1)!/(m+q-1)!\), and \(m+q-1=n\). This is the beta density with parameters \(m,q\), proving the theorem. \(\square\)

Taking \(m=1\) gives the law for any one spacing, including either end spacing:

$$ D_i\sim \operatorname{Beta}(1,n),\qquad f_{D_i}(d)=n(1-d)^{n-1},\quad 0<d<1. $$

For an interior gap, the theorem gives the particularly useful form

$$ U_{(j)}-U_{(i)}\sim \operatorname{Beta}(j-i,n+1-(j-i)),\qquad 1\leq i<j\leq n. $$

The end gaps fit the same counting rule: \(U_{(j)}\) is a sum of \(j\) components, and \(1-U_{(i)}\) is a sum of \(n+1-i\) components.

Calculating Exact Gap Probabilities

For integer beta parameters, a finite binomial sum gives the cumulative distribution function. If \(S\sim\operatorname{Beta}(m,N-m)\), where \(N=n+1\) and \(1\leq m<N\), then for \(0\leq x\leq1\),

$$ P(S\leq x)=\sum_{k=m}^{N-1}\binom{N-1}{k}x^k(1-x)^{N-1-k}. $$

To verify this identity, differentiate the right-hand side. Differentiating each term produces two sums; adjacent terms cancel, leaving

$$ (N-1)\binom{N-2}{m-1}x^{m-1}(1-x)^{N-m-1} =\frac{x^{m-1}(1-x)^{N-m-1}}{B(m,N-m)}. $$

This is the beta density. The sum is zero at \(x=0\), matching the beta distribution function there, so equality follows by integration. The formula is convenient for exact calculations, while direct integration of the beta density is often just as clear for small parameters.

Worked Example: A Single Spacing Exceeds a Threshold

Let \(n=5\), and find the probability that the third spacing \(D_3=U_{(3)}-U_{(2)}\) exceeds \(0.2\).

There is one selected component among \(n+1=6\), so \(D_3\sim\operatorname{Beta}(1,5)\) and its density is \(5(1-d)^4\). Therefore

$$ \begin{aligned} P(D_3>0.2) &=\int_{0.2}^{1}5(1-d)^4\,dd\\ &=(1-0.2)^5\\ &=0.8^5=0.32768. \end{aligned} $$

Thus the specified single gap exceeds one fifth of the interval with probability \(0.32768\).

Worked Example: The Gap Between Two Nonadjacent Order Statistics

For a sample of size \(n=6\), calculate \(P(U_{(4)}-U_{(2)}\leq0.3)\).

The gap is \(D_3+D_4\), so it sums \(m=2\) of the \(n+1=7\) spacing components. Hence \(U_{(4)}-U_{(2)}\sim\operatorname{Beta}(2,5)\). The finite-sum formula gives

$$ \begin{aligned} P(U_{(4)}-U_{(2)}\leq0.3) &=\sum_{k=2}^{6}\binom{6}{k}(0.3)^k(0.7)^{6-k}\\ &=1-\left\{(0.7)^6+6(0.3)(0.7)^5\right\}\\ &=1-(0.7)^5(0.7+1.8)\\ &=1-(0.16807)(2.5)\\ &=0.579825. \end{aligned} $$

The complement consists of the \(k=0\) and \(k=1\) terms. The calculated probability is therefore about \(0.580\).

Worked Example: A Gap Falls Within a Specified Range

For a sample of size \(n=5\), find the probability that \(U_{(4)}-U_{(1)}\) lies between \(0.2\) and \(0.5\).

This gap is \(D_2+D_3+D_4\): it sums \(m=3\) of the six spacings. Its law is \(\operatorname{Beta}(3,3)\), with density \(30s^2(1-s)^2\). Integrating the density gives

$$ \begin{aligned} F(x) &=\int_0^x30s^2(1-s)^2\,ds\\ &=10x^3-15x^4+6x^5. \end{aligned} $$

Evaluate at the two endpoints:

$$ \begin{aligned} F(0.5)&=10(0.5)^3-15(0.5)^4+6(0.5)^5=0.5,\\ F(0.2)&=10(0.2)^3-15(0.2)^4+6(0.2)^5=0.05792. \end{aligned} $$

The beta distribution is continuous, so whether the interval endpoints are included does not change the probability. Thus

$$ P(0.2<U_{(4)}-U_{(1)}<0.5)=F(0.5)-F(0.2)=0.5-0.05792=0.44208. $$

Reading the Parameters Correctly

For a gap calculation, count components rather than counting only observations. There are \(n+1\) components in all. If a gap collects \(m\) of them, its beta parameters are \(m\) and \(n+1-m\). For example, the interval from \(U_{(i)}\) to \(U_{(j)}\) has \(j-i\) components in the gap, irrespective of how many observations lie outside it.

QuantitySpacing components in the sumDistribution
One spacing \(D_i\)1\(\operatorname{Beta}(1,n)\)
Interior gap \(U_{(j)}-U_{(i)}\)\(j-i\)\(\operatorname{Beta}(j-i,n+1-(j-i))\)
Sum of any \(m\) distinct spacings\(m\)\(\operatorname{Beta}(m,n+1-m)\)

The beta law is useful whenever a question asks about the length of a gap or a union of gaps in a uniform sample. The shape of the law depends on how the unit interval is partitioned, not on which particular components were selected. This exchangeability is why a selected set of \(m\) components has the same sum distribution as any other set of \(m\).

Common Pitfall

A frequent error is to assign a gap containing \(m\) spacings the law \(\operatorname{Beta}(m,n-m)\), as if there were only \(n\) spacings in total. That omits one component: the two end gaps are part of the partition too. The correct count is \(n+1\), so the second parameter is \(n+1-m\). For a single spacing, the correction is especially easy to check: its law is \(\operatorname{Beta}(1,n)\), not \(\operatorname{Beta}(1,n-1)\).

Another tempting but incorrect shortcut is to treat different spacings as independent uniform random variables. They cannot be independent, since their sum is exactly one. The beta result describes the distribution of one spacing or a selected sum while respecting that constraint; it does not assert independence among the spacings.

Key takeaway: A sample of size \(n\) creates \(n+1\) uniform spacings. The sum of any \(m\) distinct components has distribution \(\operatorname{Beta}(m,n+1-m)\); count the components in the gap, then use its beta CDF or integrate its density to obtain the desired probability.

Check Your Understanding

Use the component-counting rule and the beta distribution to answer these questions.

  1. For \(n=4\), what is the distribution of one spacing? How many spacing components are there in total?
  2. For a sample of size \(n=8\), identify the distribution of \(U_{(6)}-U_{(2)}\).
  3. For \(n=5\), express \(P(D_1>c)\), for \(0\leq c\leq1\), using the beta law for one spacing.
  4. Why does the sum of three selected spacings from a sample of size \(n=7\) have second beta parameter \(5\), rather than \(4\)?
  5. Explain why the beta law for an aggregated gap does not imply that the individual spacings are independent.