Math Detours · Grade 11 · Sharpen · 14

The average outcome and how far it strays

Expected value and variance of a random number, computed from a table. Why a fair bet can still be a bad idea.

Name ____________________Date ____________

Tonight's idea

A random variable \(X\) is a number decided by chance: the score on a die, the profit from a bet. A table lists each value \(x\) with its probability \(P(x)\).

−4 −2 0 2 4 6 8 10 0.7 0.2 0.1 μ = −0.4, give or take σ = 3.04 bar height = probability
The scratch card below. The mean (triangle) is where the bars would balance. The bracket reaches one \(\sigma\) each side.

The expected value \(\mu\) is the average you would see over a great many repeats. Weight each value by how often it turns up. The variance is the expected squared distance from \(\mu\).

\(\mu = E(X) = \sum x\,P(x)\) and \(\operatorname{Var}(X) = \sum (x - \mu)^2 P(x)\). The sign \(\sum\) means: add over every row of the table.

Squaring stops misses above and below \(\mu\) from cancelling. The square root of the variance is the standard deviation \(\sigma\). It is in the units of \(X\): a typical distance from the average. You met it for data in grade 10.

Why keep both numbers? Bet A is a coin flip for $1. Bet B is a coin flip for $1,000. Both have \(\mu = 0\), so both are "fair". But \(\sigma\) is 1 for A and 1,000 for B. Expected value describes the long run, and you only reach the long run if you survive the short one. If that $1,000 is your rent, bet B is a bad idea.

Watch one: a $2 scratch card

Seven cards in ten pay nothing, two pay $3 and one pays $10. Let \(X\) be your profit after the $2 cost. First find \(\mu\) from the third column, then fill in the fourth.

\(x\)\(P(x)\)\(x\,P(x)\)\((x - \mu)^2 P(x)\)
\(-2\)0.7\(-1.4\)\(1.6^2 \times 0.7 = 1.792\)
10.20.2\(1.4^2 \times 0.2 = 0.392\)
80.10.8\(8.4^2 \times 0.1 = 7.056\)
Sum1\(\mu = -0.4\)\(\operatorname{Var} = 9.24\)

So \(\sigma = \sqrt{9.24} \approx 3.04\). On average a card loses you 40 cents. Any one card typically lands about $3 away from that.

On the Galton board, the bin a ball lands in is a random variable with \(\mu = 6\) and \(\sigma = \sqrt3 \approx 1.73\). Drop a thousand balls and see both: mathdetours.com/demos/galton.html.

Your turn

  1. \(X\) is the score on a fair die. Find \(E(X)\), \(\operatorname{Var}(X)\) and \(\sigma\).
  2. Job A pays 50 (thousand dollars a year) for certain. Job B pays 30 with probability 0.5, 60 with probability 0.3 and 100 with probability 0.2. Find \(\mu\) and \(\sigma\) for each job. Which has the higher expected pay, and what does \(\sigma\) add?
  3. Double the die score and add 3: \(Y = 2X + 3\). Predict \(E(Y)\) and the standard deviation of \(Y\) from your answers to question 1, then check \(E(Y)\) from a table. What does the "+ 3" do to the spread?
  4. A game costs $1 and pays a prize with probability \(\tfrac1{10}\). How big must the prize be for the game to be fair? Find \(\sigma\) of your profit. Repeat for a fair $1 game that pays with probability \(\tfrac1{1000}\). What changed and what did not?

Stretch: a shortcut for the variance

Expand \((x - \mu)^2\) inside the sum and use \(\sum P(x) = 1\) to show that \(\operatorname{Var}(X) = E(X^2) - \mu^2\), where \(E(X^2) = \sum x^2 P(x)\). Check it on the fair die.

Answers

  1. \(E(X) = \tfrac16(1 + 2 + 3 + 4 + 5 + 6) = 3.5\). The squared distances are 6.25, 2.25, 0.25, 0.25, 2.25, 6.25, which sum to 17.5, so \(\operatorname{Var}(X) = \tfrac{17.5}{6} = \tfrac{35}{12} \approx 2.92\) and \(\sigma \approx 1.71\).
  2. Job A: \(\mu = 50\), \(\sigma = 0\). Job B: \(\mu = 15 + 18 + 20 = 53\). \(\operatorname{Var} = 23^2(0.5) + 7^2(0.3) + 47^2(0.2) = 264.5 + 14.7 + 441.8 = 721\), so \(\sigma \approx 26.9\). B pays 3 more on average, but a typical year is about 27 away from that, and half the time it pays 30. Whether 3 extra is worth that risk depends on what a bad year would cost you. The expected value alone cannot say.
  3. \(E(Y) = 2(3.5) + 3 = 10\) and the standard deviation is \(2 \times 1.71 = 3.42\). Check: \(Y\) takes the values 5, 7, 9, 11, 13, 15, with mean \(\tfrac{60}{6} = 10\). Adding 3 slides every value and the mean together, so the distances from the mean, and the spread, do not change. Doubling doubles every distance.
  4. Fair means \(E = 0\): \(\tfrac1{10}(\text{prize}) = 1\), so the prize is $10. Profit is 9 with probability 0.1 and \(-1\) with probability 0.9: \(\operatorname{Var} = 81(0.1) + 1(0.9) = 9\), \(\sigma = 3\). With probability \(\tfrac1{1000}\) the prize is $1,000: \(\operatorname{Var} = 999^2(0.001) + 1(0.999) = 999\), \(\sigma \approx 31.6\). The expected value is 0 both times. The spread is about ten times bigger: the second game is a lottery, where almost everyone loses and one player wins a lot.

Stretch. \(\sum (x - \mu)^2 P(x) = \sum x^2 P(x) - 2\mu \sum x\,P(x) + \mu^2 \sum P(x) = E(X^2) - 2\mu \cdot \mu + \mu^2 = E(X^2) - \mu^2\). For the die, \(E(X^2) = \tfrac16(1 + 4 + 9 + 16 + 25 + 36) = \tfrac{91}{6}\), and \(\tfrac{91}{6} - 3.5^2 = \tfrac{35}{12}\), as before.

← PreviousNext: The line of best fit, computed →