A distribution has a center and a spread, and two distributions can move together or apart. Three numbers capture all of that — but only if you actually accumulate them term by term instead of eyeballing the table.
| outcome | x | y | p |
|---|---|---|---|
| 1 | 1 | 2 | 0.1 |
| 2 | 2 | 1 | 0.3 |
| 3 | 3 | 4 | 0.2 |
| 4 | 4 | 3 | 0.3 |
| 5 | 5 | 5 | 0.1 |
Each row of the table is one outcome; each bar is that outcome's own contribution (or ) to the mean. Toggle between and — the bars change, but they always add up to exactly the number printed underneath.
The expectation (mean) of a discrete random variable weights every outcome by how likely it is:
- — the expected value of : its probability-weighted average.
- — the probability of outcome .
- — the value takes on outcome .
Variance measures spread around that mean, and covariance measures whether two variables move together:
- — the expected squared deviation of from its own mean.
- — the expected product of 's and 's deviations from their own means.
- Variance is a special case of covariance
— pairing a variable with itself just squares the deviation.
- The sign of covariance is the whole story
A positive means and tend to sit on the same side of their means together; negative means they tend to sit on opposite sides. The magnitude alone is hard to read without normalizing by spread (which is what correlation does).
- Every outcome pulls in one direction or another
An outcome where both and are above their means, or both below, contributes positively to the covariance sum; an outcome where one is above and the other below contributes negatively.
Switch between , , and : the bars are the exact terms being summed, and outcome 3 — where sits right at — contributes nothing to either variance or covariance, because its deviation is zero.
- Find E[X] and E[Y]
- Find Var(X)
- Find Cov(X, Y)
The five outcomes are : , , , , , with the same probabilities as above. Subtract each mean and multiply the deviations:
Weighting each by its outcome's probability and summing:
Positive — when swings away from its mean, tends to swing the same direction.
Using the same outcome table, compute Var(Y) by hand.
| outcome | x | y | p |
|---|---|---|---|
| 1 | 1 | 2 | 0.1 |
| 2 | 2 | 1 | 0.3 |
| 3 | 3 | 4 | 0.2 |
| 4 | 4 | 3 | 0.3 |
| 5 | 5 | 5 | 0.1 |
These three sums are the entire vocabulary for "where a distribution sits," "how spread out it is," and "whether two variables move together" — every model that reports a mean, a variance, or a correlation is just this arithmetic in disguise.