Why Covariance Has a Bound
Covariance describes how two random variables vary together, but its numerical size depends on the units and scales of both variables. Even so, it cannot be arbitrarily large once their variances are fixed. A precise upper bound follows from the fact that the square of any real-valued random variable is nonnegative. This bound is useful both as a check on covariance calculations and as a way to control the variance of sums and differences.
The assumptions matter. The result below applies when both variables have finite second moments; that condition ensures their means and variances exist and that the covariance is finite.
The two sides have matching units: covariance has the product of the units of \(X\) and \(Y\), as does the square root of the product of their variances. The absolute value is essential because covariance may be positive or negative.
Proof from a Nonnegative Square
Center the variables by setting \(U=X-E[X]\) and \(V=Y-E[Y]\). Then \(E[U]=E[V]=0\), \(E[U^2]=\operatorname{Var}(X)\), \(E[V^2]=\operatorname{Var}(Y)\), and \(E[UV]=\operatorname{Cov}(X,Y)\). These expectations are finite: for example, \(E[X^2]<\infty\) implies \(E[|X|]<\infty\) by the usual second-moment inequality, and centering preserves a finite second moment. Also, \(2|UV|\leq U^2+V^2\), so \(E[|UV|]<\infty\).
Proof. Let \(a=E[U^2]\), \(b=E[V^2]\), and \(c=E[UV]\). If \(a>0\), then for every real \(t\), the square \((V-tU)^2\) is nonnegative, and therefore
Choose \(t=c/a\). Substitution gives
Since \(a=\operatorname{Var}(X)\), \(b=\operatorname{Var}(Y)\), and \(c=\operatorname{Cov}(X,Y)\), taking nonnegative square roots proves the stated bound when \(a>0\). If \(a=0\), then \(E[U^2]=0\); a nonnegative random variable with expectation zero is zero with probability one, so \(U=0\) with probability one. Thus \(c=E[UV]=0\), and both sides of the bound are zero. The same argument applies if \(b=0\).
For equality when \(a>0\), the calculation at \(t=c/a\) shows that \(c^2=ab\) exactly when \(E[(V-(c/a)U)^2]=0\). A nonnegative square has expectation zero exactly when it is zero with probability one. Hence equality is equivalent to \(V=(c/a)U\) with probability one. When \(a\) and \(b\) are both positive, this proportionality constant cannot be zero. Conversely, if \(V=kU\) with probability one, then \(c=k a\) and \(b=k^2a\), so \(c^2=ab\). This proves both directions of the equality condition. \(\square\)
The proof also explains the degenerate case. If \(X\) is constant with probability one, then its variance and its covariance with any finite-second-moment \(Y\) are zero. The bound is an equality, even if \(Y\) is not constant. Thus the general equality statement should not be shortened to “the centered variables must be nonzero multiples of each other”: that description requires both variances to be positive.
Worked Examples
Worked Example: Exact Equality for Proportional Deviations
Let \(Z\) take the values \(-1\) and \(1\), each with probability \(1/2\), and define \(X=4+2Z\) and \(Y=1-3Z\). Calculate their means, variances, and covariance, and check the bound.
Because \(E[Z]=(-1)(1/2)+(1)(1/2)=0\) and \(E[Z^2]=1\), the means are \(E[X]=4+2E[Z]=4\) and \(E[Y]=1-3E[Z]=1\). The centered variables are \(X-E[X]=2Z\) and \(Y-E[Y]=-3Z\).
Their variances are $$ \operatorname{Var}(X)=E[(2Z)^2]=4E[Z^2]=4, \qquad \operatorname{Var}(Y)=E[(-3Z)^2]=9E[Z^2]=9. $$ Their covariance is $$ \operatorname{Cov}(X,Y)=E[(2Z)(-3Z)]=-6E[Z^2]=-6. $$ Therefore $$ |\operatorname{Cov}(X,Y)|=6 \quad\text{and}\quad \sqrt{\operatorname{Var}(X)\operatorname{Var}(Y)} =\sqrt{4\cdot 9}=6. $$ Equality holds because \(Y-E[Y]=-\frac{3}{2}(X-E[X])\) with probability one. The negative proportionality accounts for the negative covariance.
Worked Example: A Strict Inequality for Independent Bernoulli Variables
Let \(X\) and \(Y\) be independent Bernoulli random variables, each equal to \(1\) with probability \(1/2\) and \(0\) with probability \(1/2\). Calculate both sides of the bound and determine whether equality holds.
For each variable, \(E[X]=E[Y]=1/2\), and \(E[X^2]=E[X]=1/2\) because \(X^2=X\). Thus $$ \operatorname{Var}(X)=\frac12-\left(\frac12\right)^2=\frac14, \qquad \operatorname{Var}(Y)=\frac14. $$ Independence gives \(E[XY]=E[X]E[Y]=1/4\), so $$ \operatorname{Cov}(X,Y)=E[XY]-E[X]E[Y] =\frac14-\frac14=0. $$ The right side of the bound is $$ \sqrt{\operatorname{Var}(X)\operatorname{Var}(Y)} =\sqrt{\frac14\cdot\frac14}=\frac14. $$ Hence \(0\leq 1/4\), and the inequality is strict. In particular, equality does not follow merely because both variables have positive variance; it requires their centered values to be proportional with probability one.
Worked Example: Bounding the Variance of a Linear Combination
Suppose \(E[X]=3\), \(E[Y]=-1\), \(\operatorname{Var}(X)=4\), and \(\operatorname{Var}(Y)=9\). The joint distribution is not specified. Find a bound on \(\operatorname{Var}(2X-3Y)\), and check whether either endpoint can occur.
By bilinearity of covariance and the variance expansion for a linear combination, $$ \operatorname{Var}(2X-3Y) =4\operatorname{Var}(X)+9\operatorname{Var}(Y)-12\operatorname{Cov}(X,Y). $$ The covariance bound gives $$ |\operatorname{Cov}(X,Y)|\leq\sqrt{4\cdot9}=6, \quad\text{so}\quad -6\leq\operatorname{Cov}(X,Y)\leq6. $$ The variance expression decreases as the covariance increases. Substituting the two possible extremes yields $$ 4(4)+9(9)-12(6)=16+81-72=25 $$ at covariance \(6\), and $$ 4(4)+9(9)-12(-6)=16+81+72=169 $$ at covariance \(-6\). Consequently \(25\leq\operatorname{Var}(2X-3Y)\leq169\).
Both endpoints are attainable. Use the variable \(Z\) from the first example, for which \(E[Z]=0\) and \(\operatorname{Var}(Z)=1\). If \(X=3+2Z\) and \(Y=-1+3Z\), then the means and variances are as specified and \(\operatorname{Cov}(X,Y)=6\), giving variance \(25\). If instead \(X=3+2Z\) and \(Y=-1-3Z\), then \(\operatorname{Cov}(X,Y)=-6\), giving variance \(169\). Thus the bound alone gives the full attainable interval in this case.
Equality, Units, and Common Mistakes
With positive variances, equality has a specific structural meaning: once the means are subtracted, one random variable is a fixed multiple of the other, except possibly on an event of probability zero. It does not require \(X=Y\). The multiple may be negative, as in the first example, or positive. If one variance is zero, equality instead follows because the corresponding centered variable is zero with probability one.
- Mistake: treating the right side as a universal numerical limit. The bound is not always \(1\), or any other fixed number. It depends on both variances and therefore on the variables' scales and units. Calculate the variances before using it.
- Mistake: dropping the absolute value. Covariance can be negative. The correct pair of inequalities is \(-\sqrt{\operatorname{Var}(X)\operatorname{Var}(Y)}\leq\operatorname{Cov}(X,Y)\leq\sqrt{\operatorname{Var}(X)\operatorname{Var}(Y)}\).
- Mistake: interpreting equality as identical variables. Equality with positive variances means \(Y-E[Y]=k(X-E[X])\) with probability one for some nonzero constant \(k\), not necessarily \(Y=X\). Different means and scales are allowed.
- Mistake: using the result without finite second moments. The theorem assumes \(E[X^2]\) and \(E[Y^2]\) are finite. Without that assumption, the variances or covariance in the statement may not be defined as finite quantities.
The practical value of the bound is that it limits the effect of an unknown dependence structure. When the marginal variances are known but the joint distribution is not, it still supplies a valid range for covariance and can turn a variance formula into upper and lower bounds. When computing a covariance, it also provides a quick consistency check: a reported value outside the bound signals an error in the calculation or an unmet moment assumption.
Check Your Understanding
Try these questions using the hypotheses and equality condition stated above.
- If \(\operatorname{Var}(X)=16\) and \(\operatorname{Var}(Y)=25\), what interval must contain \(\operatorname{Cov}(X,Y)\)?
- If \(Y-E[Y]=-\frac{1}{2}(X-E[X])\) with probability one and \(\operatorname{Var}(X)=8\), find \(\operatorname{Cov}(X,Y)\) and \(\operatorname{Var}(Y)\).
- Why does the bound hold with equality when \(\operatorname{Var}(X)=0\), regardless of whether \(Y\) is constant?
- For \(\operatorname{Var}(X)=1\) and \(\operatorname{Var}(Y)=4\), can covariance equal \(3\)? Explain using the bound.
- What additional condition, beyond positive finite variances, is necessary for equality in the covariance bound?