Order Statistics

The smallest, largest, and kth smallest observations in a random sample.

Draft — not yet reviewed by the site owner.

Prerequisites: Random Variables, Probability Distributions, Statistical Independence.

Order statistics are the values of a sample after sorting it. The first is the minimum, the last is the maximum, and the middle one is a sample median. They answer questions about extremes and rankings, such as the fastest race time or the second-highest bid.

Sort first, then ask an event question

Write X(1)≤X(2)≤⋯≤X(n)X_{(1)}\le X_{(2)}\le\cdots\le X_{(n)} for the sorted values of X1,…,XnX_1,\ldots,X_n. The parentheses matter: X(2)X_{(2)} is the second smallest value, not necessarily the original observation X2X_2.

To find the distribution of the maximum X(n)X_{(n)}, ask what it means for it to be at most xx. Every observation must be at most xx. If the observations are independent and identically distributed (iid) with cumulative distribution function (CDF) F(x)=P(Xi≤x)F(x)=P(X_i\le x), then

P(X(n)≤x)=P(X1≤x,…,Xn≤x)=F(x)n.P(X_{(n)}\le x)=P(X_1\le x,\ldots,X_n\le x)=F(x)^n.

For the minimum, it is simpler to start with the opposite event: the minimum is above xx only if every observation is above xx. Thus

P(X(1)≤x)=1−[1−F(x)]n.P(X_{(1)}\le x)=1-[1-F(x)]^n.

These formulas are probabilities of events, not densities. When FF has density ff, differentiating gives fX(n)(x)=nF(x)n−1f(x)f_{X_{(n)}}(x)=nF(x)^{n-1}f(x) and fX(1)(x)=n[1−F(x)]n−1f(x)f_{X_{(1)}}(x)=n[1-F(x)]^{n-1}f(x).

CDF curves for the maximum of one, three, and ten independent uniform zero-to-one draws. With more draws, the maximum is less likely to stay below a given threshold and concentrates near one.
Model, not data. For n independent Uniform(0, 1) draws, P(maximum ≤ x) = xⁿ on 0 ≤ x ≤ 1. Curves for n = 1, 3, and 10 show the maximum moving toward 1 as the sample grows.

Worked example: three uniform draws

Suppose X1,X2,X3X_1,X_2,X_3 are independent and uniform on (0,1)(0,1). What is the probability that all three are below 0.80.8? It is 0.83=0.5120.8^3=0.512. That is also P(X(3)≤0.8)P(X_{(3)}\le0.8), because the maximum is below 0.80.8 exactly when all three are.

What is the probability that the minimum is below 0.20.2? The chance that all three are above 0.20.2 is 0.830.8^3, so the answer is 1−0.83=0.4881-0.8^3=0.488.

The maximum tends upward and the minimum tends downward as the sample grows. This does not mean any individual observation changes; sorting selects more extreme values from a larger collection.

The kth smallest value

The event X(k)≤xX_{(k)}\le x means at least kk of the nn observations are at most xx. Each iid observation passes that threshold with probability F(x)F(x). The number that pass is binomial, so

P(X(k)≤x)=∑j=kn(nj)F(x)j[1−F(x)]n−j.P(X_{(k)}\le x)=\sum_{j=k}^{n}\binom{n}{j}F(x)^j[1-F(x)]^{n-j}.

This is the key idea behind the general formula. For continuous iid observations with density ff, differentiating gives

fX(k)(x)=n!(k−1)!(n−k)!F(x)k−1[1−F(x)]n−kf(x).f_{X_{(k)}}(x)=\frac{n!}{(k-1)!(n-k)!}F(x)^{k-1}[1-F(x)]^{n-k}f(x).

For uniform (0,1)(0,1) observations, F(x)=xF(x)=x there, and this is a Beta density with parameters kk and n+1−kn+1-k. Sample quantiles are order statistics or averages of neighboring ones, depending on the convention.

When the shortcut fails

The power and binomial formulas require independent observations with the same distribution. If the observations have different CDFs but remain independent, the maximum still has CDF ∏i=1nFi(x)\prod_{i=1}^n F_i(x), but the simple F(x)nF(x)^n shortcut is gone. Dependence can change the answer even more: if all XiX_i are the same random value, their maximum has the same distribution as any one of them.

Further reading