1.3.9 · D5Probability & Statistics

Question bank — Covariance and correlation

1,314 words6 min readBack to topic

This is a question bank of traps. Each line is a question ::: answer reveal. Cover the answer, commit to a response, then check. The goal is not arithmetic (see the worked-example decks for that) — it is to catch the conceptual slips that this topic is famous for. Parent: 1.3.09 Covariance and correlation.


True or false — justify

If then and are independent.
False. only kills the linear trend; a curved dependence like can be perfectly deterministic yet have . Independence is strictly stronger than uncorrelatedness.
If and are independent then .
True. Independence gives , so . This direction always holds — only the converse fails.
A covariance of means a stronger relationship than a covariance of .
False. Covariance carries the units of ; rescale from metres to millimetres and the number jumps by with no change in the actual relationship. Only compares strength fairly.
means and are unrelated.
False. is the strongest possible relationship — a perfect descending line. It is , not , that signals no linear relationship.
Correlation can exceed if the variables are very strongly linked.
False. The Cauchy–Schwarz bound forces for any pair; there is no "super-correlation." A reported always means a computational error.
equals the standard deviation of .
False. — the variance, not the standard deviation. Variance is a covariance of a variable with itself.
Correlation is symmetric: .
True. The definition multiplies , and multiplication commutes, so swapping the roles changes nothing. Direction of "cause" is invisible to .
If is high, changing will change .
False. Correlation is a statement about co-movement in observed data, not about intervention. A lurking common cause (or pure coincidence) can produce high with zero causal link — see 3.2.06-Multicolinearity for where this bites in models.
Adding a constant to every value of changes .
False. Covariance uses deviations from the mean; shifting shifts its mean by the same amount, so is unchanged. Location shifts leave covariance (and ) untouched.
Multiplying by leaves the correlation unchanged (for positive scaling).
True. Both and scale by , and they cancel in the ratio. Correlation is scale-invariant, which is exactly why we normalise.
If , then of points lie on the fitted line.
False. is not a percentage of points. In regression it is (here ) that is the fraction of variance explained — and even that is about variance, not point counts.

Spot the error

"Cov."
The subtracted term should be the product , not the expectation of the sum. The correct form is .
"Since and , correlation is always non-negative."
The denominator is non-negative, but the numerator (covariance) can be negative, so can be negative. The sign of is inherited entirely from the sign of the covariance.
"Independence follows because we computed ."
A zero covariance only certifies no linear association; it never certifies independence. To claim independence you must show everywhere (see 1.2.04-Independence).
"For a perfect line , correlation is because the slope is ."
Correlation ignores slope magnitude; any exact increasing line gives regardless of steepness. The slope lives in the regression coefficient, not in .
"Sample covariance divides by ."
The unbiased sample covariance divides by (Bessel's correction) because one degree of freedom was spent estimating the two means. Dividing by gives a biased-low estimate.
" has zero covariance, so must also be zero for all such setups."
The zero came from being symmetric about 0 (so and ). Shift off-centre and is generally non-zero — the trick depends on symmetry, not on the squaring alone.
"A correlation matrix can have on the diagonal if a feature is very variable."
Every diagonal entry is exactly, because a variable is perfectly correlated with itself. Variability changes off-diagonal entries, never the diagonal.

Why questions

Why do we divide covariance by rather than by, say, ?
Because the product of standard deviations has the same units as covariance (), so the ratio is dimensionless; a sum would not cancel units and Cauchy–Schwarz would not bound the result to .
Why does independence force ?
Under independence the joint splits, , so the double sum factors into — the product of the two marginal means.
Why can two datasets share the same yet look completely different?
compresses the whole cloud into one linear-trend number; it is blind to curvature, clusters, and outliers. This is exactly why you plot the data (Anscombe's quartet) instead of trusting alone.
Why does PCA care about the covariance matrix rather than correlations by default?
PCA finds directions of maximum variance, which the covariance matrix encodes in its own units; when features have wildly different scales you standardise first — which is equivalent to using correlations. See 2.4.01-Principal-component-analysis.
Why is high correlation between two features a warning sign in linear regression?
Strongly correlated predictors carry near-duplicate information, making the fitted coefficients unstable and hard to interpret — this is multicollinearity, covered in 3.2.06-Multicolinearity and relevant to 4.1.03-Feature-selection.
Why does correlation say nothing about the steepness of a relationship?
Because both numerator and denominator scale with 's spread, any rescaling of cancels out; measures how tightly points hug a line, not how fast climbs along it.

Edge cases

What is when is a constant (zero variance)?
Undefined. puts a zero in the denominator; a constant has no variation to co-vary with, so correlation is meaningless there.
What is when the two variables never overlap in variation — e.g. is constant?
Zero. for every sample, so every product term vanishes. A constant is uncorrelated with everything, and this is a genuine zero (not the "hidden nonlinear" kind).
What happens to as data points approach a perfect line from a slightly noisy cloud?
continuously; the sign matches the line's direction. The limiting value is reached exactly when every point satisfies (the Cauchy–Schwarz equality case).
Can covariance be negative while both variables only take positive values?
Yes. Signs come from deviations , not from raw values; if large- pairs with small-, those deviation products are negative and can dominate.
If you compute from just points, what do you get?
Any two distinct points lie exactly on a line, so mechanically — a meaningless "perfect" correlation. Small samples inflate correlation; you need enough points for to mean anything.
What is if exactly?
. They move in perfect opposition: and , giving .
Recall Quick self-check

Zero correlation rules out only linear relationships, never dependence in general. The bound comes from the Cauchy–Schwarz inequality applied to standardized variables. Correlation is invariant to shifts and positive scaling of either variable.