# 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.

Source: https://learn.tradelabsai.com/math/random-variables/  
Track: Math and Statistics · Level: Intermediate · Updated: 2026-10-03  
Publisher: TradeLabs AI (https://tradelabsai.com). Education, not financial advice.  
Cite as: TradeLabs Learn, "Random Variables", https://learn.tradelabsai.com/math/random-variables/

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](https://learn.tradelabsai.com/math/expected-value/) |
| Variance and standard deviation | How spread out the values are | [Variance and Standard Deviation](https://learn.tradelabsai.com/math/variance-and-standard-deviation/) |
| Skewness | Whether outcomes lean to one side | [Skewness and Kurtosis](https://learn.tradelabsai.com/math/skewness-and-kurtosis/) |
| Kurtosis | How heavy the tails are | [Skewness and Kurtosis](https://learn.tradelabsai.com/math/skewness-and-kurtosis/) |
| Distribution | The full set of probabilities | [Probability Distributions Explained](https://learn.tradelabsai.com/math/probability-distributions/) |

## A discrete example

**Example: The profit from one trade**
A trade has three possible outcomes:

| Outcome | Profit (X) | Probability |
|---|---|---|
| Stop hit | minus $100 | 0.50 |
| Small win | +$80 | 0.30 |
| Target hit | +$250 | 0.20 |

Expected value: E[X] = minus 50 + 24 + 50 = +$24.
Variance: E[(X minus 24)²] = 0.50 × 124² + 0.30 × 56² + 0.20 × 226² = 7,688 + 940.8 + 10,215.2 = 18,844.
Standard deviation: √18,844 ≈ $137.

The trade has a positive average, but individual results swing widely around it.

## 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](https://learn.tradelabsai.com/math/covariance-and-correlation/) and [Diversification](https://learn.tradelabsai.com/portfolio/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](https://learn.tradelabsai.com/math/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](https://learn.tradelabsai.com/math/normal-distribution/), [Lognormal Distribution](https://learn.tradelabsai.com/math/lognormal-distribution/) and [Fat Tails](https://learn.tradelabsai.com/math/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](https://learn.tradelabsai.com/risk/position-sizing/).
- **Pricing:** option prices are expected values of random payoffs. See [Black-Scholes Model](https://learn.tradelabsai.com/options/black-scholes-model/).
- **Simulation:** Monte Carlo methods generate random variables to test strategies. See [Monte Carlo Simulation](https://learn.tradelabsai.com/research/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](https://learn.tradelabsai.com/math/binomial-distribution/).

## 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](https://learn.tradelabsai.com/math/mean-median-and-mode/).

## Continue learning

- Next lesson: [Mean, Median and Mode](https://learn.tradelabsai.com/math/mean-median-and-mode/)
- Previous lesson: [Bayes' Theorem](https://learn.tradelabsai.com/math/bayes-theorem/)
- Related: [Bayes' Theorem](https://learn.tradelabsai.com/math/bayes-theorem/): Bayes' theorem shows how to update a probability when new evidence arrives. Learn the formula, trading and prediction market examples, and base rate errors.
- Related: [Probability Distributions Explained](https://learn.tradelabsai.com/math/probability-distributions/): Probability distributions describe the range and likelihood of outcomes. Learn the main ones used in trading, their shapes and when each applies.
- Related: [Expected Value](https://learn.tradelabsai.com/math/expected-value/): Expected value is the average result of a bet over many repetitions. Learn the formula, trading and prediction market examples, and why EV alone is not enough.
- Related: [Variance and Standard Deviation](https://learn.tradelabsai.com/math/variance-and-standard-deviation/): Variance and standard deviation measure how spread out values are. Learn the formulas, sample vs population, annualising volatility and their role in trading risk.
- Related: [Normal Distribution](https://learn.tradelabsai.com/math/normal-distribution/): The normal distribution is the bell curve behind many financial models. Learn its properties, the 68 95 99.7 rule, where traders use it and why markets break it.
- Related: [Covariance and Correlation](https://learn.tradelabsai.com/math/covariance-and-correlation/): Covariance and correlation measure how two assets move together. Learn the formulas, how to read them, why correlations change in crises and their portfolio role.
