Inkerval

Covariance & correlation practice problems

In this topic you compute covariance and correlation for two random variables. Covariance is E[XY] minus E[X]E[Y]. A positive value means large values of one tend to come with large values of the other. Correlation rescales covariance to a number between -1 and 1. Recognition cue: the problem involves two random variables at once, for example the variance of a sum or a two-asset portfolio. You will practice: covariance definition, bilinearity and shift rules, variance of sums, correlation and independence.

11 problems, each with a worked answer. Work them on paper, in order — the difficulty ramps gently.

1.

A student's daily study hours X and coffee cups Y satisfy E[X] = 2, E[Y] = 3, and E[XY] = 10. Find Cov(X, Y).

Show answer

Answer:

Apply the computing formula for covariance directly.

The positive covariance means more study hours tend to come with more coffee.

2.

A commute has two legs with durations X and Y (minutes), where Var(X) = 4, Var(Y) = 9, and Cov(X, Y) = 2. Find Var(X + Y), the variance of the total commute time.

Show answer

Answer:

Use the variance formula for a sum.

The positive covariance, from traffic delaying both legs, adds variance beyond the independent case.

3.

Two exam scores satisfy Cov(X, Y) = 6, Var(X) = 9, Var(Y) = 16. Find the correlation ρ(X, Y).

Show answer

Answer:

Take square roots of the variances to get the standard deviations.

This lies safely inside the interval from -1 to 1.

4.

Two independent noise sources have Var(X) = 5 and Var(Y) = 3. Find Var(X − Y).

Show answer

Answer:

Independence makes the covariance zero.

Variances add even for a difference. They never subtract.

5.

Two food trucks on opposite sides of a city have daily sales X and Y. X and Y are independent. Find Cov(X, Y).

Show answer

Answer:

Independent random variables have zero covariance.

6.

The noon temperature X at a weather station has Var(X) = 6. Find Cov(X, X).

Show answer

Answer:

The covariance of a variable with itself is its variance.

7.

A kitchen scale reads exactly 100 grams too high, so a dough's recorded weight is W = X + 100, where X is the true weight. The bake time is Y, and Cov(X, Y) = 7. Find Cov(W, Y).

Show answer

Answer:

Adding a constant does not change covariance.

8.

Roll a fair four-sided die once and let X be the number shown. Let Y = 2X. Find Cov(X, Y).

Show answer

Answer:

Pull the constant out: Cov(X, 2X) = 2 Var(X). Then compute Var(X) for the four-sided die.

9.

Two swimmers race in the same pool. Their finishing times X and Y satisfy Var(X) = 10, Var(Y) = 6, and Cov(X, Y) = 3. Find Var(X − Y).

Show answer

Answer:

Use the variance formula for a difference.

10.

For a breed of dogs, shoulder height X has standard deviation 2 cm and weight Y has standard deviation 5 kg. The correlation is ρ(X, Y) = 0.6. Find Cov(X, Y).

Show answer

Answer:

Covariance is the correlation times both standard deviations.

11.

Random variables X and Y satisfy ρ(X, Y) = −0.4. Let U = −2X + 7 and V = 3Y − 1. Find ρ(U, V).

Show answer

Answer:

Correlation is invariant under affine maps up to the sign of the product of the slopes. The slopes are −2 and 3, so the product is negative and the sign flips.

Inkerval is handwritten math practice for iPad and Apple Pencil. You solve by hand; it remembers what you know and brings it back when it should.

$29 a month, after a 14-day free trial. The waitlist is open now.

Be first in when the doors open. No spam, ever.

More probability practice