MPE StudioMath of Planet Earth
Statistical Toolkit · 01

Random Variables

Turning randomness into measurable quantities

A random variable is a rule that turns the outcome of a random experiment into a number we can analyze.

random outcomeω ∈ Ω
→
random variableX
→
numerical valueX(ω)

The essential idea: randomness happens in the outcome space; the random variable gives us something numerical to measure.

Watch the concept

One Concept · One Example

Random Variables and Probability Measures video thumbnail▶

Random Variables and Probability Measures: Discrete and Continuous Cases

Presented by Charlotte Moser

Watch on YouTube ↗

What to notice

The idea in 30 seconds

Two ways probability can be organized

Discrete random variables

A discrete random variable takes values from a finite or countable set.

pX(x)=P(X=x)

Flip a coin five times and let X be the number of heads. Then X ∈ {0,1,2,3,4,5}.

Continuous random variables

A continuous random variable takes values over a continuum and is described by a density pX(x).

pX(x)≥0and∫−∞∞pX(x)dx=1

Probability is area: P(a ≤ X ≤ b) is the integral of the density over [a,b].

Density is not probability. For a continuous variable, P(X = x) = 0.

Explore 01

From outcomes to numbers

Flip a fair coin five times. The complete sequence is the outcome ω. Our random variable X keeps only one piece of information: how many heads occurred?

The random experiment

HTTHH
ω = (H, T, T, H, H)→X(ω) = 3

Five flips produced 3 heads, so X = 3.

Different outcomes can map to the same value of X. For example, H · H · T · T · H and T · H · H · H · T both map to 3.

Build the PMF

0.000X=0
0.000X=1
0.000X=2
0.000X=3
0.000X=4
0.000X=5

Run repeated experiments to build an empirical histogram.

A PMF assigns a probability to each possible value of a discrete random variable.

What changes when the possible values are continuous?

We can no longer assign positive probability to every individual value. Instead, probability is measured by area under a density curve.

Explore 02

Probability under a density curve

Let X represent the height of a randomly selected adult. We use a smooth illustrative bell-shaped distribution only to build mathematical intuition.

130210 cmdensity pX(170) = 0.040

Illustrative probability density, not empirical population data. Drag either blue boundary; hover over the curve to inspect density.

Same idea, two kinds of distributions

Discrete

P(X = x) is represented directly by the height of a PMF bar.

bars → PMF

Continuous

P(a ≤ X ≤ b) is represented by area under a PDF.

smooth curve + shaded area → PDF
KEY TAKEAWAY

Random variables turn random outcomes into numbers. Discrete random variables are described by probability mass functions; continuous random variables are described by probability density functions.

random experimentoutcome ω
→
mappingX(ω)
→
resultdistribution