From events to numbers
So far, we've worked with events: "roll a 6," "draw a red card," "test positive." But often we care about numbers that emerge from random experiments.
Questions like:
- How many flips until Heads?
- How many defective items in a batch?
- How long until the next earthquake?
These questions give numbers, not yes/no answers. This is where random variables enter the picture.
What is a random variable?
A random variable is a function that assigns a numerical value to each outcome in a sample space. We write for the probability that takes value .
Think of a random variable as a "measuring device" for random experiments. Instead of asking "did event A happen?", we ask "what number did we get?"
The probability mass function (PMF)
The PMF tells us the complete probability story of a discrete random variable: the probability of each possible value.
For a discrete random variable , the PMF is:
It satisfies: for all , and .
Think of it as a bar chart of probabilities. Each bar's height represents how likely that value is.
Each bar's height is the probability of that value. All bars sum to 1.
Example: flips until first heads
Let = number of flips until the first Heads.
The pattern continues:
- (Heads immediately)
- (Tails, then Heads)
- (Tails, Tails, Heads)
Each probability is half the previous one. This is the geometric distribution.
Explore how the geometric PMF shape changes with different success probabilities, or simulate trials to watch the empirical distribution converge:
Why this matters
Understanding PMFs lets us:
- Calculate probabilities of specific outcomes
- Find expected values (averages)
- Compare different random quantities
In the next lesson, we'll learn about the Cumulative Distribution Function (CDF), which answers questions like "What's the probability of getting at most 5?"
When you see a probability question about a random variable, the PMF gives you all the individual probabilities. It's the complete specification of the random variable's behavior.