Quant Terminal
A1-02A1·intro·~15 min

Random variables — returns are random variables

probabilityrandom-variablesreturns

▸ Pretest — guess, even if you don't know

Tomorrow's return on AAPL is best thought of as:

The abstraction: random variables

A random variable is a function that assigns a number to each outcome of a random process. In plain terms: it's a machine that turns "whatever ends up happening" into a number. Two examples:

The capital convention is to use XX for the random variable itself and lowercase xx for a specific realization — the actual value that came out once the dust settled. So:

This distinction matters: a strategy is built around the distribution of XX (many possible futures), not the value of any single xx.

Two flavors

Discrete

Takes one of countably many values — values you could list out one by one — each with its own probability:

P(X=xi)=pi,ipi=1P(X = x_i) = p_i, \quad \sum_i p_i = 1

In words: the probability that XX equals its i-th possible value xix_i is some number pip_i. And when you add up all the pip_i (that's the \sum, a for-loop over every possible value), you must get 1 — because something has to happen.

Example: in a hypothetical "up day or down day" model:

That's a complete distribution.

Continuous

Takes any value in an interval. The probability of any single point is zero (this surprises people the first time). Instead, probability is described by a density function f(x)f(x) — read "f of x." Picture it as a curve; its height at each value xx says how thickly probability is packed near that value:

P(aXb)=abf(x)dxP(a \le X \le b) = \int_a^b f(x)\,dx

In words: the probability that XX lands somewhere between aa and bb equals the area under the density curve between aa and bb. The stretched-S symbol \int is called an integral — it means "add up the area under the curve from aa to bb." Read the whole thing aloud as: "the probability that X is between a and b equals the integral from a to b of f of x, d x."

Concrete example: if the density of tomorrow's SPY return is tallest near 0, the area between −1% and +1% — that is, P(0.01X0.01)P(-0.01 \le X \le 0.01) — might be around 0.7. But the probability of any single exact value, like exactly 1.7%, is 0: a single point has no width, so it has no area.

For continuous random variables, we ask "what's the probability XX is between aa and bb" — not "what's the probability XX equals exactly 1.7%."

Daily stock returns are usually modeled as continuous.

Why daily returns are well-modeled this way

Daily log-returns of liquid US equities — liquid meaning heavily traded, so easy to buy and sell — tend to look approximately like draws from a distribution centered slightly above zero, with some width. The exact distribution isn't perfectly normal. We'll come back to that in A1-03, where you'll meet fat tails — extreme moves that happen far more often than the bell curve predicts. But the abstraction itself is the foundational move. Treating returns as draws from a distribution we can describe is what lets us build:

Without random variables, none of this exists.

The cumulative distribution function (CDF)

A useful object for any random variable is the CDF:

F(x)=P(Xx)F(x) = P(X \le x)

In words: F of x is the probability that the random variable comes out at or below the value xx. As xx slides from very low to very high, F(x)F(x) climbs from 0 up to 1.

For SPY daily returns: historically F(0.02)0.025F(-0.02) \approx 0.025, meaning "about 2.5% of days have returns at or below −2%." The CDF lets you read off any "what fraction of days have returns below X?" question directly.

A related concept: quantiles — cut points of a distribution. The 5th percentile of daily returns is the value xx such that F(x)=0.05F(x) = 0.05: the point below which 5% of days fall. We'll use these constantly when we discuss Value-at-Risk — a standard "how much could I lose on a bad day" risk number — and tail risk, the risk of rare, extreme outcomes.

⧉ Review card
What is a random variable?
A function assigning a number to each outcome of a random process. Capital X for the abstract variable; lowercase x for a specific realization.
⧉ Review card
What is P(X = x) for a continuous random variable?
Always zero. For continuous random variables, we talk about P(a ≤ X ≤ b), not point probabilities. Probability is described by a density function f(x).
⧉ Review card
What does the CDF F(x) = P(X ≤ x) tell you?
The fraction of outcomes at or below the value x. The CDF is the natural object for quantiles, VaR, and tail probabilities.

Explain it back

Without scrolling up, write 2–3 sentences explaining why we treat tomorrow's stock return as a random variable rather than just "an unknown number." Compare to the lesson when you're done.

◈ Calibration check

Could you explain to someone what 'random variable' means in your own words?

1 = guessing · 5 = could teach it

⏻ End of lesson

Mark it read to book its 3 review cards into your deck.

Sources & further reading