QTQuant 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. Two examples:

The capital convention is to use XX for the random variable itself and lowercase xx for a specific realization. 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, each with its own probability:

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

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):

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

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 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 fat tails in A1-03), but the abstraction — that returns are draws from a distribution we can characterize — is the foundational move that 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)

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. The 5th percentile of daily returns is the value xx such that F(x)=0.05F(x) = 0.05. We'll use these constantly when we discuss Value-at-Risk and tail risk.

⧉ 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