A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so
you know where to look back.
In Québec, an insurer may consider age alongside factors such as driving history, vehicle, location, and how the vehicle is used. The Autorité des marchés financiers describes age as one input among several — not a promise that everyone’s premium drops on a particular birthday. Behind that individualized price is a distribution of possible claim costs: the insurer estimates what many similar policies will cost over time even though any one driver’s result is uncertain.
The concept at work is expected value — the long-run average outcome of a random process, weighted by how likely each outcome is. Insurance companies, casinos, investment funds, and pharmaceutical companies all make decisions by computing expected values. When a drug company evaluates whether to run a clinical trial, expected value is one input to that decision. When a casino sets slot-machine payouts, it sets the player’s expected net winnings below zero.
By the end of this lesson, you will be able to:
Distinguish between discrete and continuous random variables and interpret the notation ,.
Construct a probability mass function (PMF) and verify its validity.
Compute the expected value and interpret it as a long-run average.
Compute the variance and standard deviation using the shortcut formula.
This lesson introduces random variables — functions that attach numbers to random outcomes — and the mathematical tools for describing their behaviour: expected value and variance. In L-PR-1, you assigned probabilities to events; here, you attach a numerical value to every outcome, organize all of those probabilities into a distribution, and summarize the distribution as a whole. That is the bridge from probability rules to statistical models.
Section 2: Prerequisites
▾
A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so
you know where to look back.
Sample space (from L-PR-1): The set of all possible outcomes of a random experiment. You need this to list every value a random variable can take.
Classical probability (from L-PR-1): for equally likely outcomes. Today we generalize: outcomes can have unequal probabilities, so we use a table instead of counting.
Probability axioms (from L-PR-1): for any event , and for the full sample space. The same axioms apply to every row and to the column total in a PMF table.
Complement rule (from L-PR-1):. You will use the equivalent idea that the sum of all PMF probabilities must equal 1 to find a missing value.
Weighted average (arithmetic): Multiplying each value by its “weight” and summing. Expected value is exactly a weighted average — weights are probabilities.
One diagnostic before you begin:
Checkpoint: If , what is ?
Success Factor:
Bridging old and new: In L-PR-1, you computed probabilities for individual events. Today, you will organize all outcomes into a table (the PMF) and compute a single number — — that summarizes the entire distribution. A key shift: probabilities in a PMF need not be equal, and need not equal any specific outcome in the table.
Section 3: Core Concepts
▾
A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so
you know where to look back.
Six concepts — here is how they build on each other:
C1 — Random Variables: What kind of quantity are we studying?
C2 — PMF: How do we record all the probabilities in one place?
C3 — Expected Value: What is the long-run average outcome?
C4 — E(X²): An intermediate quantity needed for variance.
C5 — Variance and SD: How spread out are the outcomes?
C6 — CDF: How do we answer “at most” and “at least” questions?
C1 — Random Variables
When you roll a die, you don’t know in advance which face will appear. But the outcome is always a number — 1, 2, 3, 4, 5, or 6. A random variable is a rule that assigns a number to each outcome of a random experiment.
We write to mean a random variable, and (lowercase) to mean one specific value it can take.
Random Variable
A random variable is a function that assigns a real number to each outcome in the sample space of a random experiment.
A discrete random variable takes a countable set of values (e.g., 0, 1, 2, 3, …).
A continuous random variable takes any value in an interval (e.g., any height between 150 cm and 200 cm).
Examples:
Number of customers who enter a store in one hour → discrete (0, 1, 2, 3, …)
Height of a randomly chosen student → continuous (any value in an interval)
Number of defective items in a batch of 20 → discrete (0, 1, 2, …, 20)
Time until the next earthquake → continuous (any non-negative real number)
Figure 1. Dots mark isolated values that can be listed; the continuous band includes every point from 150 to 200. Shape as well as colour distinguishes the two variable types.
“Discrete” does not mean “small.” The number of grains of sand on a beach is countable (even if enormous) — in principle it is discrete. The distinction is whether the variable can take any value in an interval (continuous) or only isolated, countable values (discrete).
C2 — Probability Mass Function (PMF)
A PMF is simply a table (or formula) that lists every value that can take, along with the probability of each. Think of it as the complete “probability recipe” for your random variable.
Probability Mass Function (PMF)
The probability mass function of a discrete random variable assigns a probability to each possible value:
A function is a valid PMF if and only if both conditions hold.
Figure 2. Constructing a PMF means mapping every sample-space outcome to a numerical value, then combining outcomes with the same value. Here HT and TH both produce , so their probabilities add to 0.50.
Example: = number of heads in two fair coin flips.
0
1
2
0.25
0.50
0.25
Check: ✓. All probabilities ✓.
A PMF does not require each probability to equal . Outcomes can have unequal probabilities — that is the whole point of building a PMF rather than just counting.
x
1
2
3
4
P(X = x)
0.10
0.40
0.30
0.05
0.05
Total = 0.85 — not a valid PMF: missing 0.15.
Figure 3. Adjust the final probability until the total is exactly 1.00. The numerical total and validity message supplement the coloured bar, so correctness never depends on colour alone.
Three probabilities are fixed. Adjust until the total bar fills to exactly 1.00 — there is only one value that makes this a valid PMF.
Figure 4. The expected value 2.60 falls between 2 and 3, while the tallest bar—the mode—is at 2. The orange dashed line and its label identify the balance point without relying on colour alone.
C3 — Expected Value
The expected value answers: “If this random experiment were repeated an enormous number of times, what would the average outcome be?” It is a weighted mean where each outcome is weighted by its probability .
We write to emphasize that the expected value plays the same role as the population mean in descriptive statistics.
Expected Value
The expected value (mean) of a discrete random variable is:
This is the long-run average outcome across infinitely many repetitions of the experiment.
Mini-example: For the PMF in the chart above ( = 1, 2, 3, 4 with = 0.10, 0.40, 0.30, 0.20):
If you repeated this experiment millions of times and averaged all results, the average would approach 2.60.
E(X) —Mode(s) = —
10/100 = 0.10
40/100 = 0.40
30/100 = 0.30
20/100 = 0.20
Figure 5. The balance beam locates from all outcome–probability pairs. Presets show that the balance point can differ from the modal bar.
Try the three preset buttons. In the left-skewed preset, the mode is , but is pulled leftward by the lower-probability outcomes — the balance point is not the tallest bar. Skew is named for the direction of the tail.
E(X) is not the mode. The most likely outcome (mode) is in the example above (probability 0.40). But . The expected value is the balance point of the distribution — it accounts for how far each outcome is from the center, not just which has the highest probability. In fact, E(X) = 3.5 for a fair die, even though no face shows 3.5.
n = 0x̄ —last outcome: —
Run trials to watch the running average build up.
Figure 6. Repeated simulated outcomes make the running average wander at first and then stabilize near the labelled theoretical value .
“Expected value” means the long-run average. Run one trial: the average is that single whole-number outcome — nowhere near 2.60. Keep running trials and watch the running average wander, then settle onto the dashed E(X) line.
C4 — Computing
To compute variance, you first need a related quantity: . This is also a weighted average, but you square each outcome before weighting it.
We write to mean “the expected value of the squared random variable.”
Expected Value of X²
This is computed from the same PMF: square each value, multiply by its probability, and sum.
Continuing the example above:
. In the example, , but . These are equal only when is a constant (no randomness at all). Confusing these two quantities is one of the most common errors when computing variance — it would give , which is wrong.
Figure 7. Averaging first gives ; squaring each outcome before averaging gives . The numbered steps and unequal values distinguish the processes without relying on colour.
C5 — Variance and Standard Deviation
Variance measures how spread out the distribution is — how far a typical outcome is from the expected value. A small variance means most outcomes cluster near ; a large variance means outcomes are spread widely.
We write and .
Variance and Standard Deviation
The variance of a discrete random variable is computed with the shortcut formula:
The standard deviation is:
Both measure spread in the same units as (standard deviation) or squared units (variance). Variance is always .
Completing the example:
Interpretation: outcomes of typically deviate from the expected value of 2.60 by about 0.92 units.
Each square's side is the distance from μ, so its area is the squared deviation
(x − μ)². Darker squares carry more probability weight. Variance averages the areas using those
weights — outcomes far from μ contribute disproportionately because the distance is squared.
Figure 8. Each outcome’s squared distance from is weighted by its probability. Position, square size, and labels reveal each contribution in addition to colour.
What the formula measures: each outcome’s distance to is squared (the green squares — area = ) and weighted by its probability. Far outcomes contribute disproportionately because the distance is squared.
Figure 9. Both distributions are centred at , but the labelled standard-deviation bracket is narrower for the concentrated PMF and wider for the dispersed PMF. Width, bar positions, and values convey the comparison without relying on colour.
Variance is always . If you compute a negative variance, you made an arithmetic error. Since , it is an average of non-negative numbers and cannot be negative. A negative answer is a signal to recheck your arithmetic, not a valid result.
C6 — Cumulative Distribution Function (CDF)
The PMF answers “exactly equal to.” The CDF answers “less than or equal to” — it accumulates the probabilities as increases.
We write to denote the CDF evaluated at .
Cumulative Distribution Function (CDF)
The cumulative distribution function of a discrete random variable is:
The CDF gives the probability that takes a value at most.
To answer “at least ,” subtract all probability below :. In a finite PMF table, subtract the CDF at the last listed value below . If is integer-valued and is an integer, this becomes .
To answer “between and ”:.
CDF for our running example( = 1, 2, 3, 4):
1
0.10
0.10
2
0.40
0.50
3
0.30
0.80
4
0.20
1.00
..
Accumulate to:x < 1
x < 1x = 1x = 2x = 3x = 4
F(—) = 0.00P(X > —) = 1.00
Figure 10. Moving the control adds one PMF bar at a time and raises the labelled CDF staircase by that bar’s probability, making accumulation visible step by step.
Slide from x = 1 to x = 4 one step at a time. Each step highlights one new bar in the PMF and adds one jump to the staircase. is the height difference between two staircase levels.
Section 4: Worked Examples
▾
A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so
you know where to look back.
Example 1 — Verify a PMF
A game assigns payouts according to the table below. Verify that this is a valid PMF.
(payout $)
−2
0
3
5
0.20
0.50
0.20
0.10
Solution (fully narrated):
I notice this problem asks me to verify the PMF — that means checking the two conditions, not computing anything else yet.
Condition 1: All probabilities non-negative.
I scan the row: 0.20, 0.50, 0.20, 0.10. All are . ✓
Condition 2: Probabilities sum to 1.
Both conditions hold, so this is a valid PMF. I could stop here — the question only asks to verify, not to compute E(X). Resisting the urge to keep calculating is part of reading the question carefully.
Example 2 — Compute E(X) for a Payout Scenario
Using the same PMF from Example 1 (payouts −2, 0, 3, 5 with probabilities 0.20, 0.50, 0.20, 0.10), predict whether will be negative, zero, or positive. Then compute and interpret it in the context of repeated plays.
Pause and write. Record your answer and reasoning on paper or in your notes before continuing. Even if you are unsure, committing your thinking helps you see what you understood and what you need to revisit.
Show Solution
The expected payout is $0.70 per play. Even though you have a 50% chance of winning nothing and a 20% chance of losing $2, the possibility of winning $3 or $5 tips the average to $0.70 in your favor.
Interpretation: If you played this game 1000 times, you would expect to come out ahead by about 700$ in total.
Example 3 — Compute Var(X) Step by Step
Using the same PMF (payouts −2, 0, 3, 5 with probabilities 0.20, 0.50, 0.20, 0.10), compute ,, and . State what the standard deviation means for this game.
Pause and write. Record your answer and reasoning on paper or in your notes before continuing. Even if you are unsure, committing your thinking helps you see what you understood and what you need to revisit.
Show Solution
Step 1: We already know from Example 2.
Step 2: Compute .
Step 3: Apply the shortcut formula.
Step 4: Compute the standard deviation.
Interpretation: The standard deviation is about $2.15, so the distribution has substantial spread around its expected value of $0.70. That is a scale of variability, not a guarantee that most payouts fall within exactly $2.15 of the mean. The game is favourable in the long run but volatile from play to play.
Example 4 — Use the CDF (Find the Error)
A student is using the PMF from Examples 1–3. They want to find and write:
Student’s work:
CDF values: ,.
But wait — the student then says “so the answer is ,” and concludes that .
Identify every error in the student’s reasoning. Recompute and from the PMF, verify the interval probability, and explain whether the final equality is true only here or for every discrete distribution.
Pause and write. Record your answer and reasoning on paper or in your notes before continuing. Even if you are unsure, committing your thinking helps you see what you understood and what you need to revisit.
Show Solution
The student’s CDF levels are wrong because each level must include every outcome at or below its cutoff:
Using the corrected levels:
The student’s two incorrect CDF levels happened to differ by the correct amount. In this distribution, the only supported value in is , so is true for this interval and this PMF.
It is not a general rule. For example:
That interval includes both and , so its probability is not just .
The CDF formula accumulates all outcomes in the interval, not just the endpoint.
Section 5: Guided Practice
▾
A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so
you know where to look back.
Problem 1 — Classify a Random Variable (C1)
The number of phone calls a help-desk agent receives in a one-hour shift.
Is this random variable discrete or continuous? Explain your reasoning.
Choose the correct classification:
The height (in centimetres) of a randomly chosen student at your school.
Is this random variable discrete or continuous? Explain your reasoning.
Choose the correct classification:
The number of defective items in a quality-control sample of 50 products.
Is this random variable discrete or continuous? Explain your reasoning.
Choose the correct classification:
The time (in minutes) a customer waits in line at a coffee shop.
Is this random variable discrete or continuous? Explain your reasoning.
Choose the correct classification:
The number of siblings a randomly chosen person has.
Is this random variable discrete or continuous? Explain your reasoning.
Choose the correct classification:
Problem 2 — Test a PMF (C2)
Problem 3 — Find the Long-Run Average (C3)
Problem 4 — Measure Distribution Spread (C4 + C5)
Section 6: Independent Practice
▾
A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so
you know where to look back.
Problem 1 — Summarize a Distribution (C2 + C3 + C4 + C5)
Problem 2 — Read Cumulative Probability (C6)
Problem 3 — Evaluate a Game and Diagnose Reasoning (C3 + C5)
Problem 4 — Complete a PMF and Find Its Mean (C2 + C3)
Problem 5 — Compare Centre and Spread (C3 + C5)
Problem 6 — Synthesize a Full Distribution Analysis (C2 + C3 + C4 + C5 + C6)
Mixed Review — Retrieval from Earlier Lessons
These problems draw on concepts from earlier in the course. Attempting them without re-reading prior lessons is the point — retrieval practice strengthens long-term memory more than re-reading.
Review Problem 1 — Conditional probability from a table
Review Problem 2 — Combinations in a probability calculation
Section 7: Mastery Check
▾
A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so
you know where to look back.
Question 1 — Feynman Test
Explain, in your own words and without formulas, why the expected value need not be the most likely value of a random variable. Use one concrete example and identify both its expected value and its most likely outcome.
Pause and write. Record your answer and reasoning on paper or in your notes before continuing. Even if you are unsure, committing your thinking helps you see what you understood and what you need to revisit.
Compare with a model answer
Expected value is a probability-weighted average, so both the likelihood and size of every outcome affect it. The mode asks a different question: which single outcome has the greatest probability?
For a fair six-sided die, each face is equally likely, so every value from 1 through 6 is a mode. The expected value is
The mean lies between possible outcomes. It describes the long-run average of many rolls, not the result of one roll and not the height of the tallest PMF bar.
Question 2 — Apply Expected Value in a New Setting
Question 3 — Error Analysis
Self-Assessment
How confident do you feel about expected value and variance?
Still confusedReady for the Boss Fight
Section 8: Boss Fight
▾
A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so
you know where to look back.
Choose one context. Both paths require a justified decision, a complete numerical analysis, and a plain-language explanation. Work independently before opening the comparison model.
🎡 Carnival Decision
Decide whether a ring-toss game is a good deal for a player and support the recommendation quantitatively.
💡 Payout Design
Create a four-outcome payout scheme that meets strict centre and spread constraints, then defend the design.
🎡 Carnival Decision
A carnival game costs $5 to play. You throw one ring. The prizes and probabilities are:
Outcome
Prize
Probability
Red bottle
$20
0.05
Blue bottle
$10
0.15
Yellow bottle
$3
0.30
Miss
$0
0.50
Let be the player’s net winnings: prize minus the $5 fee.
Task 1. Represent all possible net outcomes and verify that the representation is valid.
Task 2. Decide whether the game is favourable, unfavourable, or fair for the player in the long run. Choose and show the calculation that supports the decision.
Task 3. Quantify how much one play can vary around its long-run average. Show the quantities you chose and round the final spread measure to two decimals.
Task 4. On paper or in your notes, answer a friend who says, “Missing is the most common result, so that fact alone proves this is a bad deal.” Give a two- or three-sentence recommendation that uses both centre and spread, and explain whether uncertainty changes the recommendation.
Pause and write. Record your answer and reasoning on paper or in your notes before continuing. Even if you are unsure, committing your thinking helps you see what you understood and what you need to revisit.
Compare with a complete model analysis
The net-outcome PMF is:
15
5
−2
−5
0.05
0.15
0.30
0.50
Every probability is non-negative, and
The long-run average is
The player therefore loses $1.60 per play on average, so the game is unfavourable.
For spread:
A strong response to the friend is: “The most common outcome is a $5 loss, but the recommendation should come from the entire distribution. The mean loss is $1.60 per play and the standard deviation is about $5.11, so individual plays are unpredictable, but that variability does not overturn the negative long-run average.”
Reflection feedback: If your recommendation used only the mode, add the weighted effect of every outcome. If it used only the mean, add what the standard deviation says about play-to-play uncertainty.
💡 Payout Design
Design a PMF for a payout scheme with exactly four distinct outcomes satisfying all of these constraints:
Every outcome is a positive integer number of dollars.
Every probability is positive, and the probabilities sum to 1.
The expected payout is $2.
The variance is at most 3.
Task 1. Choose four outcomes and probabilities. Explain the strategy behind your choices without assuming in advance that they work.
Task 2. Verify every support and probability constraint, then justify whether the centre requirement is met.
Task 3. Verify whether the spread requirement is met. If it is not, revise the design and recheck every constraint.
Task 4. On paper or in your notes, explain in two or three sentences what the centre and standard deviation of your final product mean to a customer. Avoid promising that a daily payout will be close to the mean.
Pause and write. Record your answer and reasoning on paper or in your notes before continuing. Even if you are unsure, committing your thinking helps you see what you understood and what you need to revisit.
Compare with one complete valid design
Many answers are possible. One valid design is:
1
2
3
4
0.35
0.40
0.15
0.10
The four outcomes are distinct positive integers. Every probability is positive, and
The expected payout is
For spread:
A customer-friendly explanation is: “Across many days, the average payout would approach $2 per day. The standard deviation of about $0.95 describes the distribution’s spread; it does not guarantee that a particular day will land within $0.95 of $2.”
Reflection feedback: If your design used 0 as an outcome, replace it because 0 is not positive. If your interpretation predicted where most individual payouts must fall, revise it to describe the long-run centre and spread without a mean-plus-or-minus-standard-deviation guarantee.
Section 9: Challenge Problems
▾
A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so
you know where to look back.
Ready for more? These go beyond the lesson objectives.
Challenge 1 — Derive the Shortcut Formula
The definition of variance is:
where . Starting from this definition, derive the shortcut formula by algebraic expansion.
Pause and write. Record your answer and reasoning on paper or in your notes before continuing. Even if you are unsure, committing your thinking helps you see what you understood and what you need to revisit.
Show Derivation
Starting idea: Expand as a polynomial, then use linearity of expectation.
Expand the square:
Apply linearity of expectation (, and for constant ):
Substitute :
Since :
This derivation also explains why always: since variance is defined as an expected value of a squared quantity , it can never be negative, which forces .
Bonus: What does mean? By definition, . Since always, this expectation equals zero only if with probability 1, meaning with probability 1. A random variable with is a constant — it always takes the same value.
Challenge 2 — Transform Centre and Spread
This regenerable challenge transfers the lesson to a transformed random variable. Solve each new scenario from the definitions and use the feedback to compare how a linear transformation changes centre and spread.
Section 10: Solutions Reference
▾
A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so
you know where to look back.