Ⅵ Counting, Probability & Statistics · Stage 33 — Probability · 33.6 Random Variables & DistributionsAll lessons →
Stage 33 · Probability

Random Variables and Distribution Tables

Pin a number on every outcome, and the whole experiment fits in one little table whose column probabilities must add up to exactly 1.

Ages 14–18 · Reasoning, one step at a time
The same trial, two languages: on the left the outcomes of rolling two dice; on the right, the number X = their sum, and how its probability is spread across the values 2…12. The heights come from counting equally-likely cells, and they sum to 1.

Roll two dice and you don't really care which faces came up — you care about the total. Score a free-throw contest and you care about the number made, not the slow-motion arc of each ball. In case after case the natural thing to record is a single number attached to the outcome. That number, which jumps around at random from trial to trial, is a random variable, written X. Once you list every value X can take and how likely each one is, you have a distribution table — the random variable's full menu — and that menu obeys one strict rule: every probability is at least 0, and they add to exactly 1.

33.6.1 A random variable pins a number on each outcome

Stage 33.1 packed every outcome of a trial into the sample space Ω. A random variable is just a rule that reads each outcome in Ω and reports back a number. Toss a coin three times: the outcome is something like HTH, but if all you write down is "number of heads," you have turned that raw outcome into the value 2. Different outcomes can map to the same number — HTH, HHT and THH all give X = 2 — and that is exactly the point: the variable bundles outcomes by the feature you care about.

Key idea

A discrete random variable X is a rule assigning a real number to each outcome of a random trial, where the possible values form a list you can write out: x₁, x₂, x₃, … Before the trial you can't predict which value appears — only how likely each is.

"Sum of two dice" takes the values 2, 3, …, 12. "Number of defective parts in a box of 5" takes 0, 1, 2, 3, 4, 5. "Net winnings on a \$1 bet" might take just −1 and +9. The values can be spaced unevenly and can be negative — all that matters is that they form a discrete list.

Example — naming the values

A bag holds 2 red and 3 white marbles; draw 2 without looking and let X = the number of red marbles drawn. Which numbers can X be? You can draw 0 red (both white), 1 red, or 2 red. So the value list is {0, 1, 2}. We don't yet know how likely each is — that's the next section — but we already know the menu of values.

Conclusion: a random variable first answers "what numbers are possible?" — the value list — before it answers "how likely is each?"

33.6.2 Building X from a trial: two dice, summed

Take the cleanest example. Roll a red die and a blue die; all 36 ordered pairs are equally likely (Stage 33.2). Let X = red + blue. Sweep the 6×6 grid, write each cell's sum in the cell, and count how many cells give each total. There is exactly one way to make a 2 (1+1) but six ways to make a 7 (1+6, 2+5, …, 6+1) — so 7 is the most likely total, and the counts climb to a peak at 7 then fall away symmetrically.

Because every cell is equally likely, the probability of each sum is just favorable cells over 36 — a classical probability, counted by the grid, never guessed from the picture:

P(X = 7) = 636 = 1/6,   P(X = 2) = 136,   P(X = 12) = 136.

Try it Pick a total and see where it lives
Dial a target sum k. The grid lights the cells where red + blue = k; the bar chart highlights that bar. The probability is the count of lit cells over 36.
target sum k 7

Lay all eleven probabilities side by side and you have drawn the distribution of X. Notice two things at once: no bar dips below zero, and the eleven heights — 1+2+3+4+5+6+5+4+3+2+1 over 36 — add to 36/36 = 1. That is not a coincidence; it is forced.

Why they must sum to 1

The events "X = 2", "X = 3", …, "X = 12" are mutually exclusive and together cover all of Ω — every roll produces exactly one total. So their probabilities add to P(Ω) = 1. Conclusion: the distribution of any random variable always sums to 1, because the values partition the sample space.

33.6.3 The distribution table — the variable's menu

Writing eleven sentences "P(X = 2) = 1/36, …" is clumsy. Collapse them into a two-row distribution table: the top row lists the values xᵢ, the bottom row lists their probabilities pᵢ = P(X = xᵢ). This little grid is the random variable — it tells you everything probability can know about X.

