Random Variables
A random variable assigns numbers to uncertain outcomes, like a trade's profit. Learn discrete and continuous variables, expectation and variance, with examples.
A random variable is a way of describing an uncertain quantity with numbers. Tomorrow's return on a stock, the profit from your next trade and the number of trades that win this month are all random variables: you do not know their values in advance, but you can describe the range of possible values and how likely each is. Random variables are the building blocks of statistics, risk models and option pricing.
Discrete and continuous random variables#
| Type | Takes values | Examples | Described by |
|---|---|---|---|
| Discrete | Countable values | Number of winning trades in 10; whether a prediction market resolves yes (1) or no (0) | Probability mass function |
| Continuous | Any value in a range | Daily return; time until a price level is hit | Probability density function |
Describing a random variable#
| Measure | Meaning | Lesson |
|---|---|---|
| Expected value (mean) | The long run average value | Expected Value |
| Variance and standard deviation | How spread out the values are | Variance and Standard Deviation |
| Skewness | Whether outcomes lean to one side | Skewness and Kurtosis |
| Kurtosis | How heavy the tails are | Skewness and Kurtosis |
| Distribution | The full set of probabilities | Probability Distributions Explained |
A discrete example#
Expectation and variance rules#
For random variables X and Y and constants a and b:
E[aX + b] = a × E[X] + b
Var(aX + b) = a² × Var(X)
E[X + Y] = E[X] + E[Y]
Var(X + Y) = Var(X) + Var(Y) + 2 × Cov(X, Y)
The last rule shows why correlation matters for portfolio risk: if two positions are positively correlated, their combined variance is larger than the sum of their separate variances. See Covariance and Correlation and Diversification.
Sums of independent trades#
If you take n independent trades with the same distribution:
E[total] = n × E[X]
SD[total] = √n × SD[X]
Expected profit grows with n, but the standard deviation grows only with √n. That is why a positive edge becomes more reliable over many trades. In the example, 100 trades have an expected total of $2,400 and a standard deviation of about $1,370. See Law of Large Numbers.
Continuous returns#
Daily returns are usually modelled as continuous random variables. A common simple model treats them as normally distributed, though real returns have fatter tails. Prices are often modelled with a lognormal distribution because prices cannot go below zero. See Normal Distribution, Lognormal Distribution and Fat Tails.
Why this matters for traders#
- Risk: standard deviation and tail measures describe how much you can lose.
- Sizing: knowing the variance of trade outcomes helps set position sizes. See Position Sizing.
- Pricing: option prices are expected values of random payoffs. See Black-Scholes Model.
- Simulation: Monte Carlo methods generate random variables to test strategies. See Monte Carlo Simulation.
Bernoulli variables and prediction markets#
A Bernoulli random variable takes the value 1 with probability p and 0 otherwise. A prediction market share that pays $1 if an event happens is exactly this: its expected value is p dollars and its variance is p × (1 minus p). Variance is highest at p = 0.5, which is why coin flip markets swing the most, and lowest near 0 or 1. See Binomial and Bernoulli Distributions.
Frequently asked questions#
What is a random variable?#
A variable whose value depends on the outcome of a random process, such as the return of a stock tomorrow or the profit of a trade.
What is the difference between discrete and continuous random variables?#
Discrete random variables take countable values, like the number of winning trades; continuous ones can take any value in a range, like a return.
Why do random variables matter in trading?#
They let traders describe uncertain outcomes with measures like expected value and standard deviation, which underpin risk management, sizing and pricing.
Next, learn the measures of a typical value in Mean, Median and Mode.
3 quick questions on this lesson. Get them all right to finish it.
Turn on JavaScript to take the quiz.
Mentioned in
- Bayes' TheoremMath and Statistics
- Calculus for TradersMath and Statistics