A stall at a mela charges Tk 20 to roll a die. Roll a six and you win Tk 60. Is the game worth playing? To answer, you need the expected value: the average result you would get if you played many, many times. In this lesson you will meet random variables, write their probability distributions, and calculate their expected value, variance and standard deviation.
In this lesson you will learn
- What a discrete random variable is
- How to write a probability distribution table
- How to find the expected value E(X)
- How to find the variance and standard deviation
- How to decide whether a game is fair
You should know probability and variance and standard deviation of data.
What Is a Random Variable?
A random variable, usually written X, is a number that depends on the result of a chance experiment. Toss two coins and let X be the number of heads. X can be 0, 1 or 2. When X can only take separate values like these, it is a discrete random variable.
Its probability distribution lists each value with its probability:
Outcomes: TT, TH, HT, HH (all equally likely)
x 0 1 2
P(X = x) 1/4 1/2 1/4
Two rules always hold: every probability is between 0 and 1, and the probabilities add up to 1.
Expected Value
The expected value, or mean, of X is each value times its probability, all added up:
E(X) = Σ x · P(X = x)
Two coins: E(X) = 0 × ¼ + 1 × ½ + 2 × ¼ = 1
One die: E(X) = (1 + 2 + 3 + 4 + 5 + 6) × 1/6 = 21/6 = 3.5
Notice that a die can never show 3.5. The expected value is a long-run average, not a value you expect to see on one roll. Roll a die a thousand times and the mean of your results will be very close to 3.5.
Variance and Standard Deviation
The expected value gives the centre. The variance measures how spread out the values are. The easiest formula is “mean of the squares minus the square of the mean”:
Var(X) = E(X²) − [E(X)]², where E(X²) = Σ x² · P(X = x)
SD = √Var(X)
One die:
E(X²) = (1 + 4 + 9 + 16 + 25 + 36)/6 = 91/6
Var(X) = 91/6 − 3.5² = 91/6 − 49/4 = 35/12 ≈ 2.917
SD = √2.917 ≈ 1.708
Two coins: E(X²) = 0 × ¼ + 1 × ½ + 4 × ¼ = 1.5, Var(X) = 1.5 − 1² = 0.5
Is the Game Fair?
Back to the mela. Let W be your winnings from one roll.
w 60 0
P(W = w) 1/6 5/6
E(W) = 60 × 1/6 + 0 × 5/6 = Tk 10
You pay Tk 20, so on average you lose 20 − 10 = Tk 10 per game.
A game is fair when your expected gain is zero. This one would be fair only if it cost Tk 10 to play. Every game a stall or a lottery runs is set up so that the expected gain of the player is negative; that is how the organiser makes money.
Finding an Unknown Probability
X takes the values 1, 2, 3, 4 with P(X = x) = kx. Find k and E(X).
Probabilities must add to 1: k(1 + 2 + 3 + 4) = 1, so k = 1/10
E(X) = 1 × 1/10 + 2 × 2/10 + 3 × 3/10 + 4 × 4/10 = 30/10 = 3
Useful Rules
| Rule | Meaning |
|---|---|
| E(aX + b) = aE(X) + b | Scaling and shifting the values does the same to the mean |
| Var(aX + b) = a² Var(X) | Shifting does not change the spread; scaling by a multiplies it by a² |
For example, if a prize is Tk 100 times the number of heads in two coin tosses, its expected value is 100 × 1 = Tk 100 and its variance is 100² × 0.5 = 5,000. For a special case where each trial is a success or failure, see the binomial distribution.
Common Mistakes
- Probabilities that do not add to 1. Always check the total before using a table.
- Squaring the mean instead of the values. E(X²) means square each x first, then weight by its probability.
- Forgetting the cost of a game. The expected gain is the expected winnings minus the price.
- Var(2X) = 2Var(X). It is 4Var(X), because the factor is squared.
Practice Exercises
Exercise 1. X has the distribution P(X = 0) = 0.2, P(X = 1) = 0.5, P(X = 2) = 0.3. Find E(X) and Var(X).
Show answer
E(X) = 0 + 0.5 + 0.6 = 1.1. E(X²) = 0 + 0.5 + 1.2 = 1.7. Var(X) = 1.7 − 1.21 = 0.49.
Exercise 2. Two dice are rolled and X is the total. Without a long table, what is E(X)?
Show answer
Each die has an expected value of 3.5, and expected values add, so E(X) = 3.5 + 3.5 = 7.
Exercise 3. In the mela game, what prize for a six would make the Tk 20 game fair?
Show answer
We need expected winnings of Tk 20: prize × 1/6 = 20, so the prize must be Tk 120.
Frequently Asked Questions
What does expected value mean in probability?
It is the long-run average of a random variable. If you repeat the experiment many times, the mean of your results gets closer and closer to the expected value.
Can the expected value be a value X never takes?
Yes. A fair die has an expected value of 3.5, even though no single roll can show 3.5. It describes the average, not a single result.
Summary
- A random variable is a number decided by chance; its distribution lists values and probabilities.
- E(X) = Σ x · P(X = x), the long-run average.
- Var(X) = E(X²) − [E(X)]², and SD is its square root.
- A game is fair when the expected gain is zero.
Back to the start of the series: Real Numbers.
