IB MATHEMATICS: ANALYSIS AND APPROACHES • STATISTICS AND PROBABILITY

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

Learn to model chance outcomes with probability distributions and predict their long-run average and spread.

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.

1654
Pascal & Fermat Correspondence
Blaise Pascal and Pierre de Fermat exchanged letters about the "Problem of Points" — how to fairly divide stakes in an interrupted game. Their work laid the foundations of probability theory and the idea of assigning numerical values to uncertain outcomes.
1713
Bernoulli's Ars Conjectandi
Jacob Bernoulli published his groundbreaking book, which formalized the concept of expected value and introduced the Law of Large Numbers — the principle that averages stabilize as trials increase.
1812
Laplace's Théorie Analytique
Pierre-Simon Laplace unified earlier probability ideas and developed the mathematical framework for discrete and continuous distributions, including formal definitions of variance and standard deviation.
1900s
Modern Probability Theory
Andrey Kolmogorov axiomatized probability in 1933, giving random variables and their properties the rigorous mathematical foundation used in the IB curriculum and across all modern statistics.

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.

1

Random Variable (X)

A function that assigns a numerical value to each outcome in a sample space. We use capital letters like X for the variable and lowercase x for specific values it can take.
2

Probability Distribution

A table, formula, or graph that lists every possible value of X alongside its probability P(X = x). The probabilities must satisfy two rules: each is between 0 and 1, and they all sum to exactly 1.
3

Expected Value E(X)

The long-run average of the random variable, calculated as the sum of each value multiplied by its probability. It tells you the 'center' of the distribution — often called the mean, μ.
4

Variance Var(X)

A measure of how spread out the values are around the expected value. Large variance means outcomes are scattered far from the mean; small variance means they cluster tightly.
5

Standard Deviation σ

The square root of the variance. Because it is in the same units as the random variable itself, standard deviation is often easier to interpret than variance.
KEY TAKEAWAY
Think of expected value like a GPS prediction. If you drive to school every day, sometimes you hit green lights and arrive in 10 minutes, sometimes red lights make it 20 minutes. The expected value is like Google Maps telling you the trip will take about 14 minutes — it is the weighted average of all possible travel times, where more likely times count more. Variance tells you how reliably you can trust that prediction.

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.

The bar chart shows P(X = x) for x = 0, 1, 2, 3, 4. The dashed pink line marks the expected value E(X) = 1.80 — the long-run average number of goals per match. Notice that E(X) need not be a value that X can actually take.

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.

VALIDITY CONDITION
∑ P(X = xᵢ) = 1 and 0 ≤ P(X = xᵢ) ≤ 1 for all i
For a valid probability distribution, every individual probability must be between 0 and 1 (inclusive), and all the probabilities must sum to exactly 1.
EXPECTED VALUE (MEAN)
E(X) = μ = ∑ xᵢ · P(X = xᵢ)
Multiply each possible value xᵢ by its probability, then sum all such products. The result, μ (mu), is the long-run average.
VARIANCE (DEFINITION FORM)
Var(X) = σ² = ∑ (xᵢ − μ)² · P(X = xᵢ)
For each value, compute its squared deviation from the mean, multiply by its probability, and sum. This gives the average squared distance from the mean — the variance σ².
VARIANCE (SHORTCUT FORM)
Var(X) = E(X²) − [E(X)]²
An equivalent and often faster formula. First compute E(X²) = ∑ xᵢ² · P(X = xᵢ), then subtract the square of the mean. This form is provided in the IB formula booklet.
STANDARD DEVIATION
σ = √Var(X)
The standard deviation is simply the square root of the variance, returning the measure of spread to the same units as X.
📘 IB Formula Booklet
On the IB exam you are given the formulas E(X) = ∑ x · P(X = x) and Var(X) = E(X²) − [E(X)]². You do not need to memorize them, but you do need to know how to apply them correctly using a probability distribution table.

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

Complete probability distribution with calculation columns
xP(X = x)x · P(X = x)x² · P(X = x)
00.100.0000.00
10.300.3010.30
20.350.7041.40
30.200.6091.80
40.050.20160.80
Totals1.001.804.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.

A step-by-step flowchart showing the process for computing expected value and variance from a probability distribution table. Follow the arrows from listing values (Step 1) through to computing σ (Step 6).

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

