Why Independence Has a Covariance Consequence
Covariance measures how two random variables vary together around their means. Independence is a stronger condition: it says that knowing one variable gives no probabilistic information about the other. A key consequence is that, when the variables have finite second moments, their covariance is zero.
This implication is useful in calculations because covariance can be written using just three expectations: \(E[XY]\), \(E[X]\), and \(E[Y]\). Under independence, the expectation of the product factors into the product of the expectations. The finite-moment assumptions matter: they ensure the expectations in the covariance calculation exist as finite quantities.
Finite second moments imply finite first moments: by Cauchy–Schwarz, \(E[|X|]\leq \sqrt{E[X^2]}\), and likewise for \(Y\). Also, Cauchy–Schwarz gives \(E[|XY|]\leq \sqrt{E[X^2]E[Y^2]}<\infty\). Thus all terms in the covariance formula are well-defined and finite.
Factoring the Product Expectation
The expectation factorization used here is a direct consequence of independence. Precisely, if \(X\) and \(Y\) are independent, their joint distribution is the product of their marginal distributions. For integrable functions \(g\) and \(h\), the corresponding factorization result is \(E[g(X)h(Y)]=E[g(X)]E[h(Y)]\), provided the product is integrable. In the covariance calculation, we use \(g(x)=x\) and \(h(y)=y\).
Proof. The joint distribution of \((X,Y)\) is the product measure \(F_X\otimes F_Y\), where \(F_X\) and \(F_Y\) denote the marginal distributions. The finite second moments imply $$ \int |xy|\,d(F_X\otimes F_Y)(x,y) = \left(\int |x|\,dF_X(x)\right) \left(\int |y|\,dF_Y(y)\right) =E[|X|]E[|Y|]<\infty. $$ Therefore Fubini’s theorem applies to the integral of \(xy\). It gives $$ E[XY] =\int xy\,d(F_X\otimes F_Y)(x,y) =\left(\int x\,dF_X(x)\right)\left(\int y\,dF_Y(y)\right) =E[X]E[Y]. $$ Using the covariance identity, we obtain $$ \operatorname{Cov}(X,Y)=E[XY]-E[X]E[Y]=0. $$ \(\square\)
The calculation uses two distinct facts. Finite second moments guarantee integrability, while independence gives the product form of the joint distribution. Having only one of these facts is not enough to justify this argument.
Worked Covariance Calculations
Worked Example: A Bernoulli Variable and a Poisson Variable
Let \(X\sim\operatorname{Bernoulli}(0.4)\) and \(Y\sim\operatorname{Poisson}(3)\), and suppose \(X\) and \(Y\) are independent. Find their covariance.
For a Bernoulli variable with success probability \(0.4\), \(E[X]=0.4\) and \(E[X^2]=0.4\), since \(X^2=X\). For a Poisson variable with mean \(3\), \(E[Y]=3\) and \(\operatorname{Var}(Y)=3\), so \(E[Y^2]=3+3^2=12\). In particular, both variables have finite second moments.
Independence allows the product expectation to factor: $$ E[XY]=E[X]E[Y]=(0.4)(3)=1.2. $$ Thus $$ \operatorname{Cov}(X,Y)=E[XY]-E[X]E[Y]=1.2-(0.4)(3)=0. $$
The event \(X=1\) does not change the distribution of \(Y\), which is the probabilistic content behind the factorization in this example.
Worked Example: Independent Uniform Variables
Let \(X\sim\operatorname{Uniform}(0,2)\) and \(Y\sim\operatorname{Uniform}(-1,3)\), independently. Calculate \(E[XY]\) directly and then find the covariance.
The densities are \(f_X(x)=1/2\) for \(0<x<2\) and \(f_Y(y)=1/4\) for \(-1<y<3\). By independence, the joint density on this rectangle is their product, \(1/8\). Therefore $$ E[XY] =\int_0^2\int_{-1}^3 xy\left(\frac18\right)\,dy\,dx =\frac18\left(\int_0^2 x\,dx\right)\left(\int_{-1}^3 y\,dy\right) =\frac18(2)(4)=1. $$
The marginal means are $$ E[X]=\int_0^2 x\left(\frac12\right)\,dx=1, \qquad E[Y]=\int_{-1}^3 y\left(\frac14\right)\,dy=1. $$ Both distributions are bounded, so their second moments are finite. Consequently, $$ \operatorname{Cov}(X,Y)=E[XY]-E[X]E[Y]=1-(1)(1)=0. $$
In the double integral, the separate factors \(x\) and \(y\) and the product form of the density let us separate the integrations. This is the density-based version of expectation factorization.
Worked Example: An Affine Transformation of an Independent Variable
Suppose \(X\sim N(2,9)\) and \(Y\sim\operatorname{Bernoulli}(0.2)\) are independent. Find \(\operatorname{Cov}(X,5Y+1)\).
Write \(W=5Y+1\). Since \(E[X]=2\) and \(E[Y]=0.2\), $$ E[W]=5E[Y]+1=5(0.2)+1=2. $$ The variables \(X\) and \(W\) are independent because \(W\) is a function of \(Y\), which is independent of \(X\). Both have finite second moments: \(X\) has variance \(9\), and \(W\) takes only the values \(1\) and \(6\).
First factor the expectation of the product: $$ E[XW]=E[X(5Y+1)] =5E[XY]+E[X] =5E[X]E[Y]+E[X] =5(2)(0.2)+2=4. $$ Also, \(E[X]E[W]=(2)(2)=4\). Hence $$ \operatorname{Cov}(X,5Y+1)=E[XW]-E[X]E[W]=4-4=0. $$
The constant added to \(Y\) changes the mean of the transformed variable, and the multiplier changes its scale. Neither prevents the independence-based product calculation.
Covariance Under Affine Transformations
The previous example illustrates a general algebraic rule. If \(X\) and \(Y\) have finite second moments and \(a,b,c,d\) are constants, their affine transformations also have finite second moments. Their covariance is determined by the two scale factors; adding constants does not affect it.
Proof. Linearity of expectation gives \(E[aX+b]=aE[X]+b\) and \(E[cY+d]=cE[Y]+d\). Subtracting these means from the transformed variables gives $$ (aX+b)-E[aX+b]=a(X-E[X]), $$ and $$ (cY+d)-E[cY+d]=c(Y-E[Y]). $$ By the definition of covariance, $$ \begin{aligned} \operatorname{Cov}(aX+b,cY+d) &=E\left[\big(a(X-E[X])\big)\big(c(Y-E[Y])\big)\right]\\ &=ac\,E\big[(X-E[X])(Y-E[Y])\big]\\ &=ac\,\operatorname{Cov}(X,Y). \end{aligned} $$ All expectations exist because the original variables have finite second moments. \(\square\)
In particular, if \(X\) and \(Y\) are independent with finite second moments, their covariance is zero, and the covariance of any affine transformation of \(X\) with any affine transformation of \(Y\) is also zero. The proposition itself does not require independence; independence is one sufficient reason for the original covariance to vanish.
What Zero Covariance Tells Us
The theorem supplies a convenient consequence of independence, not a replacement definition for it. When independence and the moment conditions are established, zero covariance follows without needing to calculate a joint integral, sum over a joint probability table, or derive a special formula for the model.
Covariance also depends on measurement scale. If one variable is multiplied by a constant, its covariance with another variable is multiplied by that same constant; if a constant is added, covariance is unchanged. The affine-transformation rule makes these effects explicit. It also means that a zero covariance remains zero under separate affine changes of units.
Common Mistakes
- Factoring without independence. The identity \(E[XY]=E[X]E[Y]\) in this proof follows from independence. It is not a general rule for arbitrary pairs of random variables.
- Ignoring moment conditions. To use the stated theorem, check that \(E[X^2]\) and \(E[Y^2]\) are finite. These conditions ensure the covariance and the expectations used in its formula are finite.
- Confusing the implication with a definition. Independence implies zero covariance under the stated moment conditions. Zero covariance alone is not the definition of independence and does not, in general, establish independence.
- Forgetting the product of means. Covariance is \(E[XY]-E[X]E[Y]\), not just \(E[XY]\). Even when the covariance is zero, \(E[XY]\) need not be zero; it equals \(E[X]E[Y]\).
Check Your Understanding
Try these questions using the definitions and calculations above.
- State the moment conditions in the theorem and explain why they ensure that \(E[XY]\) is finite.
- If independent variables have means \(E[X]=3\) and \(E[Y]=-2\), what is \(E[XY]\), and what is their covariance, assuming finite second moments?
- Suppose \(X\) and \(Y\) are independent with finite second moments. Find \(\operatorname{Cov}(2X+7,-3Y+4)\) in terms of \(\operatorname{Cov}(X,Y)\).
- Why is independence needed when factoring \(E[XY]\) in the theorem’s proof?
- A calculation gives \(E[XY]=8\), \(E[X]=2\), and \(E[Y]=4\). What is the covariance? Does that calculation alone establish independence?