1. What is a Random Variable?
A random variable is a function that maps each outcome of a random experiment to a real number.
Example: Coin flip
X(Heads) = 1, X(Tails) = 0
Intuition: a random variable is "a number that depends on chance." We use capital letters (X, Y, Z) for random variables and lowercase (x, y, z) for the specific values they take.
2. Discrete vs Continuous
Discrete
Support is countable (finite or countably infinite). Example: number of heads in 10 flips, number of claims filed.
Continuous
Support is an interval (or union of intervals). Example: time until next claim, exact weight of a part.
Chapter 2 focuses entirely on discrete random variables. Continuous RVs are covered in Chapter 3.
3. Probability Mass Function (PMF)
The PMF of a discrete random variable X gives the probability that X takes each value in its support.
Definition
f(x) = P(X = x)
Properties:
1. f(x) > 0 for all x in the support
2. Σ f(x) = 1 (sum over all x in support)
3. P(X ∈ A) = Σ f(x) for x in A
4. Building a PMF from Scratch
Worked example: Roll two 4-sided dice. Let X = max of the two rolls.
Step 1: Find P(X = x) for x = 1, 2, 3, 4
P(X ≤ x) = P(both dice ≤ x) = (x/4)²
f(x) = P(X = x) = P(X ≤ x) - P(X ≤ x-1) = x²/16 - (x-1)²/16 = (2x - 1)/16
| x | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| f(x) | 1/16 | 3/16 | 5/16 | 7/16 |
Check: 1 + 3 + 5 + 7 = 16. Σf(x) = 16/16 = 1 ✓
5. Cumulative Distribution Function (CDF)
Definition
F(x) = P(X ≤ x) = Σ f(t), t ≤ x
For discrete RVs, the CDF is a staircase function — it jumps at each value in the support and is flat between jumps.
Going between PMF and CDF:
PMF → CDF: F(x) = Σ f(t) for t ≤ x
CDF → PMF: f(x) = F(x) - F(x⁻) (size of jump at x)
6. Discrete Uniform Distribution
PMF
f(x) = 1/m, x = 1, 2, …, m
Each outcome is equally likely. The canonical example is a fair die: m = 6, so f(x) = 1/6 for x = 1, 2, 3, 4, 5, 6.
Try building this in the PMF Explorer on the Simulate tab!
7. Hypergeometric Distribution
Models the number of successes when sampling without replacement from a finite population with two types of items.
PMF
f(x) = C(N₁, x) · C(N₂, n - x) / C(N, n)
N = total items, N₁ = success items, N₂ = N - N₁ = failure items
n = sample size, x = number of successes drawn
Example: Tagged fish
A pond has N = 50 fish, of which N₁ = 10 are tagged. You catch n = 7 fish without replacement. X = number of tagged fish caught. Then X follows a hypergeometric distribution.
Intuition: "sampling without replacement from two groups."