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.
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.
Discrete Random Variable (X)
Probability Distribution
Expected Value E(X)
Variance Var(X)
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.
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."
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.
| 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 |
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.
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.
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. |
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. |
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
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.