Tutorials › Exam P - Probability › Comparing Order Statistics Across Independent Samples

Exam P · Order Statistics · Tutorial 807 of 915

Comparing Order Statistics Across Independent Samples

Condition on an order statistic’s value to calculate cross-sample rank probabilities using threshold counts and the appropriate density.

Advanced 10 min read

What You'll Learn

  • Express an order-statistic comparison as a conditional probability given a rank threshold.
  • Translate a rank event into a count of observations below or above the threshold.
  • Use binomial counts for iid observations and Poisson-binomial counts for independent nonidentical observations.
  • Identify the density of the conditioning order statistic and set the correct integration limits.
  • Recognize when continuous-model formulas fail because ties or atoms are possible.
  • Check a result using rank symmetry or an alternative event representation.

Why Condition on a Rank Threshold?

A comparison such as “the second-smallest measurement in one group exceeds the smallest measurement in another” involves two random thresholds and two rank conditions. A useful strategy is to fix the value of one order statistic first. Once that threshold is fixed, the comparison becomes a counting problem in the other sample. Averaging that conditional probability over the threshold’s distribution gives the desired answer.

This method is especially useful when the samples are independent but their sizes, parent distributions, or ranks differ. The key is to keep two tasks separate: calculate the chance that one sample’s order statistic crosses a fixed threshold, then average over the random threshold from the other sample.

Definition: For observations \(X_1,\ldots,X_n\), write \(X_{(r)}\) for the \(r\)th order statistic, meaning the \(r\)th-smallest observation, for \(1\le r\le n\). In this tutorial, the samples are independent and have continuous distributions, so ties occur with probability zero.

Conditioning on the Other Sample’s Order Statistic

Let \(X_{(r)}\) be the \(r\)th order statistic from one sample, and let \(Y_{(s)}\) be the \(s\)th order statistic from a second, independent sample. For a fixed threshold \(t\), the event \(X_{(r)}>t\) depends on how many observations in the first sample are at most \(t\). Define that count by \(N_t\). With continuous observations, \(X_{(r)}>t\) exactly when fewer than \(r\) observations are at most \(t\), or \(N_t\le r-1\).

Because the samples are independent, the first sample’s observations remain governed by their original distributions when we condition on \(Y_{(s)}=t\). Thus we can calculate \(P(X_{(r)}>t)\) and then average that quantity over the distribution of \(Y_{(s)}\).

$$ P(X_{(r)}>Y_{(s)}) =\int_{-\infty}^{\infty} P(X_{(r)}>t)\,f_{Y_{(s)}}(t)\,dt $$

The integral is effectively over the support of \(Y_{(s)}\). If the \(X_i\) are independent but not necessarily identically distributed, set \(p_i(t)=P(X_i\le t)\). The count \(N_t\) is then a sum of independent indicator variables with possibly different success probabilities. Its probability of being at most \(r-1\) is a Poisson-binomial probability:

$$ P(X_{(r)}>t) =P(N_t\le r-1) =\sum_{\substack{A\subseteq\{1,\ldots,n\}\\ |A|\le r-1}} \ \prod_{i\in A}p_i(t)\prod_{i\notin A}\bigl(1-p_i(t)\bigr) $$

Here \(A\) specifies the observations that are at most \(t\). If instead the first sample is iid with cumulative distribution function \(F\), the count is binomial, which gives the simpler expression below.

$$ P(X_{(r)}>t) =\sum_{j=0}^{r-1}\binom{n}{j}F(t)^j\bigl(1-F(t)\bigr)^{n-j} $$

If the second sample consists of \(m\) iid observations from a continuous distribution with cumulative distribution function \(G\) and density \(g\), its \(s\)th order statistic has density

$$ f_{Y_{(s)}}(t) =\frac{m!}{(s-1)!(m-s)!}\, G(t)^{s-1}\bigl(1-G(t)\bigr)^{m-s}g(t) $$

This density follows by considering a small interval around \(t\): one observation must fall in that interval, \(s-1\) must fall below it, and \(m-s\) must fall above it. The coefficient counts the ways to assign those roles. Multiplying the conditional crossing probability by this density and integrating completes the calculation.