Distribution of X = number of red marbles in 2 draws from {2 red, 3 white}
x012sum
P(X = x)3/106/101/101

Read it like a menu: value 0 carries probability 3/10, value 1 carries 6/10, value 2 carries 1/10, and the row totals to 10/10 = 1. (Each entry is a classical probability: P(X=0)=C(3,2)/C(5,2)=3/10, P(X=1)=C(2,1)C(3,1)/C(5,2)=6/10, P(X=2)=C(2,2)/C(5,2)=1/10.) A picture says it faster — draw each value as a stem (a lollipop) whose height is its probability.

This is where the rule earns its keep: if a table is missing one probability, you don't need to redo the experiment. The bottom row must total 1, so the missing entry is forced — it is whatever makes the row add to 1.

Try it Find the missing probability
Three of the four probabilities are fixed. Dial the fourth, p₃, until the row sums to exactly 1 — the readout tells you the running total and whether it is legal.
missing p₃ (×0.05) 0.40
Example — solving for a missing p

A table gives P(X=1)=0.1, P(X=2)=0.3, P(X=3)=p, P(X=4)=0.2. Find p.

The row must total 1: 0.1 + 0.3 + p + 0.2 = 1, so p = 1 − 0.6 = 0.4. Check it's legal: 0 ≤ 0.4 ≤ 1. ✔

Conclusion: Σpᵢ = 1 turns "one probability is missing" into a one-line equation.

33.6.4 The two laws every distribution obeys

Every legal distribution table passes two tests, and only two:

The distribution laws

(1) Non-negativity: every probability satisfies pᵢ ≥ 0. A probability can never be negative — and never larger than 1.

(2) Total one: the probabilities add to exactly one, p₁ + p₂ + ⋯ + pₙ = 1 — not 0.99, not 1.1.

These two laws are the gatekeepers. Any table that breaks either one is not a distribution at all. They also let you check your own work: after computing a distribution, always glance at the row — does it sum to 1, and is every entry between 0 and 1? If not, there's an arithmetic slip somewhere.

Watch out — the trap that bites here

A probability cannot be negative and cannot exceed 1: a row reading 0.4, 0.5, −0.1, 0.2 is illegal even though it sums to 1, because of the −0.1. And a row that sums to 0.9 or 1.1 is illegal even if every entry looks innocent — you've lost or invented probability. Both laws must hold: each pᵢ ∈ [0, 1] and Σpᵢ = exactly 1.

33.6.5 A preview: number of heads in three flips

Here's a distribution you'll meet again under a famous name. Flip a fair coin three times and let X = the number of heads. The values are 0, 1, 2, 3. By the equally-likely model there are 2³ = 8 outcomes (HHH, HHT, …, TTT), and the number of ways to get exactly k heads is the count C(3, k) from Stage 32. So the probability of k heads is

P(X = k) = C(3, k)8 = C(3, k)·(½)³.

That formula — a count C(n, k) times a power of the success probability — is exactly the binomial probability B(n, p) coming in full in Stage 33.8. For now, drive it with a slider of trials and watch the same symmetric shape we saw with the dice.

Try it The number-of-heads distribution
Dial the number of flips n. Each stem's height is C(n, k)·(½)ⁿ, computed by the binomial helper; the heights always sum to 1.
flips n 3
Example — reading the 3-flip table

For three flips: P(X=0)=1/8, P(X=1)=3/8, P(X=2)=3/8, P(X=3)=1/8. Want "at least 2 heads"? That's the event X ≥ 2, so add the matching cells: 3/8 + 1/8 = 4/8 = 1/2. And as a sanity check, the whole row sums to 1/8+3/8+3/8+1/8 = 8/8 = 1. ✔

Conclusion: once you have the distribution table, the probability of any event built from X is just a sum of the right columns.

What to carry forward

The random-variable toolkit
IdeaIn one line
Random variable Xa rule turning each outcome into a number; values form a list x₁, x₂, …
Distribution tabletop row values xᵢ, bottom row pᵢ = P(X = xᵢ) — the variable's full menu
Law 1 — non-negativeevery pᵢ ≥ 0 (and ≤ 1); no negative or over-1 probabilities
Law 2 — total oneΣpᵢ = 1 exactly; use it to find a missing probability
Event from XP(X ∈ S) = add up the columns whose value is in S
Heads in n flipsP(X = k) = C(n, k)(½)ⁿ — a first taste of the binomial B(n, ½)

