Exam P · Joint & Marginal Distributions · Free Lesson

Covariance and Correlation Coefficient for Discrete Random Variables

Free SOA Exam P (Probability) lesson in Joint & Marginal Distributions. 15 min read, ~2,319 words.

If equity and bond returns move in opposite directions, portfolio variance shrinks, diversification works. The covariance and correlation coefficient quantify the direction and strength of linear dependence between two random variables.

Cov(X,Y)=E[(X−μX)(Y−μY)]=E[XY]−E[X]⋅E[Y]\text{Cov}(X,Y) = E[(X-\mu_X)(Y-\mu_Y)] = E[XY] - E[X] \cdot E[Y]

HIGH-FREQUENCY: The computational formula E[XY]−E[X]E[Y] E[XY] - E[X]E[Y] is the standard approach. Compute E[XY] E[XY] from the joint PMF; compute E[X],E[Y] E[X], E[Y] from the marginals.

For discrete random variables:

E[XY]=∑x∑yxy⋅pX,Y(x,y)E[XY] = \sum_x \sum_y xy \cdot p_{X,Y}(x,y)

TRAP: The converse of property 5 is FALSE. Cov=0 \text{Cov} = 0 does NOT imply independence. Covariance only captures linear dependence. Two variables can be maximally dependent with zero covariance if the dependence is nonlinear.

Classic counterexample: Let X X be uniform on {−1,0,1} \{-1, 0, 1\} and Y=X2 Y = X^2 . Then E[X]=0 E[X] = 0 , E[XY]=E[X3]=0 E[XY] = E[X^3] = 0 , so Cov=0 \text{Cov} = 0 . But Y Y is completely determined by X X .

Read the full lesson, free →
Worked examples and practice. Free with a free account, no card.

Common mistakes

Bottom line

Exam shortcut

Compute five quantities in order: E[X] E[X] , E[Y] E[Y] , E[X2] E[X^2] , E[Y2] E[Y^2] , E[XY] E[XY] . For E[XY] E[XY] with a table, sum only cells where both x x and y y are nonzero. "Covariance = Cross minus Product of means." Pattern matches variance: Var(X)=E[X2]−(E[X])2 \text{Var}(X) = E[X^2] - (E[X])^2 . "Variance of a sum = sum of variances plus twice the covariance." The 2 is there because (X+Y)2 (X+Y)^2 has a cross-term 2XY 2XY .

The full lesson (about 2,319 words, 15 min read) adds 3 worked examples, all 6 common mistakes, a self-check, free in the app.

Learning objectives

Browse all free Exam P lessons or jump into free Exam P practice questions.