Variance of a Discrete Random Variable
The expected value tells you the long-run average of a random variable, but not how much the results vary. Two games can both have an expected payout of $2, one paying exactly $2 every time and the other paying $0 or $20. The variance and standard deviation measure that spread. You’ll also see how they change when every value is scaled or shifted, for example when a prize is doubled or an entry fee is subtracted.
Key ideas
Section titled “Key ideas”Variance and standard deviation
Section titled “Variance and standard deviation”For a discrete random variable with mean , the variance is the expected squared distance from the mean:
The standard deviation is its square root, . It’s in the same units as , which makes it easier to interpret.
The calculation formula
Section titled “The calculation formula”Expanding the square gives a formula that’s usually quicker:
In words: “the mean of the squares minus the square of the mean.” To use it, add two rows to the probability table, and , and add each row.
Since a variance can’t be negative, is always at least . If you get a negative variance, you’ve made an error.
Using your GDC
Section titled “Using your GDC”Put the values of in one list and the probabilities in another, then run one-variable statistics with the probabilities as the frequency list. The mean is , and the population standard deviation is the standard deviation of (don’t use ). Square for the variance.
Linear transformations
Section titled “Linear transformations”If every value of is multiplied by and then is added, the new random variable is . Then
so the standard deviation of is .
Why? Adding slides every value along by the same amount: the centre moves, but the spread doesn’t change. Multiplying by stretches every distance from the mean by a factor of , so squared distances are multiplied by .
| Change to | Effect on | Effect on Var | Effect on SD |
|---|---|---|---|
| add | add | none | none |
| multiply by | multiply by | multiply by | multiply by |
More general expectations
Section titled “More general expectations”For any function , . That’s how is defined. Be careful: in general , and their difference is exactly the variance.
Worked examples
Section titled “Worked examples”Example 1: Rolling a die
Section titled “Example 1: Rolling a die”Let be the score on a fair six-sided die. Find , and the standard deviation.
Solution. Each value has probability .
The variance is and the standard deviation is (3 s.f.).
Example 2: A table with unknowns
Section titled “Example 2: A table with unknowns”The random variable has this distribution, and .
Find and , then find and the standard deviation of .
Solution. The probabilities add to : , so .
The mean is : , so .
Subtracting the equations: , and then .
The standard deviation is .
Example 3: A game with a fee
Section titled “Example 3: A game with a fee”In a fairground game, is the number of targets a player hits, with the distribution from Example 2. The player pays $8 to play and wins $5 per target. Let be the player’s profit in dollars.
- (a) Write in terms of .
- (b) Find and the standard deviation of .
- (c) Is the game fair?
Solution.
(a) .
(b) Using and :
The standard deviation of is . (Or directly: .)
The expected profit is 50 cents per game, with a standard deviation of $4.50.
(c) A game is fair when . Here , so the game is not fair: it favours the player.
Example 4: Exact values from a formula
Section titled “Example 4: Exact values from a formula”The probability distribution of is for . Find the exact values of , and .
Solution. The probabilities add to :
Notice that , so each term of is just :
(The standard deviation is .)
Common mistakes
Section titled “Common mistakes”Squaring the mean instead of finding the mean of the squares. is , not . In Example 2, but .
Forgetting to subtract. on its own is not the variance. Finish with .
Writing Var(aX + b) = aVar(X) + b. Adding a constant doesn’t change the spread, and multiplying by multiplies the variance by . For , , not .
A negative variance or standard deviation. , which is positive, and the standard deviation is , not . Square for the variance; use for the standard deviation.
Mixing up variance and standard deviation. Read which one the question asks for. If you’re given , then .
Using the sample standard deviation on a GDC. For a probability distribution, use , not .
Practice
Section titled “Practice”1. (Warm-up) Find , and the standard deviation of .
Solution
The standard deviation is .
2. (Warm-up) and . Find:
- (a) and ;
- (b) and .
Solution
(a) . .
(b) , so , . . .
3. (Core) for . Find , and .
Solution
, so . The probabilities are .
4. (Core) A fair coin is tossed three times, and is the number of heads. Write down the probability distribution of , and find and .
5. (Core) A game costs $8 to play. You roll a fair die and win twice the score in dollars. Let be your profit in dollars.
- (a) Write in terms of the score , and find and the standard deviation of .
- (b) What should the game cost for it to be fair?
Solution
(a) . From Example 1, and .
On average you lose $1 per game.
(b) With a cost of dollars, . This is when , so the game is fair if it costs $7.
6. (Core) The random variable has and this distribution.
Find and , and the standard deviation of .
Solution
Mean: , so and . Total: , so .
7. (Core) The daily maximum temperature () in a city in July has mean and standard deviation . The temperature in degrees Fahrenheit is . Find the mean, standard deviation and variance of .
Solution
(Adding changes the mean but not the spread.)
8. (Challenge) and .
- (a) Find and .
- (b) Find constants and so that has and .
Solution
(a) , so .
(b) , so (taking ). , so .
So : subtract the mean and divide by the standard deviation. That’s standardizing, just like a z-score.
9. (Challenge) takes only the values and , where , with . Given that and , find and .
Solution
and , so
Write , so , which means . Since , , and then .
Check: and . ✓
Homework
Section titled “Homework”Try these independently after the practice questions. Show your setup and explain your reasoning. Use exact answers where possible, and check that your answers fit the question. Homework solutions are not provided on the published site.
Give decimal answers to 3 significant figures unless the question says otherwise.
Foundations
Section titled “Foundations”H1. (Foundations) Find , , and the standard deviation of .
H2. (Foundations) A random variable has and . Without a calculator, find:
- (a) , and the standard deviation of ;
- (b) , and the standard deviation of ;
- (c) .
H3. (Core) The random variable has this distribution, and .
- (a) Find and .
- (b) Find and the standard deviation of .
H4. (Core) (IB style) Without a calculator. The probability distribution of is for .
- (a) Find the exact value of .
- (b) Find and show that .
- (c) Find the exact values of and the standard deviation of .
H5. (Core) A bakery in Corner Brook takes orders for custom cakes. The number of custom cakes ordered on a weekday has this distribution (hypothetical data).
Each cake brings in $45 of profit, but the bakery pays a decorator $30 every weekday whether or not any cakes are ordered. Let be the bakery’s daily profit from custom cakes, in dollars.
- (a) Find and .
- (b) Write in terms of .
- (c) Use your answers to (a) and (b) to find and the standard deviation of . You may use your GDC.
H6. (Core) A raw quiz score (the score of a randomly chosen student) has mean and standard deviation . The teacher rescales every score using so that the new scores have mean and standard deviation .
- (a) Find and , given that .
- (b) There is a second pair of values of and that also gives mean and standard deviation . Find it, and explain why the teacher wouldn’t use it.
- (c) Using your answer to (a), what rescaled score does a raw score of become?
Challenge
Section titled “Challenge”H7. (Challenge) takes the values and , each with probability . Sam says: ” is just , so .”
- (a) Find .
- (b) Write down the distribution of and find directly from it.
- (c) Explain what is wrong with Sam’s reasoning, and state the correct rule.
- (d) How does the standard deviation of compare with the standard deviation of ?
H8. (Challenge) Two carnival games each cost the same to play. The tables show a player’s profit in dollars per game.
Game A:
| Profit () | |||
|---|---|---|---|
| Probability |
Game B:
| Profit () | ||
|---|---|---|
| Probability |
- (a) Show that both games have the same expected profit.
- (b) Find the standard deviation of the profit for each game.
- (c) Which game is riskier? Use your answers to explain what “riskier” means here.
- (d) A friend says, “Game B is the better deal because its top prize is bigger.” Comment on this claim.
- (e) The operator of Game B triples every prize and every loss. Find the new expected profit and standard deviation.
H9. (Challenge) takes the values , and , with .
- (a) Write in terms of , and state the possible values of .
- (b) Show that for every allowed value of .
- (c) Show that .
- (d) Find if .
- (e) Could equal ? Explain.
H10. (Challenge) and . The random variable has and .
- (a) Find .
- (b) Find all possible pairs of values of and .
- (c) Find , and use it to check one of your pairs by expanding .