SECTION 1
Historical Context & Motivation
The study of random variables grew out of a very practical question: how do you make fair bets? In the 1600s, European mathematicians began exchanging letters about games of chance, trying to figure out whether a wager was worth taking. Their key insight was that randomness is not pure chaos — it has predictable patterns when you look at the long run. This idea eventually became the foundation for insurance, quality control, medical research, and countless other fields that rely on quantifying uncertainty.
1654 • The Problem of Points
1713 • Ars Conjectandi Published
1812 • Laplace's Théorie Analytique
1933 • Kolmogorov's Axioms
The central question that these mathematicians tackled remains relevant today: if a random process can produce several different numerical outcomes, what single number best summarizes what you should expect to happen on average, and how much variability surrounds that average? Those two ideas — expected value and variance — are exactly what SL 4.5 is all about.
SECTION 2
Core Principles & Definitions
Before we start calculating, we need to lock down a few key definitions. A random variable is a variable whose value is determined by a random process — like the number showing on a rolled die, or the number of heads in five coin flips. When the possible values can be listed (even if the list is long), we call it a discrete random variable. We typically denote random variables with capital letters like X, while the specific values they take are lowercase, like x.
Discrete Random Variable (X)
Probability Distribution
Expected Value E(X)
Variance Var(X)
KEY TAKEAWAY
SECTION 3
Visualizing a Discrete Probability Distribution
The best way to understand a discrete random variable is to see its probability distribution displayed as a bar chart. Each bar sits over one possible value of X, and its height represents the probability of that value occurring. The diagram below shows the distribution for X = the number showing when you roll a fair six-sided die.
Notice that the expected value of 3.5 is not one of the possible outcomes of a die roll. This is perfectly normal — the expected value is a theoretical average over many repetitions, not necessarily a value the random variable can actually produce. If you rolled a die 6000 times, you would expect the total of all rolls to be roughly 6000 × 3.5 = 21 000.
SECTION 4
Mathematical Framework
Now let's formalize the calculations. Below are the three key formulas you need for SL 4.5. In each formula, the Greek letter Σ (sigma) means "sum over all possible values of x."
VALIDITY CONDITION
The probabilities of all possible values must add up to exactly 1. If they don't, the distribution is invalid.
EXPECTED VALUE (MEAN)
Multiply each outcome x by its probability P(X = x), then add all products together. This is the weighted average of the distribution.
VARIANCE
For each value, find its squared distance from the mean, multiply by its probability, then sum. This measures spread. The standard deviation σ is the square root of the variance: σ = √Var(X).
IB Formula Booklet
There is also a shortcut formula for variance that some students find faster: Var(X) = E(X²) − [E(X)]². Here, E(X²) = Σ x² · P(X = x). Both formulas give the same answer, so use whichever you prefer.
SECTION 5
Building a Distribution Table Step by Step
Let's walk through an example that isn't uniform. Suppose a spinner has four sectors labelled 0, 1, 2, and 3, but the sectors are different sizes. The probability distribution for X = the number the spinner lands on is shown in the table below.
| x | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| P(X = x) | 0.1 | 0.3 | 0.4 | 0.2 |
| x · P(X = x) | 0 | 0.3 | 0.8 | 0.6 |
| (x − μ)² · P(X = x) | 0.289 | 0.147 | 0.036 | 0.162 |
Distribution table for the spinner: computing E(X) and Var(X)
From the second row we get E(X) = 0 + 0.3 + 0.8 + 0.6 = 1.7. Then the third row (using μ = 1.7) gives Var(X) = 0.289 + 0.147 + 0.036 + 0.162 = 0.81, so the standard deviation is σ ≈ 0.9.
SECTION 6
Worked Example — The Lucky Ticket Game
A school fundraiser sells scratch-off tickets for $2 each. The prize distribution is as follows: 50% of tickets win nothing, 30% win $1, 15% win $5, and 5% win $20. Let X be the prize amount. Find E(X), Var(X), and decide whether the ticket is worth buying from a purely mathematical standpoint.
Lucky Ticket Game
- 1
Step 1 — Set Up the Distribution Table
List each possible prize value alongside its probability. Check that probabilities sum to 1: 0.50 + 0.30 + 0.15 + 0.05 = 1.00 ✓x ∈ {0, 1, 5, 20} with P = {0.50, 0.30, 0.15, 0.05} - 2
Step 2 — Calculate E(X)
E(X) = Σ x · P(X = x) = (0)(0.50) + (1)(0.30) + (5)(0.15) + (20)(0.05) = 0 + 0.30 + 0.75 + 1.00E(X) = $2.05 - 3
Step 3 — Calculate E(X²)
We use the shortcut formula for variance. E(X²) = (0²)(0.50) + (1²)(0.30) + (5²)(0.15) + (20²)(0.05) = 0 + 0.30 + 3.75 + 20.00E(X²) = 24.05 - 4
Step 4 — Calculate Var(X) and σ
Var(X) = E(X²) − [E(X)]² = 24.05 − (2.05)² = 24.05 − 4.2025 = 19.8475. Then σ = √19.8475 ≈ 4.46.Var(X) ≈ 19.85, σ ≈ $4.46 - 5
Step 5 — Interpret the Results
The expected prize is $2.05, which is slightly more than the $2 ticket price. On average, each ticket returns 5 cents of profit. However, the standard deviation of $4.46 is much larger than this tiny profit, meaning individual results will vary wildly — most people will win $0 or $1. The game is approximately fair.Expected net gain per ticket ≈ $0.05 (roughly fair)
SECTION 7
Strengths and Limitations of Expected Value & Variance
Expected value and variance are incredibly useful summary statistics, but like any tool, they have strengths and limitations you should be aware of — especially in IB exam questions that ask you to interpret your results in context.
| Aspect | Strength | Limitation |
|---|---|---|
| Summarization | Condenses an entire distribution into just two numbers (center and spread), making quick comparisons easy. | Two very different distributions can share the same E(X) and Var(X), hiding important shape differences. |
| Interpretation | E(X) has a direct real-world meaning: the long-run average outcome if the experiment is repeated many times. | E(X) may not be a value the variable can actually take (e.g., 3.5 on a die), which can confuse interpretation. |
| Decision-Making | Crucial in finance, insurance, and game design for evaluating whether a risk is worth taking. | Ignores the player's attitude toward risk. A $1 million expected value matters differently to a billionaire vs. a student. |
| Mathematical Tractability | Variance obeys neat algebraic rules (e.g., Var(aX + b) = a²Var(X)) that simplify advanced calculations. | Variance uses squared units (e.g., $²), which can be unintuitive until you convert to standard deviation. |
Strengths and Limitations of E(X) and Var(X)
KEY TAKEAWAY
SECTION 8
Connection to More Advanced Topics
The ideas you're learning now form the backbone of probability and statistics at every level. The table below shows how the concepts from SL 4.5 connect to more advanced topics you may encounter later in the IB course or in university.
| SL 4.5 Concept | Where It Leads |
|---|---|
| Discrete probability distribution | Specific named distributions: the Binomial distribution (SL 4.7) models the number of successes in n trials, and the Poisson distribution (HL) models rare events. |
| E(X) as a weighted average | For continuous random variables, the sum becomes an integral: E(X) = ∫ x · f(x) dx. The concept is identical, but the tool changes from addition to integration. |
| Var(X) measuring spread | In the Normal distribution (SL 4.9), the standard deviation σ determines the bell curve's width. The 68–95–99.7 rule follows directly from variance. |
| Σ P(X = x) = 1 | This validity condition generalizes to the axioms of probability. In advanced courses, probability density functions must integrate to 1 over their domain. |
How SL 4.5 concepts connect to advanced probability topics
If you're taking the Applications and Interpretation course, you'll next apply these ideas to the Binomial distribution (SL 4.7), which is simply a specific discrete distribution where each trial has two outcomes (success or failure). Everything you practise here — building tables, computing E(X) and Var(X) — transfers directly.
SECTION 9
Practice Problems
Question 1: CONCEPTUAL
Show answer
Question 2: BASIC CALCULATION
Show answer
Question 3: INTERMEDIATE
Show answer
Question 4: APPLIED
Show answer
Question 5: CRITICAL THINKING
Show answer
SUMMARY
Summary — Discrete Random Variables, Expected Value & Variance
Summary
A discrete random variable X takes on a countable set of numerical values, each paired with a probability in a probability distribution. For the distribution to be valid, every probability must be between 0 and 1, and all probabilities must sum to exactly 1. The expected value E(X) = Σ x · P(X = x) gives the long-run average outcome — a weighted mean where more probable outcomes count more heavily. It may or may not be a value the variable can actually take.
The variance Var(X) = Σ (x − μ)² · P(X = x) measures how spread out the distribution is around the mean. A small variance means outcomes cluster tightly around E(X), while a large variance indicates wide scatter. The standard deviation σ = √Var(X) converts variance back to the original units, making it easier to interpret. Together, E(X) and Var(X) provide a powerful two-number summary of any discrete distribution, enabling informed decisions about games, costs, risks, and real-world scenarios.