Skip to content

Cauchy–Schwarz Inequality for Random Variables

Theorem

For random variables XX and YY with E[X2]<∞\mathbb{E}[X^2]<\infty and E[Y2]<∞\mathbb{E}[Y^2]<\infty (which also makes XYXY integrable),

(E[XY])2≤E[X2]⋅E[Y2].\begin{aligned} (\mathbb{E}[X Y])^2\leq \mathbb{E}[X^2]\cdot \mathbb{E}[Y^2]. \end{aligned}

If either second moment is zero, equality holds trivially.

For centred variables, the second moments are their Variance and Standard Deviation quantities: applying the inequality to X−EXX-\mathbb{E}X and Y−EYY-\mathbb{E}Y gives ∣Cov⁡(X,Y)∣≤σXσY|\operatorname{Cov}(X,Y)|\le\sigma_X\sigma_Y.


Interpretation

The average product E[XY]\mathbb{E}[XY] of two variables with finite second moments can never exceed the product of their root-mean-square sizes E[X2]\sqrt{\mathbb{E}[X^2]} and E[Y2]\sqrt{\mathbb{E}[Y^2]}. Applied to centred variables, this bounds covariance and keeps correlation between −1-1 and 11.

Two arrows X and Y from a common origin at an angle theta, with lengths given by the square roots of their second moments, and the shadow of Y projected onto X.

The figure draws XX and YY as arrows of lengths E[X2]\sqrt{\mathbb{E}[X^2]} and E[Y2]\sqrt{\mathbb{E}[Y^2]}, with E[XY]\mathbb{E}[XY] in the role of the inner product. When E[X2]>0\mathbb{E}[X^2]>0, the shadow of YY on XX has length ∣E[XY]∣/E[X2]|\mathbb{E}[XY]|/\sqrt{\mathbb{E}[X^2]}, and a shadow is never longer than the arrow itself; squaring gives the inequality. When both second moments are positive, the inequality also makes cos⁡θ=E[XY]/(E[X2]E[Y2])\cos\theta=\mathbb{E}[XY]/\bigl(\sqrt{\mathbb{E}[X^2]}\sqrt{\mathbb{E}[Y^2]}\bigr) a number in [−1,1][-1,1], so that θ\theta is a genuine angle. Under this condition, equality means the arrows lie on one line, the Key Result Y=cXY=cX almost surely. If either second moment is zero, equality holds trivially and the angle is undefined.

This is the Cauchy–Schwarz inequality from Math II in a new setting. If the sample space has mm equally likely outcomes, E[XY]\mathbb{E}[XY] is 1m\tfrac{1}{m} times the dot product of the vectors of values of XX and YY, so the two statements coincide. Taking X−EXX-\mathbb{E}X and Y−EYY-\mathbb{E}Y gives ∣Cov⁡(X,Y)∣≤σXσY|\operatorname{Cov}(X,Y)|\le\sigma_X\sigma_Y, and when Var⁡(X)>0\operatorname{Var}(X)>0 equality holds only for an exact linear relation Y=a+bXY=a+bX almost surely.

A tempting but false version is E[XY]≤EX⋅EY\mathbb{E}[XY]\le\mathbb{E}X\cdot\mathbb{E}Y. For Y=XY=X it would say E[X2]≤(EX)2\mathbb{E}[X^2]\le(\mathbb{E}X)^2, which fails for every XX with positive variance; the correct bound uses second moments on the right.


Key Results

  • ∣Cov⁡(X,Y)∣≤Var⁡(X)Var⁡(Y)|\operatorname{Cov}(X,Y)|\le\sqrt{\operatorname{Var}(X)\operatorname{Var}(Y)}.
  • If both second moments are positive, equality holds exactly when Y=cXY=cX almost surely for some real cc.

Examples

  • If E[X2]=4\mathbb{E}[X^2]=4 and E[Y2]=9\mathbb{E}[Y^2]=9, then ∣E[XY]∣≤6|\mathbb{E}[XY]|\le6.
  • Taking Y=1Y=1 gives (EX)2≤E[X2](\mathbb{E}X)^2\le\mathbb{E}[X^2]; for a fair die this is 12.25≤91/612.25\le91/6.

Prerequisites

Sources

Symbols: infinity, sigma, square root, theta

Last updated: 27 October 2026 11:52