Spinner prize distribution
x (dollars)P(X = x)
00.40
20.30
50.20
100.10
Finding E(X), Var(X), and σ
1
Step 1 — Verify the DistributionCheck that the probabilities sum to 1: 0.40 + 0.30 + 0.20 + 0.10 = 1.00. ✓ Each probability is between 0 and 1. ✓ This is a valid probability distribution.
∑P = 1.00 ✓
2
Step 2 — Calculate E(X)E(X) = ∑ x · P(X = x) = (0)(0.40) + (2)(0.30) + (5)(0.20) + (10)(0.10) = 0 + 0.60 + 1.00 + 1.00 = 2.60.
E(X) = $2.60
3
Step 3 — Calculate E(X²)E(X²) = ∑ x² · P(X = x) = (0²)(0.40) + (2²)(0.30) + (5²)(0.20) + (10²)(0.10) = 0 + (4)(0.30) + (25)(0.20) + (100)(0.10) = 0 + 1.20 + 5.00 + 10.00 = 16.20.
E(X²) = 16.20
4
Step 4 — Apply the Variance FormulaVar(X) = E(X²) − [E(X)]² = 16.20 − (2.60)² = 16.20 − 6.76 = 9.44.
Var(X) = 9.44
5
Step 5 — Find the Standard Deviationσ = √Var(X) = √9.44 ≈ 3.07. On average, a player's prize deviates from the mean of $2.60 by about $3.07, which indicates fairly high variability relative to the mean.
σ ≈ $3.07

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.

Key properties of E(X) and Var(X) alongside common student errors
Property / RuleFormulaCommon Mistake
Probabilities sum to 1∑ P(X = xᵢ) = 1Forgetting to use this to find a missing probability before proceeding
E(X) need not be a possible value of XRounding E(X) to the nearest integer because 'it should be a real outcome'
Linear transformation of E(X)E(aX + b) = aE(X) + bApplying 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σ² ≥ 0Getting a negative variance (usually a calculation error — recheck your work)
KEY TAKEAWAY
The linear transformation rules are like converting currencies. If you earn X dollars and the exchange rate is a euros per dollar with a fixed fee of b euros, your average earning in euros is aE(X) + b. But the spread of your earnings changes only by the scaling factor — the fixed fee doesn't make your earnings more or less variable.

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.

How SL 4.5 concepts extend to later topics
What You Know Now (SL 4.5)Where It Leads
General discrete distributions with tablesBinomial distribution (SL 4.7) — a specific formula for counting successes in repeated trials
E(X) as a weighted averageContinuous distributions where E(X) becomes an integral (HL)
Var(X) as a measure of spreadNormal distribution (SL 4.9) where μ and σ fully define the bell curve
Checking if a distribution is validChi-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

PROBLEM 1CONCEPTUAL
A fair six-sided die is rolled. The random variable X represents the number showing on the top face. Without calculating, explain why E(X) = 3.5 even though 3.5 is not a possible outcome of the die roll.
PROBLEM 2BASIC CALCULATION
A discrete random variable X has the following distribution: P(X = 1) = 0.25, P(X = 3) = 0.35, P(X = 5) = 0.25, P(X = 7) = 0.15. Calculate E(X) and Var(X).
PROBLEM 3INTERMEDIATE
The random variable X has the probability distribution shown: P(X = 0) = k, P(X = 1) = 0.3, P(X = 2) = 0.2, P(X = 3) = 2k. Find the value of k, then calculate E(X) and the standard deviation of X.
PROBLEM 4APPLIED
A carnival game costs $4 to play. The random variable W represents the amount won (before subtracting the cost) with distribution: P(W = 0) = 0.50, P(W = 3) = 0.30, P(W = 10) = 0.15, P(W = 20) = 0.05. Let Y = W − 4 represent the net profit. Find E(Y) and interpret your answer. Should you play this game?
PROBLEM 5CRITICAL THINKING
Two discrete random variables, A and B, both have E(A) = E(B) = 5. Variable A has Var(A) = 0.5, while Var(B) = 12. Describe, with reasoning, a real-world context where you would prefer A over B, and another context where you would prefer B over A.

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.

Varsity Tutors • IB Mathematics: Analysis and Approaches • Discrete Random Variables — SL 4.5