Variance

Var(X) = E[X^2] - E[X]^2.

The idea

The variance of a random variable measures how far its values spread around its mean. The mean alone says nothing about spread: two random variables can both have mean $0$ while one never leaves $[-1, 1]$ and the other swings between $-1000$ and $1000$.

To measure spread, consider the deviation $X - \mu$ from the mean $\mu = \mathbb{E}[X]$. Its average is $0$ for every random variable, because the mean is exactly the point where the positive and negative deviations cancel. Squaring the deviation first removes the cancellation, and it also weights large departures more heavily: a departure twice as large counts four times as much.

Definition (Variance).

The variance of a random variable $X$ with mean $\mu = \mathbb{E}[X]$ is its mean squared deviation, $\mathrm{Var}(X) = \mathbb{E}\big[(X - \mu)^{2}\big].$

It is never negative, and it equals $0$ exactly when $X$ is constant. Because it is built from squares, its units are the square of $X s units; its square root, the standard deviation, restores the original units and is what we usually report beside a mean.

Expanding the square gives an equivalent form that is usually easier to compute.

Proposition.

For every random variable $X$ with finite mean and variance, $\mathrm{Var}(X) = \mathbb{E}[X^{2}] - \mathbb{E}[X]^{2},$ the mean of the squares minus the square of the mean.

Ways to work on it

Not sure where to start? Take the ten-question placement test.