Quant GT
Browse all lessons
Section 4 · Lesson 4.1

What is a Random Variable?

A function that maps outcomes to numbers we can do math with.

A random variable XX is a function from the sample space Ω\Omega to the real numbers. It assigns a numerical value to each outcome of an experiment, turning raw outcomes into something we can sum, average, and analyze.

A concrete example: flip three coins. The sample space has 88 equally likely strings (HHH, HHT, HTH, …). Define XX to be the number of heads. Then XX takes values in {0,1,2,3}\{0, 1, 2, 3\} with probabilities

P(X=0)=18,P(X=1)=38,P(X=2)=38,P(X=3)=18P(X = 0) = \tfrac{1}{8}, \quad P(X = 1) = \tfrac{3}{8}, \quad P(X = 2) = \tfrac{3}{8}, \quad P(X = 3) = \tfrac{1}{8}

Probability theory is much easier to do on numbers than on raw outcomes. Random variables let us compute expectations, variances, correlations, and apply the full machinery of calculus and linear algebra to uncertain quantities. In quant finance, the daily return of a stock, the number of trades in a session, and the loss of a portfolio are all random variables.