Discrete random variables: mean and standard deviation
What this lesson covers
- The mean of a discrete random variable is each value times its probability, added up.
- The probabilities in a table must sum to 1, which finds any missing value.
More from the same table
- Level 2: the mean as a long-run average.
- Level 3: the spread as well.
- And what scaling does to both.
Bikes per booking
- X = number of bikes in one booking.
- Three probabilities are known.
- The one for 3 bikes is k.
| Bikes, x | P(X = x) |
|---|---|
| 1 | 0.35 |
| 2 | 0.3 |
| 3 | k |
| 4 | 0.15 |
The probabilities add to 1
- Probabilities add to 1.
- Each is between 0 and 1.
- If not, find the error.
- 0.35 + 0.3 + k + 0.15 = 1sum to 1
- 0.8 + k = 1
- k = 1 − 0.8 = 0.2
- 0 ≤ 0.2 ≤ 1
The distribution, drawn
- One bike is the most likely.
- The bars step down to 0.15.
- The mean is the balance point.

Try it: the mean in the long run
The mean: Σ x × P(X = x)
- Value × probability.
- Write every product.
- E(X) = Σ x × P(X = x)
- = 1 × 0.35 + 2 × 0.3
- + 3 × 0.2 + 4 × 0.15
- = 0.35 + 0.6 + 0.6 + 0.6
- = 2.15 bikes
Try it: mean and standard deviation
One more sum: E(X²)
- Square each value first.
- Then times its probability.
- E(X²) = Σ x² × P(X = x)
- = 1² × 0.35 + 2² × 0.3
- + 3² × 0.2 + 4² × 0.15
- = 0.35 + 1.2 + 1.8 + 2.4
- = 5.75
Variance and standard deviation
- Var(X) = E(X²) − μ².
- Square root for σ.
- Var(X) = E(X²) − [E(X)]²
- = 5.75 − 2.15²
- = 5.75 − 4.6225
- = 1.1275
- σ = √1.1275 = 1.0618 bikes
Rounding early: the 2025 warning
- Round μ to 2.2: Var = 0.91.
- Nearly 20% too small.
- Keep 4 decimal places.
- μ ≈ 2.2: 2.2² = 4.84
- Var = 5.75 − 4.84 = 0.91rounded too early
- Var = 5.75 − 4.6225 = 1.1275
- 0.91/1.1275 = 0.8071about 19% too small
The expectation rules in the booklet
- E(aX + b) = aE(X) + b.
- Var(aX + b) = a²Var(X).
- Adding b does not change the spread.
| Rule | Gives |
|---|---|
| E(aX + b) | aE(X) + b |
| Var(aX + b) | a²Var(X) |
| SD(aX + b) | |a| × SD(X) |
The charge: T = 30X + 10
- E(T) = 30E(X) + 10.
- No + 10 in the spread.
- T = 30X + 10
- E(T) = 30 × E(X) + 10
- = 30 × 2.15 + 10
- = 64.50 + 10 = $74.50
- Var(T) = 30² × Var(X)
- = 900 × 1.1275 = 1014.75
- SD(T) = √1014.75 = 31.8551
- ≈ $31.86
- 30 × 1.1275 + 10a not squared, + 10
What the mean means
- Over many bookings: 2.15 bikes on average.
- No single booking hires 2.15 bikes.
- 200 × $74.50 = $14,900.
Where the marks are
- Achieved: missing probability and the mean.
- Merit: SD, the rules, meaning in context.
- Excellence: accurate through a long problem.
What to take away
- Sum to 1, then the mean, then E(X²) − μ², with four decimal places throughout.
| Missing p | sum to 1, then check |
| E(X) | Σ x × P(X = x) |
| Var(X) | E(X²) − μ² |
| SD | √Var(X) |
| aX + b | mean: aμ + b |
| variance: a²Var(X) | |
| Working | four decimal places |
Common mistakes
- μ ≈ 2.2, so Var(X) = 5.75 − 2.2² = 0.91Keep μ = 2.15 exact: Var(X) = 5.75 − 4.6225 = 1.1275; rounding the mean early made the variance about 19% too small.
- E(X²) = [E(X)]² = 2.15² = 4.6225E(X²) means square each value, then times its probability: Σ x² × P(X = x) = 5.75, which is not the same as squaring the mean.
- Var(30X + 10) = 30 × 1.1275 + 10Var(aX + b) = a²Var(X), so Var(T) = 900 × 1.1275 = 1014.75; adding 10 does not change the spread.
- The standard deviation is the variance, 1.1275 bikes.The standard deviation is the square root of the variance: σ = √1.1275 = 1.0618 bikes.
Your turn: four questions
- X = hockey goals: x = 0, 1, 2, 3.
- Question 3: $50 a goal plus $20.
| Given | Find | |
|---|---|---|
| 1 | P: 0.1, 0.4, k, 0.2 | k |
| 2 | the same X | E(X), SD |
| 3 | Y = 50X + 20 dollars | E(Y), SD(Y) |
| 4 | E(X) = 1.6 goals | meaning |
Show answer
1. 0.1 + 0.4 + k + 0.2 = 1, so k = 0.3. 2. E(X) = 1.6; E(X²) = 3.4; Var(X) = 3.4 − 2.56 = 0.84; SD = 0.9165. 3. E(Y) = 50 × 1.6 + 20 = $100; Var(Y) = 2500 × 0.84 = 2100; SD(Y) = $45.83. 4. Over many games, the team averages 1.6 goals a game; no single game has 1.6.
The answers: questions 1 and 2
- 1. 0.1 + 0.4 + k + 0.2 = 1
- 0.7 + k = 1, so k = 0.3
- 2. E(X) = 0 × 0.1 + 1 × 0.4
- + 2 × 0.3 + 3 × 0.2
- = 0 + 0.4 + 0.6 + 0.6 = 1.6
- E(X²) = 0 × 0.1 + 1 × 0.4
- + 4 × 0.3 + 9 × 0.2
- = 0 + 0.4 + 1.2 + 1.8 = 3.4
The answers: questions 2 to 4
- E(X) = 1.6, E(X²) = 3.4
- Var(X) = 3.4 − 1.6² = 3.4 − 2.56
- = 0.84
- SD = √0.84 = 0.9165
- 3. E(Y) = 50 × 1.6 + 20 = $100
- Var(Y) = 50² × 0.84 = 2500 × 0.84
- = 2100
- SD(Y) = √2100 = $45.83
- 4. 1.6 goals a game, on average
Sample question: Achieved
X is the number of coffees a customer buys on one visit to a café. P(X = 0) = 0.15, P(X = 1) = 0.4, P(X = 2) = k and P(X = 3) = 0.1. Find k and E(X).
Hint
The probabilities add to 1. Then E(X) is each value times its probability, added up.
Answer
k = 0.35; E(X) = 1.4 coffees
Step by step
- Rule 1: the probabilities in a distribution add to 1.
- So 0.15 + 0.4 + k + 0.1 = 1, which is 0.65 + k = 1, so k = 0.35.
- Check k is between 0 and 1. It is.
- Rule 2: E(X) = Σ x × P(X = x). Multiply each value by its probability, then add.
- 0 × 0.15 + 1 × 0.4 + 2 × 0.35 + 3 × 0.1 = 0 + 0.4 + 0.7 + 0.3 = 1.4.
- Meaning: over many visits, customers buy 1.4 coffees on average. No single customer buys 1.4.
- Check: 1.4 lies between the smallest value 0 and the largest value 3, and near the most likely value 1.
Full working
- 0.15 + 0.4 + k + 0.1 = 1probabilities sum to 1
- k = 0.35
- E(X) = 0 × 0.15 + 1 × 0.4 + 2 × 0.35 + 3 × 0.1Σ x × P(X = x)
- = 0.4 + 0.7 + 0.3
- k = 0.35, E(X) = 1.4
Sample questions: Merit
A random variable X takes the values 1, 2, 3 and 4 with P(X = 1) = 0.1, P(X = 2) = a, P(X = 3) = b and P(X = 4) = 0.2. Given E(X) = 2.5, find a and b, and the standard deviation of X.
Hint
Two unknowns need two equations: one from the sum to 1 and one from the mean.
Answer
a = 0.5, b = 0.2; SD(X) = 0.9220
Step by step
- There are two unknowns, so we need two equations.
- Equation 1, the sum to 1: 0.1 + a + b + 0.2 = 1, so a + b = 0.7.
- Equation 2, the mean: 1 × 0.1 + 2a + 3b + 4 × 0.2 = 2.5, so 2a + 3b = 1.6.
- From equation 1, a = 0.7 − b. Substitute: 2(0.7 − b) + 3b = 1.6, so 1.4 + b = 1.6 and b = 0.2.
- Then a = 0.7 − 0.2 = 0.5. Both are between 0 and 1, so they are valid.
- For the spread, recall Var(X) = E(X²) − [E(X)]². First find E(X²): square each value, then times its probability.
- E(X²) = 1 × 0.1 + 4 × 0.5 + 9 × 0.2 + 16 × 0.2 = 0.1 + 2 + 1.8 + 3.2 = 7.1.
- Var(X) = 7.1 − 2.5² = 7.1 − 6.25 = 0.85.
- SD(X) = √0.85 = 0.9220.
- Classic mistake: squaring the probabilities instead of the values. Only x is squared in E(X²).
- Check the mean with your a and b: 0.1 + 1 + 0.6 + 0.8 = 2.5. Correct.
Full working
- a + b = 0.7sum to 1
- 2a + 3b = 1.6E(X) = 2.5
- b = 0.2, a = 0.5substitute a = 0.7 − b
- E(X²) = 0.1 + 2 + 1.8 + 3.2 = 7.1
- Var(X) = 7.1 − 2.5² = 0.85E(X²) − μ²
- a = 0.5, b = 0.2, SD(X) = 0.9220
X is the number of kayaks hired in one booking: P(X = 1) = 0.4, P(X = 2) = 0.35, P(X = 3) = 0.15 and P(X = 4) = 0.1. Each booking costs $25 per kayak plus a booking fee of $15. Find the mean and standard deviation of the charge for a booking, and explain what the mean means in context.
Hint
Find E(X) and SD(X) first. The charge is C = 25X + 15, so use the rules for aX + b.
Answer
E(C) = $63.75, SD(C) = $24.33. Over many bookings the average charge is $63.75
Step by step
- Start with X. E(X) = 1 × 0.4 + 2 × 0.35 + 3 × 0.15 + 4 × 0.1 = 0.4 + 0.7 + 0.45 + 0.4 = 1.95.
- E(X²) = 1 × 0.4 + 4 × 0.35 + 9 × 0.15 + 16 × 0.1 = 0.4 + 1.4 + 1.35 + 1.6 = 4.75.
- Var(X) = 4.75 − 1.95² = 4.75 − 3.8025 = 0.9475. Keep all four decimals: rounding 1.95 to 2 would wreck this.
- The charge is C = 25X + $15.
- Recall the rules: E(aX + b) = aE(X) + b, and Var(aX + b) = a²Var(X).
- E(C) = 25 × 1.95 + 15 = 48.75 + 15 = $63.75.
- Var(C) = 25² × 0.9475 = 625 × 0.9475 = 592.1875. SD(C) = √592.1875 = $24.33.
- Why no 15 in the spread? Adding the same fee to every booking moves every charge up, but does not spread them out.
- Meaning: over many bookings, the average charge is $63.75. No single booking costs exactly that.
Full working
- E(X) = 0.4 + 0.7 + 0.45 + 0.4 = 1.95
- E(X²) = 0.4 + 1.4 + 1.35 + 1.6 = 4.75
- Var(X) = 4.75 − 1.95² = 0.9475
- E(C) = 25 × 1.95 + 15 = 63.75E(aX + b) = aE(X) + b
- Var(C) = 25² × 0.9475 = 592.1875Var(aX + b) = a²Var(X)
- SD(C) = √592.1875 = 24.33
- E(C) = $63.75, SD(C) = $24.33
Sample questions: Excellence
A quiz has 3 questions. X, the number a student gets right, has P(X = x) = k(x² + 1) for x = 0, 1, 2 and 3. Find k, E(X) and Var(X) exactly. The teacher scales the marks to Y = aX + b, with a > 0, so that Y has mean 50 and standard deviation 10. Find a and b.
Hint
Write out all four probabilities in terms of k first. For Y, the mean gives one equation and the standard deviation gives another.
Answer
k = 118; E(X) = 73; Var(X) = 79; a = 30√7 ≈ 11.3389, b ≈ 23.5425
Step by step
- Write out the table: P(X = 0) = k, P(X = 1) = 2k, P(X = 2) = 5k, P(X = 3) = 10k.
- They add to 1: 18k = 1, so k = 118.
- E(X) = 0 × 1 + 1 × 2 + 2 × 5 + 3 × 1018 = 4218 = 73.
- E(X²) = 0 + 1 × 2 + 4 × 5 + 9 × 1018 = 11218 = 569.
- Var(X) = 569 − (73)² = 569 − 499 = 79. So SD(X) = √73.
- Now the scaling. Recall: SD(aX + b) = a × SD(X) when a > 0, and the b does not change the spread.
- So a × √73 = 10, which gives a = 30√7 = 11.3389.
- The mean: E(Y) = aE(X) + b = 50, so b = 50 − 30√7 × 73 = 50 − 10√7 = 23.5425.
- Classic mistake: putting b into the spread equation, or setting a × Var(X) = 10. Standard deviation scales by a, variance by a².
- Check: E(Y) = 11.3389 × 2.3333 + 23.5425 = 50.0, and SD(Y) = 11.3389 × 0.8819 = 10.0. Both match.
Full working
- k + 2k + 5k + 10k = 1, k = 118sum to 1
- E(X) = 4218 = 73
- E(X²) = 11218 = 569
- Var(X) = 569 − 499 = 79E(X²) − μ²
- a × √73 = 10, a = 30√7 = 11.3389SD(aX + b) = a × SD(X)
- b = 50 − a × 73 = 50 − 10√7 = 23.5425E(aX + b) = aE(X) + b
- k = 118, E(X) = 73, Var(X) = 79, a = 11.3389, b = 23.5425
A stall at a weekend market runs 5 days a week. X, the number of wet days in a week, has P(X = 0) = 0.3, P(X = 1) = 0.35, P(X = 2) = 0.2, P(X = 3) = 0.1 and P(X = 4) = 0.05. The stall makes $180 profit on each dry day and has $250 of costs each week, so the weekly profit is Y = 650 − 180X dollars. The owner is offered a fixed $400 a week instead. Find the mean and standard deviation of Y, the probability that Y is under $400, and advise the owner, with one limitation.
Hint
Find E(X) and Var(X), then use the rules with a = −180. For P < 400, turn it into a condition on X.
Answer
E(Y) = $425, SD(Y) = $204.24, P(Y < 400) = 0.35. The stall earns $25 more on average but is below $400 in 35% of weeks, so the fixed $400 suits an owner who needs a steady income
Step by step
- Start with X. E(X) = 0 × 0.3 + 1 × 0.35 + 2 × 0.2 + 3 × 0.1 + 4 × 0.05 = 1.25 wet days.
- E(X²) = 0 + 0.35 + 0.8 + 0.9 + 0.8 = 2.85, so Var(X) = 2.85 − 1.25² = 1.2875.
- Profit: Y = 650 − 180X, so a = −180 and b = 650.
- E(Y) = 650 − 180 × 1.25 = 650 − 225 = $425.
- Var(Y) = (−180)² × 1.2875 = 32400 × 1.2875 = 41715. The square makes it positive: spread is never negative.
- SD(Y) = √41715 = $204.24.
- Profit under $400: 650 − 180X < 400, so 180X > 250 and X > 1.39. X is a whole number, so X ≥ 2.
- P(X ≥ 2) = 0.2 + 0.1 + 0.05 = 0.35.
- Advice: the stall beats $400 by only $25 a week on average, has a large spread of about $204, and falls below $400 in 35% of weeks.
- So take the fixed $400 if a steady income matters; keep the stall only if the owner can ride out bad weeks.
- Limitation: the table is assumed to be the same all year, but winter weeks are likely wetter, so the real risk could be higher.
Full working
- E(X) = 0.35 + 0.4 + 0.3 + 0.2 = 1.25
- E(X²) = 2.85, Var(X) = 2.85 − 1.5625 = 1.2875
- E(Y) = 650 − 180 × 1.25 = 425E(aX + b) = aE(X) + b
- Var(Y) = (−180)² × 1.2875 = 41715Var(aX + b) = a²Var(X)
- SD(Y) = √41715 = 204.24
- 650 − 180X < 400 gives X ≥ 2X is whole
- P(X ≥ 2) = 0.2 + 0.1 + 0.05 = 0.35
- E(Y) = $425, SD(Y) = $204.24, P(Y < 400) = 0.35: fixed $400 is safer
Practise this
Report a mistake
More in AS 91586
Choosing a distribution, and naming it every time7 min
Discrete random variables: mean and standard deviation9 min
Binomial and Poisson: at least, at most, and the rate10 min
The normal distribution: forwards, backwards and conditional11 min
Uniform and triangular distributions, and judging a model10 min
Choosing a distribution: 7 exam questions solved step by step10 min
Discrete random variables: 7 exam questions solved step by step11 min
Binomial and Poisson: 7 exam questions solved step by step10 min
Normal distribution: 7 exam questions solved step by step10 min
Uniform and triangular: 7 exam questions solved step by step10 minIs your child on track?
Take the free placement test