Why Two Ranks Require Three Counts
A single order statistic is located by counting how many observations fall below its value. Two selected ranks require a more detailed accounting. If \(X_{(r)}=x\) and \(X_{(s)}=y\), where \(r<s\), then there are \(r-1\) observations below \(x\), \(s-r-1\) between \(x\) and \(y\), and \(n-s\) above \(y\). The two observations at the selected ranks contribute one observation at each selected value.
That partition of the sample is the key to the joint density. The probabilities of the three regions become powers of the CDF, the CDF difference, and the upper-tail probability. A combinatorial coefficient counts the ways to assign the \(n\) labeled observations to those regions and the two selected ranks.
Joint Density of Two Selected Order Statistics
The formula below applies to any two distinct selected ranks. Its factorials record the numbers of observations in each of the three regions. The convention \(0!=1\) handles a region that contains no observations.
The factors have direct interpretations. An observation is below \(x\) with probability \(F(x)\); it is between \(x\) and \(y\) with probability \(F(y)-F(x)\); and it is above \(y\) with probability \(1-F(y)\). The selected observations themselves contribute the density factors \(f(x)\) and \(f(y)\).
Derivation from the Ordered Sample
Because the common distribution is continuous, ties occur with probability zero. For example, for any two different indices \(i\) and \(j\), independence and continuity give \(P(X_i=X_j)=0\); taking a finite union over pairs shows that all sample values are distinct with probability one.
On the region \(z_1<z_2<\cdots<z_n\), the joint density of the ordered sample is
Indeed, each strictly ordered vector of values can arise from \(n!\) permutations of the labeled observations. Each permutation has joint density \(\prod_{j=1}^n f(z_j)\), so summing those contributions gives the displayed density.
Now fix \(x<y\), and integrate out the ordered observations other than \(z_r=x\) and \(z_s=y\). The \(r-1\) values below \(x\) must appear in increasing order. Their product-density integral is
To see the factorial, consider the full region where \(r-1\) coordinates all lie below \(x\). It is a cube, apart from its measure-zero ties, and splits into \((r-1)!\) orderings. The product integrand is symmetric, so each ordering has the same integral. The integral over the whole cube is \([F(x)]^{r-1}\), giving the result after division by \((r-1)!\). The same argument applies to any interval: \(m\) ordered coordinates in an interval with probability mass \(q\) contribute \(q^m/m!\).
Applying that argument to the \(s-r-1\) values between \(x\) and \(y\) gives \([F(y)-F(x)]^{s-r-1}/(s-r-1)!\). Applying it to the \(n-s\) values above \(y\) gives \([1-F(y)]^{n-s}/(n-s)!\). Multiplication by the ordered-sample factor \(n!\) and the two fixed-coordinate densities \(f(x)f(y)\) proves the theorem. The integrations are valid for a density \(f\), since the product density is nonnegative and Tonelli's theorem permits the iterated integrations. \(\square\)
Worked Examples
Worked Example: Two Ranks from a Uniform Sample
Let \(X_1,\ldots,X_5\) be iid Uniform\((0,1)\), and find the joint density of \(X_{(2)}\) and \(X_{(4)}\).
Here \(n=5\), \(r=2\), and \(s=4\). On \(0<x<y<1\), the density and CDF are \(f(t)=1\) and \(F(t)=t\). The numbers below, between, and above the selected values are \(1\), \(1\), and \(1\), respectively. Thus the coefficient is
and the joint density is
As a check, integrate the density. For fixed \(x\), put \(L=1-x\) and \(t=y-x\). Then
Therefore the total integral is
Worked Example: Two Ranks from an Exponential Sample
Let \(X_1,\ldots,X_4\) be iid exponential random variables with rate \(\lambda>0\). Find the joint density of \(X_{(1)}\) and \(X_{(3)}\).
For \(t>0\), \(f(t)=\lambda e^{-\lambda t}\) and \(F(t)=1-e^{-\lambda t}\). Here \(n=4\), \(r=1\), \(s=3\), so there are zero observations below \(x\), one between \(x\) and \(y\), and one above \(y\). The coefficient is \(4!/(0!1!1!)=24\). Substituting into the general formula gives
The first exponential term comes from multiplying \(e^{-\lambda x}\) by the three factors \(e^{-\lambda y}\). The second comes from multiplying \(e^{-\lambda y}\) by those same three factors. Both terms are needed: they represent the difference \(F(y)-F(x)\), not just the probability of being below \(y\).
Worked Example: Two Ranks from a Normal Sample
Let \(X_1,\ldots,X_6\) be iid \(N(0,1)\), and find the joint density of \(X_{(2)}\) and \(X_{(5)}\). Write \(\phi\) and \(\Phi\) for the standard normal density and CDF.
There is one observation below \(x\), two between \(x\) and \(y\), and one above \(y\). The coefficient is
Since \(f=\phi\) and \(F=\Phi\), the density is
For a numerical check at \(x=0\) and \(y=1\), use \(\Phi(0)=0.5\), \(\Phi(1)\approx0.8413447\), \(\phi(0)\approx0.3989423\), and \(\phi(1)\approx0.2419707\). The density there is
This is a density value at a point, not the probability that the two order statistics equal exactly \(0\) and \(1\). Probabilities are obtained by integrating the joint density over a region in the \((x,y)\)-plane.
A Marginal Check
Integrating out \(X_{(s)}\) must recover the density of \(X_{(r)}\). This provides a useful algebraic check on the powers, factorials, and support in the joint formula.
To verify this, set \(a=F(x)\) and integrate the joint density with respect to \(y\). For an absolutely continuous CDF, the substitution \(u=F(y)\) in an integral against \(f(y)\,dy\) is valid; equivalently, it follows by applying the chain rule to an antiderivative in \(u\). Thus the part of the integral depending on \(y\) is
In the first line, \(t=(u-a)/(1-a)\). The last integral is the integer-parameter beta integral; repeated integration by parts gives \(\int_0^1 t^p(1-t)^q\,dt=p!q!/(p+q+1)!\) for nonnegative integers \(p,q\). Multiplying by the joint-density coefficient and the remaining factors gives
which is exactly the stated marginal density. This confirms that the joint density integrates over the second coordinate to the correct one-dimensional density. \(\square\)
Common Pitfall: Counting the Regions Incorrectly
A frequent error is to use \(s-r\) as the exponent on \(F(y)-F(x)\). That count includes the observation at rank \(r\), which is at \(x\), rather than strictly between the selected values. The number strictly between the selected ranks is \(s-r-1\). Likewise, the \(r-1\) observations below \(x\) and the \(n-s\) above \(y\) are counts of unselected observations.
Another mistake is to read \(f_{X_{(r)},X_{(s)}}(x,y)\) as a point probability. With continuous observations, the probability of either order statistic taking one exact value is zero. A joint density gives probabilities only after integration over a region. For a small rectangle around \((x,y)\) with \(x<y\), its probability is approximately the density at \((x,y)\) times the rectangle's area, provided the density is continuous there.
Check Your Understanding
Use the region-counting argument and the joint-density formula to answer these questions.
- For \(n=7\), \(r=2\), and \(s=6\), how many observations lie below, between, and above the two selected values?
- For a Uniform\((0,1)\) sample of size \(6\), write the joint density of \(X_{(2)}\) and \(X_{(5)}\), including its support.
- Explain why the joint density contains \(f(x)f(y)\) in addition to the three powers involving \(F\).
- For \(n=5\), \(r=1\), and \(s=4\), calculate the combinatorial coefficient and the exponent on \(F(y)-F(x)\).
- Why does a value of the joint density at one point not give the probability that the order statistics equal those two values?