Variance and standard deviation
The variance and standard deviation of a discrete random variable, the two formulas for variance, and the variance of a linear function aX + b.
Two games can have the same expected gain but feel completely different: one pays $\$1$ often, the other pays $\$1000$ rarely. The mean can't tell them apart. We need a number that measures how spread out the values are around the mean, and that is the variance.
Measuring spread
Each value $x$ is a distance $x - \mu$ from the mean. Squaring makes every distance positive (otherwise they would cancel), and big distances count for more. The variance is the expected value of those squared distances.
The standard deviation $\sigma$ is in the same units as $X$, which makes it easier to interpret than the variance.
Find the variance and standard deviation for this distribution, which has $\mu = 1.7$ (from 9B).
| $x$ | $0$ | $1$ | $2$ | $3$ |
|---|---|---|---|---|
| $P(X = x)$ | $0.1$ | $0.3$ | $0.4$ | $0.2$ |
| $(x - \mu)^2$ | $2.89$ | $0.49$ | $0.09$ | $1.69$ |
The quicker formula
In words: the mean of the squares minus the square of the mean. It avoids subtracting $\mu$ from every value, which saves a lot of arithmetic when $\mu$ is a messy decimal.
Why the two formulas agree
Expand the square: $\sum (x - \mu)^2 P(X = x) = \sum x^2 P(X = x) - 2\mu\sum xP(X = x) + \mu^2\sum P(X = x)$.
The three sums are $E(X^2)$, $\mu$ and $1$. So the variance is $E(X^2) - 2\mu^2 + \mu^2 = E(X^2) - \mu^2$.
$X$ is the number of heads when three coins are tossed. Find $\text{Var}(X)$ and $\sigma$.
Find the variance and standard deviation of the score on a fair die.
Linear changes
Adding $b$ to every value slides the whole distribution along without changing its spread. Multiplying by $a$ stretches every distance from the mean by $a$, so every squared distance by $a^2$.
For the distribution in Example 1, $\text{Var}(X) = 0.81$. Find the variance and standard deviation of $Y = 3X - 2$.
Your turn
$X$ takes values $1, 2, 3$ with probabilities $0.2$, $0.5$, $0.3$. Find the standard deviation of $X$.
Show the working
$\mu = 0.2 + 1 + 0.9 = 2.1$. $E(X^2) = 0.2 + 2 + 2.7 = 4.9$. $\text{Var}(X) = 4.9 - 4.41 = 0.49$, so $\sigma = 0.7$.
$X$ is $0$ or $2$, each with probability $0.5$. Find $\text{Var}(X)$.
$\mu = 1$. $E(X^2) = 0 \times 0.5 + 4 \times 0.5 = 2$. $\text{Var}(X) = 2 - 1 = 1$.
Which formula gives the variance?
The mean of the squares minus the square of the mean. The other order would give a negative number.
Three coins are tossed and $X$ is the number of heads. Find $E(X^2)$.
$0 \times \tfrac18 + 1 \times \tfrac38 + 4 \times \tfrac38 + 9 \times \tfrac18 = \tfrac{24}{8} = 3$.
For the same $X$, find $\text{Var}(X)$.
$\text{Var}(X) = 3 - 1.5^2 = 0.75$.
$X$ takes the values $2, 4, 6, 8$, each with probability $0.25$. Find $\text{Var}(X)$.
By symmetry $\mu = 5$. The squared distances from the mean are $9, 1, 1, 9$, each with probability $0.25$, so $\text{Var}(X) = 0.25(9 + 1 + 1 + 9) = 5$.
$\text{Var}(X) = 4$. Find $\text{Var}(3X + 1)$.
$3^2 \times 4 = 36$. Adding $1$ doesn't change the spread.
The standard deviation of $X$ is $3$. The standard deviation of $5 - 2X$ is:
$\text{SD}(aX + b) = |a|\sigma = |-2| \times 3 = 6$. A standard deviation is never negative.
Find the variance of the score on a fair die, correct to two decimal places.
$E(X^2) = \tfrac{91}{6}$ and $\mu = 3.5$, so $\text{Var}(X) = \tfrac{91}{6} - 12.25 = \tfrac{35}{12} \approx 2.92$.
Exam style: $P(X = x) = \dfrac{x}{6}$ for $x = 1, 2, 3$. Find $\text{Var}(X)$ correct to two decimal places.
$\mu = \tfrac16 + \tfrac46 + \tfrac96 = \tfrac{14}{6} = \tfrac73$. $E(X^2) = \tfrac16 + \tfrac86 + \tfrac{27}{6} = 6$. $\text{Var}(X) = 6 - \tfrac{49}{9} = \tfrac59 \approx 0.56$.
Exam style: a random variable has $E(X) = 4$ and $\text{Var}(X) = 2$. Find $E(X^2)$.
Rearrange $\text{Var}(X) = E(X^2) - \mu^2$: $E(X^2) = 2 + 4^2 = 18$.
Coaching Centre