When the formula applies: The samples must be independent, and the conditioning order statistic must have a density for the displayed integral form. The binomial simplification also requires the first sample to be iid. If observations can have atoms, ties can have positive probability and strict versus non-strict comparisons must be handled explicitly; a density-only calculation may not apply.

Worked Comparisons

Worked Example: A Sample Maximum Compared with Another Sample Minimum

A hypothetical laboratory independently records two readings from each of two testing procedures. All four readings are iid \(U(0,1)\), measured in a normalized scale. What is the probability that the larger reading from the first procedure exceeds the smaller reading from the second? No interest rate or mortality assumption is involved; both samples have the stated continuous uniform distribution.

Method. Let \(X_{(2)}\) be the first sample’s maximum and \(Y_{(1)}\) the second sample’s minimum. Condition on \(Y_{(1)}=y\). The minimum of two iid \(U(0,1)\) observations has density \(2(1-y)\) for \(0<y<1\).

For the first sample’s maximum to be at most \(y\), both observations must be at most \(y\). Each has probability \(y\), and the observations are independent, so \(P(X_{(2)}\le y)=y^2\). Therefore,

$$ P(X_{(2)}>y)=1-y^2 $$

Average over the conditioning minimum:

$$ \begin{aligned} P(X_{(2)}>Y_{(1)}) &=\int_0^1 (1-y^2)\,2(1-y)\,dy\\ &=2\int_0^1(1-y-y^2+y^3)\,dy\\ &=2\left(1-\frac12-\frac13+\frac14\right)\\ &=\frac56=0.8333. \end{aligned} $$

Check. The complementary event is that both readings from the first procedure are below both readings from the second. Among four iid continuous observations, each choice of which two observations occupy the lowest two ranks is equally likely. The first procedure occupies both lowest ranks with probability \(1/\binom42=1/6\), so the desired probability is \(1-1/6=5/6\), as calculated. The method also avoids confusing the minimum’s density, \(2(1-y)\), with the maximum’s density, \(2y\).

Worked Example: A Middle Rank Compared with a Sample Maximum

A hypothetical device produces three independent calibration errors \(X_1,X_2,X_3\), each distributed \(U(0,1)\). A separate device produces two independent errors \(Y_1,Y_2\) from the same distribution, independently of the first device. Find the probability that \(X_{(2)}>Y_{(2)}\). No interest rate or mortality assumption is involved; all five errors follow the stated continuous uniform model.

Method. Condition on \(Y_{(2)}=y\), the maximum of the second sample. Its density is \(2y\) for \(0<y<1\). The event \(X_{(2)}>y\) holds when at most one of the three \(X\) observations is at most \(y\). Equivalently, at least two exceed \(y\). The probability is the sum of the cases in which exactly two exceed and all three exceed:

$$ P(X_{(2)}>y) =\binom32(1-y)^2y+(1-y)^3 =(1-y)^2(1+2y) $$

Integrating against the maximum’s density gives

$$ \begin{aligned} P(X_{(2)}>Y_{(2)}) &=\int_0^1 (1-y)^2(1+2y)\,2y\,dy\\ &=2\int_0^1 (y-3y^3+2y^4)\,dy\\ &=2\left(\frac12-\frac34+\frac25\right)\\ &=\frac3{10}=0.3000. \end{aligned} $$

Check. The conditional probability is \(1\) at \(y=0\) and \(0\) at \(y=1\), consistent with the threshold’s endpoints. A common error is to count only the case in which exactly two \(X\) observations exceed \(y\), omitting the case in which all three exceed. That incorrect calculation gives

$$ \int_0^1 2y\cdot 3(1-y)^2y\,dy =6\int_0^1 y^2(1-y)^2\,dy =\frac15=0.2000, $$

which is too small. The rank event is “at least two exceed,” not “exactly two exceed.”

Worked Example: Independent but Nonidentically Distributed Observations

In a hypothetical inspection, the first procedure produces two independent normalized measurements: \(X_1\sim U(0,1)\) and \(X_2\sim U(0,2)\). The second procedure independently produces two measurements, each distributed \(U(0,1)\). Find the probability that the first procedure’s maximum exceeds the second procedure’s minimum. No interest rate or mortality assumption is involved; the distributions and intervals are as stated.

