Skip to content

ProbabilityLesson 2 of 6

Attach a number, get a distribution

Random variables, PMFs, and PDFs

Toss 3 fair coins, each toss independent of the others, and let XX = the number of heads — a rule that attaches a number to each outcome. That rule is a random variable. It is a numerical measurement of an outcome: HTT reads 1, HHT reads 2. The randomness is in which outcome occurs; X just reports.

Because the tosses are fair and independent, the bag Ω holds 8 equally likely outcomes:

HHH, HHT, HTH, THH, HTT, THT, TTH, TTT

A statement about X gets its probability the only way it can — from the outcomes behind it. Pr(X=2)\Pr(X = 2) is, by definition, the probability of the outcomes where the measurement reads 2:

value of XXoutcomes that give itprobability
0TTT1/8
1HTT, THT, TTH3/8
2HHT, HTH, THH3/8
3HHH1/8

The measurement has moved all the probability onto the number line. We can now answer questions about X directly from its distribution, without listing the underlying coin sequences each time.

The table gives the distribution of XX: each possible value and its probability. For a discrete random variable, these probabilities are described by a probability mass function, or PMF:

pX(x)=Pr(X=x)p_X(x) = \Pr(X = x)

The subscript XX names the variable; the input xx is the value you ask about. So pX(2)=3/8p_X(2) = 3/8. The entries sum to 1/8+3/8+3/8+1/8=11/8 + 3/8 + 3/8 + 1/8 = 1: the table slices the whole bag by value, and nothing is left out. Everything you’d want to know about XX — like the average — is computed straight from this table.

Now draw a number uniformly from the interval [1,1][-1, 1] — all the numbers from −1 to 1, every spot equally likely. What is Pr(X=0.5)\Pr(X = 0.5)? Zero — not tiny, zero. Under a uniform draw every point would have to carry the same mass. If that mass were positive, choosing sufficiently many distinct points would exceed total probability 1. Therefore each point has mass zero. Infinitely many possible values alone is not enough for this conclusion: an infinite discrete distribution can give positive probability to individual values. A table would be all zeros and say nothing.

Individual points have probability zero in this model, but intervals can have positive probability. For a variable with a density, we calculate those probabilities as areas. For example, Pr(0X1/2)\Pr(0\le X\le1/2) asks how much probability lies between 0 and 1/21/2, with \le meaning “less than or equal to.”

The probability density function, or PDF, is written fX(x)f_X(x). For this uniform distribution, the density is constant across [1,1][-1,1]:

fX(x)={1/21x1,0otherwise.f_X(x)=\begin{cases}1/2&-1\le x\le1,\\0&\text{otherwise.}\end{cases}

Probability is area under the density. With a flat density, areas are just rectangles:

Pr(0X1/2)=width×height=1212=14\Pr(0\le X\le1/2)=\text{width}\times\text{height}=\frac12\cdot\frac12=\frac14

The total area is width × height = 2 × 1/2 = 1 — always 1, the same whole-bag rule the table obeyed. And a density can be taller than 1: a uniform draw from [0,1/10][0, 1/10] has density 10, because 1/10 × 10 = 1. A density of 10 means probability accumulates at a rate of 10 per unit of length on that interval. An interval of width 0.020.02 therefore has probability 10×0.02=0.210\times0.02=0.2. The density is a height; the probability is an area.

One total of probability, tracked two ways: amount per pile, which dies — and amount ÷ width, which survives.

Piled probability gets a table; smeared probability gets a height that isn’t itself a probability. One running total covers both — and its slope is the density.

Definition

Read the full glossary entry →