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.

IB Mathematics Applications and Interpretation emblem with a scatter plot, calculator, and data chart
Inside this lesson 10 sections 5 questions 8 figures

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

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.

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.

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.

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.

Probability Distribution of a Fair Die Roll01/121/61/31/611/621/631/641/651/66Value of XP(X = x)E(X)=3.5μ = 3.5
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.

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

ΣP(X=x)=1Σ 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)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)=σ2=Σ(x−μ)2⋅P(X=x)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.

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.

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

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.

Spinner Distribution — Non-Uniform Probabilities00.10.20.30.40.100.310.420.23E(X) = 1.7μ = 1.7P(X = x)Value of X
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.

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. 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. 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. 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. 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. 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.

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.

Strengths and Limitations of E(X) and Var(X)

✦

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.

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 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.

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

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}.
Show answer
A valid probability distribution requires that all probabilities sum to exactly 1. Here the sum is 0.3 + 0.3 + 0.3 + 0.3 = 1.2, which exceeds 1, so the distribution is invalid. One way to fix it is to assign equal probabilities of 0.25 to each value, since 0.25 × 4 = 1. Alternatively, you could reduce one or more probabilities so that the total equals 1, for example P(X = 8) = 0.1 while keeping the others at 0.3, giving a sum of 1.0.

Question 2: BASIC 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).
Show answer
E(X) = Σ x · P(X = x) = (1)(0.2) + (2)(0.5) + (3)(0.3) = 0.2 + 1.0 + 0.9 = 2.1. This means that if you repeated this random experiment many times, the average outcome would approach 2.1. Notice that 2.1 is between the most likely outcome (x = 2) and the next largest value (x = 3), pulled upward because x = 3 carries a meaningful 30% probability.

Question 3: INTERMEDIATE

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)]².
Show answer
First, E(X²) = (1²)(0.2) + (2²)(0.5) + (3²)(0.3) = 0.2 + 2.0 + 2.7 = 4.9. From Problem 2, E(X) = 2.1, so [E(X)]² = (2.1)² = 4.41. Therefore Var(X) = 4.9 − 4.41 = 0.49. The standard deviation is σ = √0.49 = 0.7. This tells us that individual outcomes typically deviate from the mean of 2.1 by about 0.7 units, which is a moderate amount of spread for this distribution.

Question 4: APPLIED

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.
Show answer
First, find E(X): (0)(0.4) + (1)(0.35) + (2)(0.15) + (3)(0.10) = 0 + 0.35 + 0.30 + 0.30 = 0.95 breakdowns per week. The expected weekly repair cost is 150 × E(X) = 150 × 0.95 = $142.50. For variance, E(X²) = (0)(0.4) + (1)(0.35) + (4)(0.15) + (9)(0.10) = 0 + 0.35 + 0.60 + 0.90 = 1.85. So Var(X) = 1.85 − (0.95)² = 1.85 − 0.9025 = 0.9475. The standard deviation of X is σ ≈ 0.974 breakdowns. Since cost = 150X, the standard deviation of cost is 150 × 0.974 ≈ $146.03. The owner should budget about $142.50 per week but should keep reserves of at least $142.50 + $146 ≈ $289 to cover above-average weeks.

Question 5: CRITICAL 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.
Show answer
Game A: E(X) = (0)(0.5) + (3)(0.3) + (6)(0.2) = 0 + 0.9 + 1.2 = $2.10. E(X²) = 0 + 2.7 + 7.2 = 9.9. Var(X) = 9.9 − 4.41 = 5.49, so σ ≈ $2.34. Expected net gain = $2.10 − $3 = −$0.90. Game B: E(X) = (0)(0.7) + (10)(0.3) = $3.00. E(X²) = 0 + 30 = 30. Var(X) = 30 − 9 = 21, so σ ≈ $4.58. Expected net gain = $3 − $3 = $0. Game B is the mathematically better choice because it breaks even on average, while Game A loses $0.90 per play. A risk-averse player, however, might prefer Game A because its lower variance means outcomes are more predictable — you lose less dramatically when you lose. A risk-seeking player should choose Game B because the potential $7 profit ($10 − $3) is exciting and the expected value is fair, even though 70% of the time you walk away empty-handed. This illustrates why expected value alone is not enough: variance captures the risk dimension that matters for personal decision-making.

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.

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