Expected value: what a risky choice is worth on average
On this page
Expected value runs quietly through finance and machine learning. A trading strategy, a betting system, a learner choosing an action: all of them are judged by what they return on average, over many tries, not by what happened once. This post explains expected value with a casino bet, a day in the market and a loan, then shows why the average alone is not enough.
It builds on the probability post.
The idea
Plain meaning: if you could live the same risky situation thousands of times, expected value is the average result you would end up with.
How to compute it: list every possible outcome, multiply each one by its probability, and add them up. Bishop and Bishop write it as (equation 2.38); in the notation of this post:
the expected valueprobabilitieswhat you lose if it happenswhat you gain
| Symbol | Meaning |
|---|---|
| the uncertain quantity, for example the result of one bet | |
| one possible outcome, for example | |
| the probability of that outcome | |
| add up over every possible outcome | |
| the expected value of (read “E of X”) |
Example 1: a $1 bet on red
An American roulette wheel has 38 pockets: 18 red, 18 black, 2 green. Bet $1 on red. You win $1 with probability 18/38 and lose $1 otherwise:
| Outcome | Result | Probability | |
|---|---|---|---|
| Red | 18/38 = 0.4737 | +$0.4737 | |
| Black or green | 20/38 = 0.5263 | −$0.5263 | |
| Total | 1.00 | −$0.0526 |
No single bet costs 5.26 cents. Each one wins a dollar or loses a dollar. But on average, each dollar bet on red costs you 5.26 cents, and the two green pockets are the whole reason. Play 1,000 bets in a night and you should expect to be down about . The casino runs on exactly this number; it doesn’t need to win any particular spin, only to repeat.
Example 2: a day holding SPY
The same arithmetic on the market. Over 2019 to 2023 (the data from the probability post), 54.9% of SPY’s days were up and the average up day gained 0.858%; the other 45.1% were down and the average down day lost 0.897%:
A positive edge of about seven hundredths of a percent per day: $6.64 on $10,000, or about $1,670 over a 252-day year if you held throughout. (It is also simply the plain average of all the daily returns, which is why the next post can call it “the mean”.) The down days are individually bigger than the up days; the market comes out ahead only because there are more up days. That’s a thin edge, and it needs many repeats to show.
Example 3: expected loss on a loan
Banks use the same idea to price credit risk. The expected loss on a loan is usually written as three numbers multiplied together:
| Term | Name | Plain meaning |
|---|---|---|
| PD | probability of default | the chance the borrower stops paying, usually within a year |
| LGD | loss given default | the share of the money you lose if they do (after collateral and recovery) |
| EAD | exposure at default | how much is owed at that moment |
A $1,000,000 loan with a 2% chance of default and 45% loss if it defaults:
It’s the same formula as before, written for one outcome. The loan either defaults (lose $450,000, probability 2%) or it doesn’t (lose $0, probability 98%):
That $9,000 is a cost of doing business. The interest rate has to cover it, plus the bank’s funding cost and a margin, or the loan loses money on average.
Why the average works: many repeats
Expected value only becomes “real” when you repeat the situation many times. This is called the law of large numbers: the more independent repeats, the closer the average result gets to the expected value. Bishop and Bishop’s Deep Learning: Foundations and Concepts writes the same idea as equation 2.40: the plain average of many samples estimates the expected value,
and the estimate becomes exact as grows.
On the left, I simulated the roulette bet spin by spin and tracked the average result per bet. After 10 spins the average was : five wins, five losses, no sign of the house edge. Someone looking only at those 10 spins might think the game was fair. After 5,000 spins the average is , close to the expected −$0.053, and still moving towards it.
Why the average isn’t enough
Now take a night of 1,000 bets. The expected result is , so a loss of about $53. I simulated 20,000 nights:
- The average night lost , very close to the expected value.
- But in 5% of nights the loss was more than .
- The worst night lost , almost four times the average.
- And of nights ended with a profit, which is why people keep playing.
That’s the right-hand chart. Expected value tells you the centre. It says nothing about the spread. Two choices can have exactly the same expected value and feel completely different:
| Option | Outcomes | Expected value |
|---|---|---|
| A | $10,000 for sure | $10,000 |
| B | $0 or $20,000, 50/50 | $10,000 |
Same expected value. Very different risk. Measuring that spread is the job of the standard deviation, which is the next post in this series.
One more honest note: the roulette spins really are independent, which is why the simulation behaves so neatly. Market days and loan defaults are not. In a crisis, many borrowers struggle at the same time and many stocks fall together. That makes bad years much worse than an independent model suggests, and it is why banks hold capital for the “unexpected” part of the loss on top of pricing the expected part.
A trader’s example: the biased coin
Romero and Balch’s What Hedge Funds Really Do (chapter 9) uses expected value to explain where a hedge fund’s edge comes from. Bet $1 on a coin flip that you win with probability : you gain $1 or lose $1, so
A fair coin () is worth nothing on average. The roulette bet is a coin with , worth , the house’s edge. A coin with a tiny edge in your favour, , is worth 2 cents per dollar per flip. That’s small for one flip, and it’s why skilled traders try to make many independent bets: the expected values add up (the next property) while luck partly cancels out. The SPY day above is a coin with and uneven payouts.
A useful property: expected values add up
The expected value of a total is the total of the expected values:
This works even when and are linked, which makes it very handy. The expected result of a night is the sum of the expected results of its bets, and the expected loss of a loan book is the sum of the expected losses of its loans. (That’s not true for the risk: for spread, links between the parts matter a lot. More on that in the correlation post.)
The code
import numpy as np
import pandas as pd
# Expected value of a $1 bet on red, from a table of outcomes
results = np.array([1, -1])
probs = np.array([18 / 38, 20 / 38])
print((results * probs).sum()) # -0.0526
# A day holding SPY, from five years of daily returns
r = pd.read_csv("prices.csv", index_col="date", parse_dates=True)["SPY"].pct_change().dropna()
up = r > 0
print(up.mean() * r[up].mean() + (1 - up.mean()) * r[~up].mean()) # 0.00066, equal to r.mean()
# Expected loss on a loan
PD, LGD, EAD = 0.02, 0.45, 1_000_000
print(PD * LGD * EAD) # 9000.0
# Simulate 1,000 bets a night for 20,000 nights
rng = np.random.default_rng(1)
nights = np.where(rng.random((20_000, 1000)) < 18 / 38, 1, -1).sum(axis=1)
print(nights.mean(), np.percentile(nights, 5)) # about -52, -104
Summary
- Expected value = sum of (outcome × probability). The long-run average.
- A bet on red is worth −5.26 cents per dollar; a day in SPY was worth +0.066%.
- In credit, EL = PD × LGD × EAD.
- It becomes real only over many repeats (law of large numbers).
- It says nothing about the spread. Two options with the same expected value can carry very different risk.
- Expected values add up, even for linked things. Risk doesn’t.
Next
Mean and standard deviation: how to measure the centre and the spread of real data, like a stock’s daily returns, and why the spread grows with the square root of time.
References
- Christopher M. Bishop and Hugh Bishop, Deep Learning: Foundations and Concepts (Springer, 2024), chapter 2, section 2.2: expectation (equation 2.38) and its sample-average estimate (2.40)
- Philip J. Romero and Tucker Balch, What Hedge Funds Really Do: An Introduction to Portfolio Management (Business Expert Press, 2014), chapter 9: the expected value of a biased coin
- Basel Committee on Banking Supervision, An Explanatory Note on the Basel II IRB Risk Weight Functions (2005), for PD, LGD and EAD as the inputs to credit risk