Method. Condition on the second procedure’s minimum \(Y_{(1)}=y\). Since its two observations are iid \(U(0,1)\), the threshold density is \(2(1-y)\) on \(0<y<1\). For this range of \(y\), the individual probabilities of being at most \(y\) are \(P(X_1\le y)=y\) and \(P(X_2\le y)=y/2\). Independence gives

$$ P(X_{(2)}\le y)=P(X_1\le y,\ X_2\le y)=y\left(\frac y2\right)=\frac{y^2}{2}. $$

Thus \(P(X_{(2)}>y)=1-y^2/2\), and

$$ \begin{aligned} P(X_{(2)}>Y_{(1)}) &=\int_0^1\left(1-\frac{y^2}{2}\right)2(1-y)\,dy\\ &=2\int_0^1\left(1-y-\frac{y^2}{2}+\frac{y^3}{2}\right)\,dy\\ &=2\left(1-\frac12-\frac16+\frac18\right)\\ &=\frac{11}{12}=0.9167. \end{aligned} $$

Check. The result is close to one because \(X_2\) can reach values up to \(2\), while the conditioning minimum cannot exceed \(1\). The calculation correctly uses different threshold probabilities for \(X_1\) and \(X_2\); treating the first sample as identically distributed would give the wrong crossing probability.

A Reliable Calculation Sequence

Before integrating, identify exactly which sample supplies the random threshold and which sample is being tested against it. Then translate the tested rank event into a count. This prevents a frequent reversal: \(X_{(r)}>t\) means at most \(r-1\) observations are at or below \(t\), whereas \(X_{(r)}\le t\) means at least \(r\) are at or below \(t\).

1
Name the ranks and samples.
Write the target event explicitly, such as \(X_{(r)}>Y_{(s)}\), and confirm that the two samples are independent.
2
Fix the threshold.
Set \(Y_{(s)}=t\). For the first sample, express \(X_{(r)}>t\) as a count event and calculate that probability using a binomial or Poisson-binomial model as appropriate.
3
Find the threshold density.
Use the distribution of \(Y_{(s)}\), not the density of a different rank from the same sample. Determine its support before writing the integral.
4
Integrate and check.
Average the conditional probability over the threshold density. Check the result is between zero and one and, when possible, verify it by considering the complementary event or rank symmetry.

The main exam trap is to get the correct order-statistic density but the wrong count event, or vice versa. Independence does not make observations within the same sample’s order statistics independent; instead, it allows the conditional crossing probability from one sample to be averaged over the other sample’s threshold distribution. If atoms are present, equal values can occur with positive probability, so the strict comparison and the treatment of ties require additional care.

Key takeaway: For independent continuous samples, compare ranks by conditioning on one order statistic, converting the other rank condition to a threshold count, and integrating against the conditioning order statistic’s density.

Check Your Understanding

For each independent-sample comparison, identify the threshold rank, translate the other rank event into a count, and calculate the probability. All uniform variables below are continuous and independent as stated.

  1. Let \(X_1,X_2\) be iid \(U(0,1)\), and let \(Y\sim U(0,1)\) be independent. Find \(P(X_{(2)}>Y)\). (Answer: \(2/3=0.6667\))
  2. Let \(X_1,X_2\) be iid \(U(0,1)\), and let \(Y\sim U(0,1)\) be independent. Find \(P(X_{(1)}>Y)\). (Answer: \(1/3=0.3333\))
  3. Let \(X_1,X_2,X_3\) be iid \(U(0,1)\), and let \(Y_1,Y_2\) be iid \(U(0,1)\), independently. Find \(P(X_{(2)}>Y_{(1)})\). (Answer: \(7/10=0.7000\))
  4. Let \(X_1\sim U(0,1)\) and \(X_2\sim U(0,2)\) be independent, and let \(Y\sim U(0,1)\) be independent of both. Find \(P(\max(X_1,X_2)>Y)\). (Answer: \(5/6=0.8333\))
  5. Let three independent observations have distributions \(X_1\sim U(0,1)\), \(X_2\sim U(0,2)\), and \(X_3\sim U(0,3)\). Independently, let \(Y\sim U(0,1)\). Find \(P(X_{(2)}>Y)\). (Answer: \(3/4=0.7500\))
Clinical Biostats