Why Work With Spacings?
Ordered observations describe locations: the smallest value, the next smallest, and so on. Spacings describe the gaps between those locations. This change of viewpoint is useful when the question concerns clustering, empty intervals, or how a sample is distributed across its range.
The gaps cannot vary freely. Once the sample interval endpoints are fixed, the endpoint gaps and the gaps between observations must add to the interval length. The joint density therefore lives on a constrained region, and getting that region right is part of the calculation.
Definition and Support
Let \(X_1,\ldots,X_n\) be iid random variables with a continuous density \(f\) supported on a finite interval \((a,b)\), where \(a<b\). Write their ordered values as \(X_{(1)}<\cdots<X_{(n)}\), which are distinct with probability one. The endpoint spacings measure the distance from the interval boundaries to the sample, and the interior spacings measure successive gaps.
The fixed-sum identity follows by telescoping: adding the first gap, all successive differences, and the final gap leaves exactly \(b-a\). Consequently, the \(n+1\) spacings have only \(n\) free coordinates. We will use \(D_1,\ldots,D_n\) as those coordinates and recover \(D_{n+1}\) from their sum.
From Ordered Values to Spacing Coordinates
For iid observations with density \(f\), the joint density of the ordered sample is \(n!\prod_{i=1}^n f(x_i)\) on \(a<x_1<\cdots<x_n<b\), and zero elsewhere. To see the factor \(n!\), consider a strictly ordered vector \(x_1<\cdots<x_n\). There are \(n!\) permutations of its coordinates in the unordered sample space. Each has the same product density because the observations are iid, and ties have probability zero. Summing the densities of these disjoint permutations gives the stated order-statistic density.
Now express the ordered observations using the first \(n\) spacings: \(x_i=a+\sum_{j=1}^i d_j\). The transformation is triangular: each \(x_i\) depends only on \(d_1,\ldots,d_i\), and the coefficient of \(d_i\) in \(x_i\) is 1. Its Jacobian determinant is therefore 1. The order constraints become positivity of each \(d_i\) and the requirement that their sum be less than the interval length.
For completeness, the transformed density follows directly from the change-of-variables formula. At \(x_i=a+\sum_{j=1}^i d_j\), the ordered-sample density is \(n!\prod_i f(x_i)\). Multiplication by the absolute Jacobian determinant, which is 1, gives the displayed formula. The correspondence between the ordered region and the spacing region is one-to-one: positive \(d_1,\ldots,d_n\) with sum below \(b-a\) reconstruct a strictly ordered sample inside \((a,b)\), and every such sample gives exactly those spacings. This proves both the density formula and its stated support. \(\square\)
The support is an open \(n\)-dimensional simplex. The final spacing is positive precisely when \(\sum_{i=1}^n d_i<b-a\). In particular, the full vector \((D_1,\ldots,D_{n+1})\) is constrained to a hyperplane with fixed sum. It does not have an ordinary \((n+1)\)-dimensional density; the formula above is a density for \(n\) free coordinates.
Worked Examples
Worked Example: Two Uniform Observations
Let \(X_1,X_2\) be iid uniform on \((0,1)\). Here \(a=0\), \(b=1\), and \(f(x)=1\) on the interval. There are three spacings: \(D_1=X_{(1)}\), \(D_2=X_{(2)}-X_{(1)}\), and \(D_3=1-X_{(2)}\).
Use \(d_1,d_2\) as the free coordinates. The support is \(d_1>0\), \(d_2>0\), and \(d_1+d_2<1\), with \(d_3=1-d_1-d_2\). The joint density is $$ g(d_1,d_2)=2!\,f(d_1)f(d_1+d_2)=2 $$ throughout this region. Its integral is \(2\) times the triangular region's area, namely \(2(1/2)=1\), so it is normalized. The last spacing is not an extra free coordinate: choosing \(d_1,d_2\) determines it.
Worked Example: A Nonuniform Density Changes the Spacing Density
Let \(X_1,X_2\) be iid on \((0,1)\) with density \(f(x)=2x\). This is a valid density because \(\int_0^1 2x\,dx=1\). The same spacing coordinates have support \(d_1>0\), \(d_2>0\), \(d_1+d_2<1\), but the joint density is now $$ g(d_1,d_2)=2(2d_1)\bigl(2(d_1+d_2)\bigr)=8d_1(d_1+d_2). $$
Check its normalization by integrating over the support: $$ \int_0^1\int_0^{1-d_1}8d_1(d_1+d_2)\,dd_2\,dd_1 = 8\int_0^1\left(d_1^2(1-d_1)+\frac{d_1(1-d_1)^2}{2}\right)dd_1. $$ The expression in parentheses simplifies to \(\tfrac12d_1-\tfrac12d_1^3\). Thus the integral is $$ 8\left(\frac14-\frac18\right)=1. $$ The support is the same simplex as in the uniform example, but the density is not constant: larger values of the ordered observations are favored by \(f(x)=2x\).
Worked Example: A Probability From Three Uniform Spacings
Let \(X_1,X_2,X_3\) be iid uniform on \((0,1)\), and consider the probability that the first endpoint spacing exceeds one half: \(P(D_1>1/2)\). The joint density of \(D_1,D_2,D_3\) in the first three coordinates is \(3!=6\) on \(d_1,d_2,d_3>0\), \(d_1+d_2+d_3<1\); the fourth spacing is the remaining amount.
Set \(u=d_1-\tfrac12\). On the event of interest, the support becomes \(u,d_2,d_3>0\) and \(u+d_2+d_3<\tfrac12\). Its volume is $$ \int_0^{1/2}\int_0^{1/2-u}\int_0^{1/2-u-d_2} dd_3\,dd_2\,du = \int_0^{1/2}\frac{(1/2-u)^2}{2}\,du = \frac{(1/2)^3}{6} = \frac{1}{48}. $$ Multiplying by the constant density gives \(P(D_1>1/2)=6(1/48)=1/8\). The calculation uses the region's volume in three free spacing coordinates, not four.
What the Joint Density Tells Us
The spacing support is determined by geometry, while the density within that support depends on the sampling density \(f\). For a general nonuniform sample, each factor in the joint density is evaluated at a cumulative sum of gaps. This dependence on cumulative sums is why a simple gap-by-gap description does not, in general, make the spacings independent.
Finite interval endpoints matter for the two endpoint spacings in this definition. If the sampling interval is unbounded, an endpoint distance to infinity is not a finite spacing of this form. Interior differences \(X_{(i)}-X_{(i-1)}\) remain well-defined, but the finite-endpoint simplex formula must not be used without an appropriate change of setup.
Common Mistake
A tempting but incorrect argument is to treat all \(n+1\) spacings as freely chosen positive numbers and assign them a joint density with respect to ordinary \((n+1)\)-dimensional volume. This ignores their exact sum constraint. The correction is to use only \(n\) coordinates, state the condition \(\sum_{i=1}^n d_i<b-a\), and set the remaining spacing equal to \(b-a-\sum_{i=1}^n d_i\). The distinction is not cosmetic: the full spacing vector lies on a lower-dimensional hyperplane and has zero \((n+1)\)-dimensional volume.
Check Your Understanding
Answer each question by identifying both the coordinates and their support.
- For a sample of size \(n\) on \((a,b)\), write the expression for the final spacing in terms of \(D_1,\ldots,D_n\).
- Why does the joint density of the ordered sample contain the factor \(n!\) when the observations are iid and continuous?
- For \(n=2\), describe the support of the first two spacings and explain why \(d_1+d_2= b-a\) is not allowed.
- If the sample density is \(f(x)\), at what ordered-sample values is \(f\) evaluated in the spacing density?
- Why is it inaccurate to describe the full vector of \(n+1\) spacings as having an ordinary \((n+1)\)-dimensional density?