probability-distributions-and-random-variables
Chapter 3 swaps the language of events-as-sets for random variables, which are functions that turn outcomes into numbers. Once outcomes are numbers you can do arithmetic on them, and a distribution is the object that records how probability is spread across those numbers.
Why Numbers Beat Sets
Up to Chapter 2 an event is a set of outcomes, and the only tools are set operations: union, intersection, complement. That is limiting. You can intersect "it rains" with "I carry an umbrella", but you cannot add two events, or XOR them, or double one. There is no arithmetic on sets of outcomes.
A random variable fixes this by mapping each outcome to a number:
Now the outcomes are numbers, so , , and all mean something, and each is itself a new random variable. That is the real reason random variables exist: they let you build new quantities out of old ones.
A random variable adds no randomness of its own. The randomness lives in the underlying experiment, the sample space . The variable relabels those outcomes as numbers, and in doing so it induces a new distribution on the numbers. Same randomness, new bookkeeping.
The simplest kind is an indicator random variable, which is 1 when some event happens and 0 otherwise. It answers a yes/no question as a number, and adding up indicators is how you count events.
The PMF: a Random Variable's Fingerprint
A discrete random variable, one whose range is finite or countable, is fully described by its probability mass function:
Read as the probability of the event , all the outcomes the variable sends to . The PMF lists, for each value the variable can take, how much probability lands there.
Two conditions make a function a valid PMF. It is nonnegative, for every , since probabilities cannot go below zero. And it sums to 1 over the support, , since the variable takes some value with certainty.
The PMF is what people mean by "the distribution of a discrete random variable". Hand me the PMF and I know everything probabilistic about .
The Named Distributions
Four distributions do most of the work in this chapter. Two are worth knowing cold.
Bernoulli: one trial
is a single trial with two outcomes, success and failure. It is the indicator of success:
The failure probability turns up so often it gets its own letter, . That is the whole distribution. Every yes/no experiment with success chance is a Bernoulli.
Binomial: n independent trials
counts the successes in independent Bernoulli trials, all sharing the same :
The story reads straight off the formula. The factor is the chance of one particular sequence with successes, and counts how many such sequences there are.
When the factor is the same for every , so the shape is carried entirely by . That makes symmetric, peaking in the middle and tapering to the edges.
That peak is the same shape as a random walk's position and a two-dice sum, and why it peaks is worth its own note: random-walk-is-binomial.
Discrete Uniform and Hypergeometric, in brief
spreads probability evenly over a finite set , so for each . It is the "no reason to prefer any value" baseline.
is the number of white items in a sample of drawn without replacement from a jar of white and black. You pull items in total, a mix of both colours, and counts how many of them are white:
The numerator reads straight off that story: pick which of the white items landed in the sample, , and which of the black ones filled the rest, , over all ways to draw the sample.
The one thing to hold onto is the contrast with Binomial. Binomial is sampling with replacement, so the draws are independent and never moves. Hypergeometric is sampling without replacement, so each draw changes the composition of the jar and the draws are dependent. Reach for Binomial when the pool is effectively infinite, Hypergeometric when it is a fixed finite pool. Mixing them up is an easy slip: a "count the successes" problem is only Binomial if the trials are actually independent.
A clean way to picture the Hypergeometric is that every item carries two tags, its type (white or black) and its status (sampled or not). The count sits in the white-and-sampled cell.
Swapping which tag you call "type" and which you call "sample" gives a distribution that reads differently but comes out equal. Why that symmetry holds is one I have parked in probability-open-questions.
The CDF: One Descriptor for Everything
The cumulative distribution function accumulates the PMF from the left:
Its value at is the total probability at or below . The CDF is the universal descriptor because it is defined for every random variable, discrete or continuous, while the PMF only makes sense for discrete ones. It always climbs from 0 to 1 and never decreases.
For a discrete variable the two hold the same information. The CDF is the running sum of the PMF, and the PMF is recovered as the size of each jump in the CDF, the jump at being exactly .
Building New Random Variables
Because a random variable is a function on , any function of it, , is again a function on , so it is another random variable. , , and are all random variables in their own right.
This gives a handy technique for a variable whose distribution you do not recognize: express it as a one-to-one function of a variable you do know. A one-to-one relabels the values without merging any of them, so each new value inherits the probability of the old one it came from. That is the trick behind the random walk, whose position is a one-to-one relabelling of a Binomial count, worked in random-walk-is-binomial.
Two Category Errors to Avoid
Blitzstein calls these "sympathetic magic": treating a random variable as if it were its distribution, or as if it were a plain number.
Same PMF does not mean same variable Let be the indicator of heads on one fair toss, and let . Both are , so they have the identical PMF. They are still not the same random variable: on every outcome they disagree, since is 1 exactly when is 0. The PMF is a summary of a variable, not the variable itself.
The second slip is doubling. To get the PMF of you cannot double the PMF of . The values double, the probabilities do not. equals , since the probability stays with its outcome and only the label moves. Doubling the probabilities instead would not even leave them summing to 1.
What's Still Shaky
Three threads from this chapter I have not closed, parked in probability-open-questions: the Hypergeometric tag symmetry above, why the binomial coefficients across a row sum to , and whether as random variables forces them to map the underlying experiment identically. The deep dive on the peaked-distribution family lives in random-walk-is-binomial.