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.
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
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
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:
For an interior gap, the theorem gives the particularly useful form
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\),
To verify this identity, differentiate the right-hand side. Differentiating each term produces two sums; adjacent terms cancel, leaving
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
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
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
Evaluate at the two endpoints:
The beta distribution is continuous, so whether the interval endpoints are included does not change the probability. Thus
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.
| Quantity | Spacing components in the sum | Distribution |
|---|---|---|
| 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.
Check Your Understanding
Use the component-counting rule and the beta distribution to answer these questions.
- For \(n=4\), what is the distribution of one spacing? How many spacing components are there in total?
- For a sample of size \(n=8\), identify the distribution of \(U_{(6)}-U_{(2)}\).
- For \(n=5\), express \(P(D_1>c)\), for \(0\leq c\leq1\), using the beta law for one spacing.
- Why does the sum of three selected spacings from a sample of size \(n=7\) have second beta parameter \(5\), rather than \(4\)?
- Explain why the beta law for an aggregated gap does not imply that the individual spacings are independent.