IB MATHEMATICS: APPLICATIONS AND INTERPRETATION • STATISTICS AND PROBABILITY

Discrete Random Variables — SL 4.5 Discrete random variables; expected value and variance (intro)

Learn how to predict the long-run average and spread of outcomes using expected value and variance.

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
Blaise Pascal and Pierre de Fermat exchange letters about dividing stakes in an unfinished game. Their correspondence formalizes the concept of expected value — the idea of weighting outcomes by their probabilities.
1713
Ars Conjectandi Published
Jacob Bernoulli's posthumous masterwork introduces the law of large numbers, proving that averages of random outcomes stabilize as trials increase.
1812
Laplace's Théorie Analytique
Pierre-Simon Laplace unifies probability theory, formalizing variance as a measure of how spread out a distribution is around its expected value.
1933
Kolmogorov's Axioms
Andrey Kolmogorov publishes rigorous axioms for probability, giving a firm mathematical foundation to discrete and continuous random variables alike.

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.

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.

1

Discrete Random Variable (X)

A variable that takes on a countable set of numerical values, each with an assigned probability. Example: the number of goals in a soccer match (0, 1, 2, 3, …).
2

Probability Distribution

A table, formula, or graph that lists every possible value of X alongside its probability P(X = x). All probabilities must be between 0 and 1, and they must sum to exactly 1.
3

Expected Value E(X)

The long-run average outcome, calculated by multiplying each value by its probability and summing. Also called the mean (μ) of the distribution.
4

Variance Var(X)

A measure of how spread out the values are from the expected value. Larger variance means outcomes are more scattered. Its square root is the standard deviation σ.
KEY TAKEAWAY
Think of expected value like the balance point of a seesaw. If you placed weights at each possible outcome (heavier weights for more probable outcomes), E(X) is the spot where the seesaw would perfectly balance. Variance tells you how far those weights are spread out from that balance point — a small variance means the weights cluster tightly, while a large variance means they're spread wide.

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.

Each cyan bar has height 1/6 because all outcomes of a fair die are equally likely. The dashed pink line marks the expected value E(X) = 3.5, which falls between 3 and 4 — a value you can never actually roll, but it represents the long-run average.

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.

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
Σ P(X = x) = 1
The probabilities of all possible values must add up to exactly 1. If they don't, the distribution is invalid.
EXPECTED VALUE (MEAN)
E(X) = μ = Σ x · P(X = x)
Multiply each outcome x by its probability P(X = x), then add all products together. This is the weighted average of the distribution.
VARIANCE
Var(X) = σ² = Σ (x − μ)² · P(X = x)
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
On the IB exam you will have access to the formula booklet, which lists E(X) = Σ x · P(X = x) and Var(X) = Σ (x − μ)² · P(X = x). However, you need to practise using these formulas so you can apply them efficiently under timed conditions.

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.

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.

Distribution table for the spinner: computing E(X) and Var(X)
x0123
P(X = x)0.10.30.40.2
x · P(X = x)00.30.80.6
(x − μ)² · P(X = x)0.2890.1470.0360.162

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.

The tallest bar is at x = 2 (probability 0.4), pulling the expected value toward 2. The pink dashed line shows E(X) = 1.7, confirming the mean is weighted toward the higher-probability values.

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 TableList 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.00
E(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.00
E(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 ResultsThe 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)

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.

Strengths and Limitations of E(X) and Var(X)
AspectStrengthLimitation
SummarizationCondenses 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.
InterpretationE(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-MakingCrucial 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 TractabilityVariance 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.
KEY TAKEAWAY
Expected value is like checking the average star rating of a restaurant — it tells you the typical experience. Variance is like looking at how many one-star and five-star reviews there are — it tells you how consistent that experience is. A restaurant with 4.0 stars and low variance is reliably good, while one with 4.0 stars and high variance might be amazing or terrible depending on the night.

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.

How SL 4.5 concepts connect to advanced probability topics
SL 4.5 ConceptWhere It Leads
Discrete probability distributionSpecific 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 averageFor 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 spreadIn 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) = 1This validity condition generalizes to the axioms of probability. In advanced courses, probability density functions must integrate to 1 over their domain.

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.

Practice Problems

PROBLEM 1CONCEPTUAL
A discrete random variable X has the values {2, 4, 6, 8}. A student claims that P(X = 2) = 0.3, P(X = 4) = 0.3, P(X = 6) = 0.3, and P(X = 8) = 0.3. Explain why this is not a valid probability distribution, and describe one way to fix it while keeping the values {2, 4, 6, 8}.
PROBLEM 2BASIC CALCULATION
A random variable X has the following distribution: P(X = 1) = 0.2, P(X = 2) = 0.5, P(X = 3) = 0.3. Calculate E(X).
PROBLEM 3INTERMEDIATE
Using the same distribution from Problem 2 — P(X = 1) = 0.2, P(X = 2) = 0.5, P(X = 3) = 0.3 — calculate Var(X) and the standard deviation σ. Show your working using the formula Var(X) = E(X²) − [E(X)]².
PROBLEM 4APPLIED
A café owner notices that the number of espresso machines that break down in a week, X, follows this distribution: P(X = 0) = 0.4, P(X = 1) = 0.35, P(X = 2) = 0.15, P(X = 3) = 0.10. Each breakdown costs $150 to repair. Find the expected weekly repair cost and the standard deviation of the weekly repair cost.
PROBLEM 5CRITICAL THINKING
Two carnival games each cost $3 to play. Game A awards prizes of $0, $3, or $6 with probabilities 0.5, 0.3, and 0.2 respectively. Game B awards prizes of $0 or $10 with probabilities 0.7 and 0.3 respectively. Calculate E(X) and Var(X) for each game, then write a paragraph arguing which game a risk-averse player should choose and which game a risk-seeking player should choose. Justify your reasoning using your calculations.

Summary — Discrete Random Variables, Expected Value & Variance

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.

Varsity Tutors • IB Mathematics: Applications and Interpretation • Discrete Random Variables — SL 4.5 Discrete random variables; expected value and variance (intro)