St · Statistics & Probability

How to Find the Probability That X₂ Is Larger Than X₁

Published By the 9to5Science editorial team

At a glance

  1. 1. Define the distributions

    Identify each variable’s mean and variance, and determine whether the variables are independent or correlated.

  2. 2. Form the difference

    Set D = X₂ − X₁; the event X₂ > X₁ is the event D > 0.

  3. 3. Find D’s distribution

    For jointly normal variables, D is normal with mean μ₂ − μ₁ and variance σ₁² + σ₂² − 2Cov(X₁, X₂).

  4. 4. Standardize and evaluate

    Convert zero to a standard-normal score and use the normal CDF to find the probability that D is positive.

Try it: Normal probability calculator

To find the probability that one random quantity exceeds another, look at their difference: X2>X1X_2 > X_1 exactly when X2−X1>0X_2 - X_1 > 0. For normal variables, this turns the comparison into a normal-tail probability. The answer depends not only on the two means and variances, but also on whether the variables are dependent.

If the variables are independent and normally distributed, the probability is

P(X2>X1)=Φ(μ2−μ1σ12+σ22),P(X_2 > X_1) = \Phi\left(\frac{\mu_2-\mu_1}{\sqrt{\sigma_1^2+\sigma_2^2}}\right),

where μi\mu_i and σi2\sigma_i^2 are the mean and variance of XiX_i, and Φ\Phi is the standard normal cumulative distribution function. The formula changes slightly when the variables are correlated.

Why the difference gives the answer

Define D=X2−X1D=X_2-X_1. Then the comparison is simply

P(X2>X1)=P(D>0).P(X_2>X_1)=P(D>0).

When X1X_1 and X2X_2 are independent normal variables, their difference is normal as well. Its mean is μ2−μ1\mu_2-\mu_1, and its variance is the sum of their variances:

D∼N(μ2−μ1,  σ12+σ22).D \sim \mathcal{N}(\mu_2-\mu_1,\;\sigma_1^2+\sigma_2^2).

Standardizing DD gives a standard normal variable. The cutoff D=0D=0 becomes the standardized value −(μ2−μ1)/σ12+σ22-(\mu_2-\mu_1)/\sqrt{\sigma_1^2+\sigma_2^2}. Using the symmetry of the standard normal distribution yields the formula above.

Here, N(μ,σ2)\mathcal{N}(\mu,\sigma^2) uses the convention that the second parameter is the variance, not the standard deviation.

Worked example: independent normal variables

Suppose

X1∼N(10,4),X2∼N(12,9),X_1 \sim \mathcal{N}(10,4), \qquad X_2 \sim \mathcal{N}(12,9),

and assume they are independent. Their means are 1010 and 1212, and their variances are 44 and 99. Thus D=X2−X1D=X_2-X_1 has mean 22 and variance 1313:

D∼N(2,13).D \sim \mathcal{N}(2,13).

The standard deviation of DD is 13\sqrt{13}. Therefore,

P(X2>X1)=P(D>0)=Φ(213)≈Φ(0.555)≈0.710.\begin{aligned} P(X_2>X_1) &=P(D>0)\\ &=\Phi\left(\frac{2}{\sqrt{13}}\right)\\ &\approx \Phi(0.555)\\ &\approx 0.710. \end{aligned}

So X2X_2 is larger than X1X_1 about 71% of the time under these assumptions. Notice that this is not the probability that X2X_2 is positive; it is the probability that its realized value exceeds the realized value of X1X_1.

If the variables are correlated

If X1X_1 and X2X_2 are jointly normal but not necessarily independent, their difference is still normal. Its variance includes the covariance:

Var⁡(X2−X1)=σ12+σ22−2Cov⁡(X1,X2).\operatorname{Var}(X_2-X_1)=\sigma_1^2+\sigma_2^2-2\operatorname{Cov}(X_1,X_2).

Consequently,

P(X2>X1)=Φ(μ2−μ1σ12+σ22−2Cov⁡(X1,X2)),P(X_2>X_1)=\Phi\left(\frac{\mu_2-\mu_1}{\sqrt{\sigma_1^2+\sigma_2^2-2\operatorname{Cov}(X_1,X_2)}}\right),

provided the difference has positive variance. If the correlation is ρ\rho, then Cov⁡(X1,X2)=ρσ1σ2\operatorname{Cov}(X_1,X_2)=\rho\sigma_1\sigma_2, so the denominator is

σ12+σ22−2ρσ1σ2.\sqrt{\sigma_1^2+\sigma_2^2-2\rho\sigma_1\sigma_2}.

For example, if both variables have variance 11 and correlation 0.50.5, the difference has variance 1+1−2(0.5)=11+1-2(0.5)=1. Positive correlation reduces the variability of the difference in this case. Ignoring that dependence would give a different probability.

What if the variables are not normal?

Knowing only the means and variances is generally not enough to determine P(X2>X1)P(X_2>X_1) for nonnormal variables. You need information about their distributions and dependence. If they are independent and have continuous densities, one general expression is

P(X2>X1)=∫−∞∞f2(x)F1(x) dx,P(X_2>X_1)=\int_{-\infty}^{\infty} f_2(x)F_1(x)\,dx,

where f2f_2 is the density of X2X_2 and F1F_1 is the cumulative distribution function of X1X_1. This adds up the probability that X2X_2 takes a value near xx and X1X_1 is below that value.

A useful special case does not require normality: if X1X_1 and X2X_2 are independent, identically distributed, and continuous, symmetry gives P(X2>X1)=1/2P(X_2>X_1)=1/2. For independent, identically distributed variables that can tie, the correct statement is P(X2>X1)=P(X1>X2)=(1−P(X1=X2))/2P(X_2>X_1)=P(X_1>X_2)=(1-P(X_1=X_2))/2.

Common mistakes

  • Adding standard deviations instead of variances. For independent variables, add σ12\sigma_1^2 and σ22\sigma_2^2, then take the square root.
  • Assuming independence without justification. If the variables are correlated, include their covariance when they are jointly normal.
  • Using only the difference of means. The mean difference sets the center, but the spread also affects the probability.
  • Confusing the event with a one-variable probability. P(X2>X1)P(X_2>X_1) compares two random outcomes; it is not generally the same as P(X2>0)P(X_2>0).
  • Applying the normal formula to arbitrary distributions. The difference is normal if the variables are jointly normal; independent normal marginals are one common sufficient case. Normal marginal distributions alone do not guarantee a jointly normal pair.

References

  1. Introduction to Mathematical Statistics — Robert V. Hogg, Joseph W. McKean, and Allen T. Craig
  2. Probability and Statistical Inference — Robert V. Hogg, Elliot A. Tanis, and Dale L. Zimmerman

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.