Covariance
On this page
Direct answer
How two random variables move together gets its own number: Cov(X, Y) = E[XY] − E[X]E[Y], the expected product of paired deviations — positive when the variables rise together, negative when they oppose, zero under independence. The converse fails: zero covariance does not force independence, the standard counterexample being X uniform on {−1, 0, 1} with Y = X², where E[XY] = 0 yet Y is completely determined by X. The operational identities: Cov(X, X) = Var(X); Var(aX + bY) = a²Var X + b²Var Y + 2ab Cov(X, Y); and the correlation coefficient ρ = Cov(X, Y)/(σXσY) is trapped in [−1, 1], hitting ±1 only under perfect linear dependence.
What you must remember
- Definition: Cov(X, Y) = E[XY] − E[X]E[Y] — computing E[XY] from the joint distribution is the whole of most problems.
- Independence one-way street: independence forces zero covariance; zero covariance does not force independence, with the X versus X² counterexample the quotable witness.
- Self-covariance: Cov(X, X) = Var(X), so variance is a special case — the formulas below then specialise to familiar ones.
- Variance of a sum: Var(X + Y) = Var X + Var Y + 2Cov(X, Y); Var(X − Y) = Var X + Var Y − 2Cov(X, Y); independence deletes the cross term, not the others.
- Bilinearity: Cov(aX + b, Y) = a Cov(X, Y) — constants drop out, coefficients scale through.
- Correlation coefficient: ρ = Cov/(σXσY) ∈ [−1, 1], sign matching the covariance's, magnitude 1 exactly on a perfect straight line.
- Computational route: from a joint distribution, first the marginals (E[X], E[Y]), then E[XY] as Σ x·y·P(X = x, Y = y), then one subtraction.
One joint table, three numbers
Take a joint distribution on {0, 1} × {0, 1}: P(0, 0) = 0.3, P(0, 1) = 0.2, P(1, 0) = 0.1 and P(1, 1) = 0.4. The marginals first: P(X = 1) = 0.1 + 0.4 = 0.5, so E[X] = 0.5; P(Y = 1) = 0.2 + 0.4 = 0.6, so E[Y] = 0.6. The product expectation is E[XY] = 1 × 1 × 0.4 = 0.4 — the only cell where both variables equal 1 contributes. Then Cov(X, Y) = 0.4 − 0.5 × 0.6 = 0.4 − 0.30 = 0.1, positive: high X travels with high Y in this table. Now the variance identity as a self-check: Var X = 0.5 − 0.25 = 0.25, Var Y = 0.6 − 0.36 = 0.24, so Var(X + Y) = 0.25 + 0.24 + 2(0.1) = 0.69. Verify directly: X + Y takes 0 with probability 0.3, 1 with 0.3 and 2 with 0.4, giving E = 1.1, E[(X + Y)²] = 0.3 + 1.6 = 1.9, and 1.9 − 1.21 = 0.69. Two routes agreeing is the arithmetic audit worth performing on every joint-distribution answer.
Covariance is not independence
JEE Main asks the joint-table computation and the variance-of-sum identity, and the recurring loss is the forgotten cross term — Var(X + Y) computed as the plain sum 0.49 instead of 0.69 whenever positive covariance binds the variables. Data-based variants give paired observations and ask for the sample covariance: Σ(xi − x̄)(yj − ȳ)/n, the same machinery with frequencies in disguise. JEE Advanced leans on the conceptual boundary: construct or identify a pair with zero covariance but dependence (the X, X² example, or the uniform angle pair cos Θ, sin Θ, both zero-mean with zero product expectation yet locked together by cos² + sin² = 1), and interpret ρ — knowing |ρ| = 1 certifies a linear relation, while ρ = 0 certifies nothing about nonlinear structure. The unit trap deserves respect: covariance carries the units of X times Y, which is exactly why the correlation coefficient divides by both standard deviations before any comparison. Guard the order of computation — marginals, product expectation, subtraction — because E[XY] computed from marginals instead of the joint table is the single most common and least detectable error in the chapter.
Frequently asked questions
What is the formula for covariance?
Cov(X, Y) = E[XY] − E[X]E[Y], with E[XY] computed from the joint distribution of the pair.
Does zero covariance imply independence?
No — independence implies zero covariance, but X with Y = X² (X uniform on {−1, 0, 1}) has zero covariance with full dependence.
How does covariance enter Var(X + Y)?
Var(X + Y) = Var X + Var Y + 2Cov(X, Y); independence removes the cross term, giving the familiar additive form.
What is the correlation coefficient?
ρ = Cov(X, Y)/(σX σY), a unit-free measure in [−1, 1] that reaches ±1 only under exact linear dependence.
How do you compute E[XY] from a joint table?
Sum x·y·P(X = x, Y = y) over all cells — only cells where both variables are nonzero contribute.