Back to the on-screen lesson ·
The expected squared distance from the mean, the shortcut that computes it, and how it behaves under shifting and scaling.
Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.
You will compute a variance either from the squared distances or by the shortcut that subtracts the square of the expectation from the expectation of the square, take its square root for a standard deviation, and say which of the two belongs in a report. You will also work out what shifting and scaling a variable do to both.
Two variables can share an expectation and be nothing alike: a payout of exactly $5$ every time and a payout of $0$ or $10$ on a coin toss both have expectation $5$. The expectation says where a distribution sits and nothing at all about how far it wanders, and that is what this lesson measures.
The variance is $E[(X - \mu)^{2}]$, the average squared distance from the mean. The standard deviation $\sigma$ is its square root, in the variable's own units. The second moment is $E[X^{2}]$, and the shortcut subtracts the square of the first moment from it. Spread is the informal word for what both of them measure.
$$\operatorname{Var}(X) = E\!\left[(X - \mu)^{2}\right], \qquad \sigma = \sqrt{\operatorname{Var}(X)}.$$
The squaring is not decoration. The plain distances $X - \mu$ have expectation zero for every distribution — that is what the mean is — so an average of them could never measure spread. Squaring makes every contribution positive and gives the far-out values more weight than the near ones.
Expanding the square gives the form everyone actually computes with:
$$\operatorname{Var}(X) = E[X^{2}] - (E[X])^{2}.$$
It follows immediately that $E[X^{2}] \ge (E[X])^{2}$, since a variance is never negative — an inequality worth noticing, because it is the first case of Jensen's inequality and it makes a good check on arithmetic.
Under a change of scale, $$\operatorname{Var}(aX + b) = a^{2} \operatorname{Var}(X).$$ The $b$ vanishes because shifting every value shifts the mean with it and leaves every distance alone. The $a$ is squared because the distances are. The standard deviation, being the square root, scales by $|a|$ and is in the variable's own units — which is why it is the summary worth reporting and the variance is the one worth computing with.
Another way: story
Two bus routes both average twenty minutes. One arrives between nineteen and twenty-one; the other is sometimes five minutes and sometimes thirty-five. Same expectation, and nobody would call them equally good. The variance is what distinguishes them, and it is what a timetable cannot show.
Another way: steps
Three variables, all with expectation $5$.
| Variable | Values and probabilities | $E[X^{2}]$ | Variance | Standard deviation |
|---|---|---|---|---|
| $A$ | $5$ always | $25$ | $0$ | $0$ |
| $B$ | $4$ or $6$, evenly | $26$ | $1$ | $1$ |
| $C$ | $0$ or $10$, evenly | $50$ | $25$ | $5$ |
The expectation column would be identical and is not shown, because it carries no information here. A variance of zero means the variable is constant — the only way for every squared distance to vanish — which is a useful thing to recognise in an answer.
Subtracting the two squares the wrong way round. $(E[X])^{2} - E[X^{2}]$ is never positive. A negative variance is always this mistake.
Squaring the expectation of the values rather than expecting the squares. $E[X^{2}]$ weights the squares by the probabilities; it is not $E[X]$ squared, and the difference between them is the whole variance.
Reporting a variance in the variable's units. It is in squared units. The standard deviation is the one that can be compared with the values.
Expecting a shift to change it. $\operatorname{Var}(X + 100) = \operatorname{Var}(X)$. Moving a distribution does not spread it.
$E[X] = 3.5$ and $E[X^{2}] = (1 + 4 + 9 + 16 + 25 + 36)/6 = 91/6$.
Weight the squares, not the values.
$\operatorname{Var}(X) = 91/6 - 12.25 = 35/12 \approx 2.917$.
The shortcut.
So $\sigma \approx 1.708$, which is a plausible typical distance from $3.5$ for a die.
Back in the variable's units, and it passes a sanity check.
A variable has variance $4$, so $\sigma = 2$.
Start from the variance.
$\operatorname{Var}(X + 50) = 4$: the shift does nothing.
Every distance from the mean is unchanged.
$\operatorname{Var}(3X) = 9 \times 4 = 36$, so $\sigma = 6$.
Squared for the variance, plain for the deviation.
$E[X] = 2$ and $E[X^{2}] = (0 + 16)/2 = 8$.
Weight the squares.
$\operatorname{Var}(X) = 8 - 4 = 4$.
The shortcut.
So $\sigma = 2$, which is exactly the distance from $2$ to either value.
A variable takes $1$, $2$, $3$, $4$ with probabilities $0$, $0$, $1/2$, $1/2$, and its mean is $3.5$. Give each value's contribution to the variance, and the total.
| Value | |
|---|---|
| Contribution of the value $1$ | |
| Contribution of the value $2$ | |
| Contribution of the value $3$ | |
| Contribution of the value $4$ | |
| Variance |
A variable has $E[X] = 2.5$ and $E[X^{2}] = 8.5$. What is its variance?
Answer:
A variable has $E[X] = 1.5$ and $E[X^{2}] = 2.5$. Give its variance and its standard deviation.
Variance: p. Standard deviation: q.
The weights of a batch of parts are measured in grams, and the variance of the weight comes out as $9$. What can be said about it?
A variable $X$ has variance $2.25$. Give the variance of each of these.
| Value | |
|---|---|
| $\operatorname{Var}(X)$ | |
| $\operatorname{Var}(X + 1)$ | |
| $\operatorname{Var}(5X)$ | |
| $\operatorname{Var}(-X)$ |
Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.
Four variables, each equally likely to be plus or minus the number shown. Put them in order of variance, smallest first.
Number the steps in order (write the number in the box):
You can compute a variance both ways, take a standard deviation, and adjust both for a shift and a scale. Say in your own words why the distances from the mean have to be squared before they are averaged.
9. Your turn: $X$ takes $0$ or $4$ with equal probability; find its variance and standard deviation, step 3