Back to the on-screen lesson ·
The weighted average of a variable's values, how scaling and shifting move it, and what it does and does not promise.
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 the expectation of a discrete variable by weighting each value with its probability and adding, adjust it when the variable is scaled or shifted, and use it to compare offers. You will also say what the number does not mean: not the most likely value, not a value the variable can take, and not a prediction about the next trial.
A mass function already says how much probability sits on each value. An expectation is that table used as a set of weights — so nothing new is being assumed about probability here, only a familiar kind of average taken with weights that are usually unequal.
The expectation of $X$, written $E[X]$ or $\mu$, is the weighted average of its values with the probabilities as weights. It is also called the mean of the distribution. The mode is the most likely value and the median the middle one; all three are ways of saying where a distribution sits, and they are usually different numbers.
For a discrete variable, $$E[X] = \sum_{x} x \, p(x),$$ and for a continuous one $E[X] = \int_{-\infty}^{\infty} x f(x)\,dx$ when that integral converges absolutely. Both are the same idea: each value, weighted by how much probability sits on it.
Two consequences follow directly from the definition and cost nothing to prove. $E[aX] = a\,E[X]$, because multiplying every value by $a$ multiplies every contribution by $a$; and $E[X + c] = E[X] + c$, because adding $c$ to every value adds $c$ to the weighted average. So an expectation can be re-scaled and shifted without going back to the distribution.
It is worth being clear about what the number is not. It need not be a value the variable can take — a household of $2.4$ people does not exist. It is not the most likely value. It is not the middle value. What it is, is the number the long-run average of repeated independent copies settles down to, and that claim is a theorem proved at the end of this course rather than part of the definition.
Not every variable has one. If the sum or integral does not converge absolutely the expectation does not exist, and a distribution with heavy enough tails — the Cauchy is the standard example — genuinely has no mean to compute.
Another way: picture
The mass function drawn as weights placed along a plank at the values. The expectation is the point where the plank balances. Moving weight outwards moves the balance point towards it, and a heavy weight close in can balance a light one far out.
Another way: steps
A variable taking $1$, $2$, $3$, $10$ with probabilities $0.4$, $0.3$, $0.2$, $0.1$.
| Summary | Value | What it answers |
|---|---|---|
| Mode | 1 | Which value happens most often |
| Median | 2 | Which value has half the probability below it |
| Expectation | 2.6 | What the long-run average would be |
Three different numbers from one distribution, and none of them wrong. The expectation is the only one the single far-out value of $10$ moves at all, which is both its strength — it uses every value — and its weakness, since one rare enormous value can drag it somewhere unrepresentative.
Expecting the expectation to be attainable. A fair die has expectation $3.5$, and no face shows $3.5$.
Confusing it with the most likely value. That is the mode, and the two agree only by accident.
Averaging the values without weighting them. The plain average of the values is the expectation only when every value is equally likely.
Believing it predicts the next trial. It says nothing about one performance. Its promise is about the average of many, and it is worth being precise about that rather than vague.
Each face has probability $1/6$, so every contribution is $x/6$.
Equal weights, so the plain average will do.
$E[X] = (1 + 2 + 3 + 4 + 5 + 6)/6 = 21/6 = 3.5$.
No face shows $3.5$, and the number is still the right answer.
An average of the values, not one of them.
A ticket pays $1000$ with probability $0.0005$ and nothing otherwise.
Two values, one of them zero.
$E[X] = 1000 \times 0.0005 + 0 \times 0.9995 = 0.5$.
The zero contributes nothing.
So a ticket is worth $0.50$ on average, however large the prize is made.
Prize and probability trade off exactly.
$E[X] = 0(0.5) + 1(0.3) + 5(0.2) = 1.3$.
Weighted sum of the values.
Scaling by $3$ scales the expectation; adding $2$ adds $2$.
No need for the mass function again.
So $E[3X + 2] = 3(1.3) + 2 = 5.9$.
A variable takes the values $1$, $2$, $3$ and $4$ with probabilities $2/5$, $3/10$, $1/5$ and $1/10$. Give each value's contribution to the expectation, and the total.
| Value | |
|---|---|
| Contribution of the value $1$ | |
| Contribution of the value $2$ | |
| Contribution of the value $3$ | |
| Contribution of the value $4$ | |
| Expectation |
The same variable takes $1$, $2$, $3$, $4$ with probabilities $2/5$, $3/10$, $1/5$, $1/10$. The marks are one twentieth apart. Put the marker at its expectation.
0 |——————————| 5
Mark the position with a cross, then write the value:
A variable $X$ has expectation $1.5$. Give the expectation of $2X$ and of $2X + 4$.
$E(2X)$ is p and $E(2X + 4)$ is q.
A game pays $3$ pounds with probability $3/10$ and nothing otherwise. What is the expected payout, in pounds?
Answer:
Four games, each costing nothing to enter. Match each to its expected payout in pounds.
| $2$ | $4$ | $6$ | $8$ | |
|---|---|---|---|---|
| Pays $20$ one time in five | ||||
| Pays $8$ three times in four | ||||
| Pays $40$ one time in twenty | ||||
| Pays $16$ half the time |
Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.
A household is equally likely to contain $1$ or $16$ people, and nothing in between. Its expected size is $17/2$. What does that number mean?
You can compute an expectation from a mass function, adjust it for scaling and shifting, and use it to rank alternatives. Say in your own words why an expectation can be a value the variable never takes.
9. Your turn: $X$ takes $0$, $1$, $5$ with probabilities $0.5$, $0.3$, $0.2$; find $E[X]$ and $E[3X + 2]$, step 3