Historical Context & Motivation
Long before statisticians had computers or calculators, people were fascinated by games of chance. Card games, dice, and lotteries drove early thinkers to ask a deceptively simple question: if I play this game many times, how much should I expect to win or lose on average? This quest to quantify randomness gave birth to the concept of a random variable — a way to assign numbers to the outcomes of chance experiments — and to the formulas for expected value and variance that we still use today.
The central question these mathematicians tackled remains at the heart of SL 4.5: given a random experiment with numerical outcomes, how do we summarize the center and spread of its probability distribution? That is exactly what expected value and variance accomplish.
Core Principles & Definitions
Before diving into formulas, it is important to build a clear vocabulary. A discrete random variable is a variable whose value is determined by the outcome of a random process and that can only take on a countable number of distinct values — think of the result of rolling a die (1, 2, 3, 4, 5, or 6) or the number of heads in five coin flips (0, 1, 2, 3, 4, or 5). The word "discrete" distinguishes these from continuous random variables, which can take any value in an interval.
Random Variable (X)
Probability Distribution
Expected Value E(X)
Variance Var(X)
Standard Deviation σ
Visualizing a Probability Distribution
The diagram below shows a probability distribution for a discrete random variable X representing the number of goals scored by a football team in a match. Each bar's height represents the probability of that outcome. Notice how all the bar heights add up to 1, and the dashed line marks the expected value — the balance point of the distribution.
Two important observations stand out. First, the expected value of 1.80 is not an integer, even though the team can only score whole numbers of goals — the expected value represents the theoretical average over many matches, not a single game's result. Second, the distribution is not symmetric: the bars are taller on the left side, indicating the team is more likely to score 1 or 2 goals than 3 or 4. This asymmetry is captured numerically by the variance and standard deviation.
Mathematical Framework
Now let's formalize the ideas with the formulas you will use on the IB exam. All of them boil down to one principle: multiply each value by its probability and add up the results.
Building and Interpreting Probability Tables
In many IB problems, you are given a partially completed probability table and must find a missing probability before computing E(X) or Var(X). The key constraint is that the probabilities must sum to 1. The table below shows the distribution from our football example, along with the intermediate columns needed for calculating E(X) and E(X²).
| x | P(X = x) | x · P(X = x) | x² | x² · P(X = x) |
|---|---|---|---|---|
| 0 | 0.10 | 0.00 | 0 | 0.00 |
| 1 | 0.30 | 0.30 | 1 | 0.30 |
| 2 | 0.35 | 0.70 | 4 | 1.40 |
| 3 | 0.20 | 0.60 | 9 | 1.80 |
| 4 | 0.05 | 0.20 | 16 | 0.80 |
| Totals | 1.00 | 1.80 | — | 4.30 |
From the totals row, we read off E(X) = 1.80 and E(X²) = 4.30. Using the shortcut variance formula: Var(X) = 4.30 − 1.80² = 4.30 − 3.24 = 1.06. The standard deviation is σ = √1.06 ≈ 1.03 goals. This tells us that on a typical match, the team's score deviates from the average by about 1 goal.
Worked Example
A spinner is divided into four sections. The random variable X represents the prize (in dollars) a player wins on each spin. The probability distribution is shown below. Find the expected value E(X), the variance Var(X), and the standard deviation σ.
| x (dollars) | P(X = x) |
|---|---|
| 0 | 0.40 |
| 2 | 0.30 |
| 5 | 0.20 |
| 10 | 0.10 |
Key Properties and Common Pitfalls
When working with expected value and variance, certain properties save time and help avoid mistakes on IB exams. The table below summarizes the most important rules alongside the common errors students make.
| Property / Rule | Formula | Common Mistake |
|---|---|---|
| Probabilities sum to 1 | ∑ P(X = xᵢ) = 1 | Forgetting to use this to find a missing probability before proceeding |
| E(X) need not be a possible value of X | — | Rounding E(X) to the nearest integer because 'it should be a real outcome' |
| Linear transformation of E(X) | E(aX + b) = aE(X) + b | Applying this rule to variance (variance treats constants differently) |
| Linear transformation of Var(X) | Var(aX + b) = a²Var(X) | Including the +b term (adding a constant shifts values but doesn't change spread) |
| Variance is always ≥ 0 | σ² ≥ 0 | Getting a negative variance (usually a calculation error — recheck your work) |
Connection to Advanced Topics
The concepts you have learned here form the foundation for several more advanced topics in the IB course and beyond. Understanding expected value and variance now will make the jump to named distributions, hypothesis testing, and even the normal distribution much smoother.
| What You Know Now (SL 4.5) | Where It Leads |
|---|---|
| General discrete distributions with tables | Binomial distribution (SL 4.7) — a specific formula for counting successes in repeated trials |
| E(X) as a weighted average | Continuous distributions where E(X) becomes an integral (HL) |
| Var(X) as a measure of spread | Normal distribution (SL 4.9) where μ and σ fully define the bell curve |
| Checking if a distribution is valid | Chi-squared goodness of fit tests — comparing observed data to expected distributions |
In particular, the binomial distribution you will encounter next is simply a specific type of discrete random variable where each trial has exactly two outcomes (success or failure). Its expected value and variance have their own neat shortcut formulas, but they are derived from the same ∑ xᵢ · P(X = xᵢ) principle you practiced here. Mastering the general case now means you already understand the engine that powers every named distribution.
Practice Problems
Lesson Summary
A discrete random variable assigns numerical values to the outcomes of a random experiment, and its probability distribution lists every possible value alongside its probability. For the distribution to be valid, all probabilities must be between 0 and 1, and they must sum to exactly 1. The expected value E(X) = ∑ x · P(X = x) gives the long-run average — the center of the distribution. It does not need to be a value the variable can actually take.
The variance Var(X) = E(X²) − [E(X)]² measures how spread out the distribution is, and the standard deviation σ = √Var(X) expresses that spread in the original units of the variable. Under linear transformations, E(aX + b) = aE(X) + b but Var(aX + b) = a²Var(X), because adding a constant shifts the center without affecting the spread. These tools form the foundation for every named distribution — especially the binomial and normal distributions — you will study later in the IB course.