Privacy note: We capture your IP address to provide customised and focused services. See our Privacy Policy.

AP Statistics: Deep Dive and FRQ Mastery — Alpha School

Lesson 14: Discrete Random Variables — Expected Value and Variance

A random variable is a numerical value that results from a random process, and describing it means giving its probability distribution: the list of possible values and the probability of each. A discrete random variable takes separate, countable values — the number of heads in three coin tosses, the number of defective items in a batch — while a continuous random variable can take any value in an interval, such as a height or a time. This lesson is about discrete variables; continuous ones are handled by the Normal distribution you have already met.

The expected value, or mean, of a discrete random variable is the long-run average value you would get if the process were repeated many times, computed as μ = Σ x × P(x), weighting each value by its probability. It is a centre of the distribution, not a prediction for any single trial: the expected number of heads in three tosses is 1.5, though no single set of three tosses can produce one and a half heads. The variance measures the spread, computed as σ² = Σ (x − μ)² × P(x), the probability-weighted average squared distance from the mean, and the standard deviation is its square root, back in the original units.

Random variables can be combined, and the rules are straightforward but have one subtlety. The mean of a sum is the sum of the means, whether or not the variables are independent: E(X + Y) = E(X) + E(Y), and the same holds for differences. Variances, however, add only when the variables are independent: Var(X + Y) = Var(X) + Var(Y) for independent X and Y, and — surprisingly to many students — variances also add for a difference, Var(X − Y) = Var(X) + Var(Y), because subtracting a variable adds its variability rather than cancelling it. Never add standard deviations; convert to variances, add, and square-root back.

Linear transformations of a random variable follow simple rules that are worth memorizing. Adding a constant shifts the mean by that constant but leaves the variance unchanged, because shifting every value does not change how spread out they are. Multiplying by a constant multiplies the mean by that constant and multiplies the variance by the square of the constant, and the standard deviation by the constant itself. So for Y = aX + b, the mean is aμ + b and the variance is a²σ². These rules let you move between a measurement and a rescaled version of it, such as converting a temperature or a currency, without recomputing the whole distribution.

A worked example

Worked example: consider a game where a fair six-sided die is rolled and you win the number of dollars shown, except that rolling a 6 wins 12 dollars instead. The probability distribution is P(1) = P(2) = P(3) = P(4) = P(5) = 1/6 and P(12) = 1/6. The expected winnings are (1 + 2 + 3 + 4 + 5 + 12) / 6 = 27 / 6 = 4.5 dollars, so over many plays you would average 4.50 dollars per game. The variance is the weighted average of the squared deviations from 4.5, which works out to about 12.25, so the standard deviation is about 3.50 dollars — a large spread relative to the mean, which tells you the game is a gamble, not a steady income.

When you write up a random variable problem, always start by giving the probability distribution, either as a table or as a list, and check that the probabilities add to 1. Then show the expected value calculation with the formula and the substituted numbers, and do the same for the variance. State the independence assumption whenever you add variances, and if the variables are not independent, say so and do not add them. These habits are exactly what free-response markers look for.

Key Terms

Random variable
A numerical value resulting from a random process, described by its probability distribution.
Expected value
The long-run average value, μ = Σ x × P(x).
Variance
The probability-weighted average squared distance from the mean, σ² = Σ (x − μ)² × P(x).
Discrete random variable
A random variable taking separate, countable values.
Independent random variables
Random variables whose joint probabilities factor; their variances add when they are combined.

Discussion Questions

  1. The expected value of a die roll is 3.5, but no roll gives 3.5. What does the number mean?
  2. Why do variances add for a difference of independent variables, rather than subtract?
  3. When is it safe to add variances, and when is it not?

Practice Questions

  1. A random variable takes values 0, 1, 2 with probabilities 0.25, 0.5, 0.25. Find its expected value.
  2. X has mean 10 and variance 4. Find the mean and variance of Y = 3X + 2.
  3. X and Y are independent with variances 9 and 16. What is the variance of X + Y?
  4. What is the standard deviation of X + Y in the previous question?
  5. A probability distribution has probabilities 0.2, 0.3, and 0.4. What is wrong?
Show answers
  1. E = 0 × 0.25 + 1 × 0.5 + 2 × 0.25 = 1.
  2. Mean = 3 × 10 + 2 = 32; variance = 9 × 4 = 36.
  3. 25, since variances of independent variables add.
  4. √25 = 5.
  5. They add to 0.9, not 1, so it is not a valid probability distribution.
Keep reading to complete this lesson