Advanced Mathematics

Joint Distributions and Covariance

How two or more random quantities behave together, and covariance, which measures whether they tend to rise and fall together.

Needs a step first: 20

A joint distribution gives the probability of every pair of values; summing or integrating out one variable leaves the marginal distribution of the other. Covariance Cov⁡(X,Y)=E[XY]−E[X]E[Y]\operatorname{Cov}(X,Y)=E[XY]-E[X]E[Y] is positive when they tend to move together, and dividing by both standard deviations gives the correlation. Independence implies zero covariance, but not the other way round. For many variables the covariances form a symmetric matrix, the starting point for the multivariate normal and PCA.

Where it shows up: PCA finds the eigenvectors of a covariance matrix, and Bell's theorem is a statement about the joint distribution of measurement results.

How to hold it: In your head

See covariance as whether two quantities rise and fall together, and know that independence gives zero covariance but zero covariance does not give independence.

What knowing it looks like

  • Find marginal and conditional distributions from a joint table or density.
  • Compute a covariance and a covariance matrix, and use Var⁡(X+Y)=Var⁡X+Var⁡Y+2Cov⁡(X,Y)\operatorname{Var}(X+Y)=\operatorname{Var}X+\operatorname{Var}Y+2\operatorname{Cov}(X,Y).
  • Give an example of two variables that are uncorrelated but dependent.

Test yourself

XX takes the values −1,0,1-1,0,1 with probability 13\tfrac13 each, and Y=X2Y=X^2. Find Cov⁡(X,Y)\operatorname{Cov}(X,Y) and the covariance matrix of (X,Y)(X,Y). Are XX and YY independent?
Show the worked answer
E[X]=0E[X]=0 and E[XY]=E[X3]=0E[XY]=E[X^3]=0, so Cov⁡(X,Y)=0\operatorname{Cov}(X,Y)=0. Var⁡X=E[X2]=23\operatorname{Var}X=E[X^2]=\tfrac23 and Var⁡Y=E[X4]−E[X2]2=23−49=29\operatorname{Var}Y=E[X^4]-E[X^2]^2=\tfrac23-\tfrac49=\tfrac29, so the covariance matrix is (230029)\begin{pmatrix}\tfrac23&0\\0&\tfrac29\end{pmatrix}. But they are not independent: YY is fixed by XX, and P(X=0,Y=0)=13P(X=0,Y=0)=\tfrac13 while P(X=0)P(Y=0)=19P(X=0)P(Y=0)=\tfrac19. Covariance only sees straight-line relationships.

Needs a step first: 20

Learn it with an AI

Copy this prompt into any AI assistant. It will take you through step by step at your level and finish with the test above.

Be my maths tutor. I'm learning "Joint Distributions and Covariance" (Undergraduate I tier): How two or more random quantities behave together, and covariance, which measures whether they tend to rise and fall together.
I already know: Probability Densities, Matrices as Transformations.
Teach it Socratically: first ask what I already know; then explain the core idea with one concrete example and why it's true; then give me three problems, one at a time, easy to hard. Wait for my answer, check every step, and point out mistakes without giving the answer away.
Finish by testing me with this: $X$ takes the values $-1,0,1$ with probability $\tfrac13$ each, and $Y=X^2$. Find $\operatorname{Cov}(X,Y)$ and the covariance matrix of $(X,Y)$. Are $X$ and $Y$ independent?
Use LaTeX for formulas. When you say where it's used later (machine learning, quantum mechanics), be specific.

On the way to

Recommended