Next stop, Stage 33.7: squeeze the whole table down to two numbers — where X lands on average (the expectation E(X)=Σxᵢpᵢ) and how much it swings (the variance).

Exercises

  1. A fair die is rolled once and X is the number showing. Write the distribution table of X, and check that the probabilities sum to 1.
    Show answer
    Each face is equally likely, so P(X = k) = 1/6 for k = 1, 2, 3, 4, 5, 6. The table has top row 1…6 and bottom row 1/6 six times. Sum: 6 × (1/6) = 1. ✔
  2. A distribution table reads P(X=0)=0.2, P(X=1)=0.5, P(X=2)=a. Find a, then state P(X ≥ 1).
    Show answer
    The row must total 1: 0.2 + 0.5 + a = 1, so a = 0.3 (legal, since 0 ≤ 0.3 ≤ 1). Then P(X ≥ 1) = P(X=1) + P(X=2) = 0.5 + 0.3 = 0.8. (Or use the complement: 1 − 0.2 = 0.8.)
  3. Someone writes the "distribution" P(X=1)=0.5, P(X=2)=0.6, P(X=3)=−0.1. Give two reasons it is not a legal distribution.
    Show answer
    (1) The entry P(X=3) = −0.1 is negative — probabilities must be ≥ 0. (2) The three numbers sum to 0.5 + 0.6 − 0.1 = 1.0 only by cancelling an illegal negative; ignoring that, the two genuine probabilities 0.5 and 0.6 already exceed 1. Either way it fails the laws: every pᵢ must be in [0, 1] and the row must total 1 honestly.
  4. Two coins are tossed; X = number of heads. Build the distribution table from the equally-likely outcomes, and find P(X = 1).
    Show answer
    The four equally-likely outcomes are HH, HT, TH, TT. So P(X=0) = 1/4 (TT), P(X=1) = 2/4 = 1/2 (HT, TH), P(X=2) = 1/4 (HH). Row sum: 1/4 + 1/2 + 1/4 = 1. ✔ In particular P(X = 1) = 1/2. (This is C(2,1)(½)² = 2/4.)
  5. For two dice, let X = the sum. Using the 6×6 grid, find P(X = 5) and P(X ≤ 4).
    Show answer
    Ways to make 5: (1,4),(2,3),(3,2),(4,1) — 4 cells, so P(X = 5) = 4/36 = 1/9. For X ≤ 4 add the counts for 2, 3, 4: 1 + 2 + 3 = 6 cells, so P(X ≤ 4) = 6/36 = 1/6.
  6. In three coin flips, X = number of heads with distribution 1/8, 3/8, 3/8, 1/8 for X = 0, 1, 2, 3. Find P(X is odd).
    Show answer
    The odd values are X = 1 and X = 3, so add those columns: P(X = 1) + P(X = 3) = 3/8 + 1/8 = 4/8 = 1/2. (By symmetry, "odd number of heads" and "even number of heads" each carry probability 1/2.)

🎯 Quick check

Six questions to lock it in. Tap the answer you think is right.

§ For teachers and parents

This lesson defines a discrete random variable and its probability distribution, drawn as a two-row table and as bars/stems, and establishes the two laws every distribution obeys: each probability lies in [0, 1] and the probabilities sum to exactly 1 (used here to recover a missing probability). It aligns with CCSS HSS-MD.A.1 — define a random variable for a quantity of interest by assigning a numerical value to each event and graph the corresponding probability distribution — and HSS-MD.A.4 — develop a probability distribution and find expected probabilities. Every probability shown is computed from the counting and binomial helpers (favorable/total, C(n, k)(½)ⁿ), never read off a picture, so the figures only display honest numbers. Stage 33.7 next compresses each distribution into its expectation and variance.

eastmath.com · Stage 33 · 33.6 Random Variables & Distributions · Reasoning, one step at a time