Expected value: what a risky choice is worth on average

finance stats

On this page
  1. The idea
  2. Example 1: a $1 bet on red
  3. Example 2: a day holding SPY
  4. Example 3: expected loss on a loan
  5. Why the average works: many repeats
  6. Why the average isn’t enough
  7. A trader’s example: the biased coin
  8. A useful property: expected values add up
  9. The code
  10. Summary
  11. Next
  12. References

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 E[f]=∑xp(x)f(x)\key{E[f]} = \sum_x \risk{p(x)} f(x) (equation 2.38); in the notation of this post:

the expected valueprobabilitieswhat you lose if it happenswhat you gain

E[X]=∑ixi P(xi)\key{E[X]} = \sum_{i} x_i \, \risk{P(x_i)}
SymbolMeaning
XXthe uncertain quantity, for example the result of one bet
xix_ione possible outcome, for example −$1\bad{-\usd 1}
P(xi)\risk{P(x_i)}the probability of that outcome
∑i\sum_iadd up over every possible outcome
E[X]\key{E[X]}the expected value of XX (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:

OutcomeResult xix_iProbability P(xi)\risk{P(x_i)}xi×P(xi)x_i \times \risk{P(x_i)}
Red+$1\good{+\usd 1}18/38 = 0.4737+$0.4737
Black or green−$1\bad{-\usd 1}20/38 = 0.5263−$0.5263
Total1.00−$0.0526
E[bet]=(+1)×0.4737+(−1)×0.5263=−$0.0526\begin{aligned} \key{E[\text{bet}]} &= (+1) \times 0.4737 + (-1) \times 0.5263 \\ &= \bad{-\usd 0.0526} \end{aligned}

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 $53\bad{\usd 53}. 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%:

E[day]=0.549×0.858%+0.451×(−0.897%)=+0.066%\begin{aligned} \key{E[\text{day}]} &= 0.549 \times \good{0.858\%} + 0.451 \times (\bad{-0.897\%}) \\ &= \key{+0.066\%} \end{aligned}

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:

EL=PD×LGD×EAD\key{\text{EL}} = \risk{\text{PD}} \times \bad{\text{LGD}} \times \bad{\text{EAD}}
TermNamePlain meaning
PDprobability of defaultthe chance the borrower stops paying, usually within a year
LGDloss given defaultthe share of the money you lose if they do (after collateral and recovery)
EADexposure at defaulthow much is owed at that moment

A $1,000,000 loan with a 2% chance of default and 45% loss if it defaults:

EL=0.02×0.45×1,000,000=$9,000\key{\text{EL}} = 0.02 \times 0.45 \times 1{,}000{,}000 = \usd 9{,}000

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

E[loss]=450,000×0.02+0×0.98=$9,000\key{E[\text{loss}]} = 450{,}000 \times 0.02 + 0 \times 0.98 = \usd 9{,}000

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,

E[f]≃1N∑n=1Nf(xn)\key{E[f]} \simeq \frac{1}{N} \sum_{n=1}^{N} f(x_n)

and the estimate becomes exact as NN grows.

2026-10-15T18:29:06.269794 image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 1 0 0 1 0 1 1 0 2 1 0 3 Number of $1 bets on red so far (log scale) −0.4 −0.3 −0.2 −0.1 0.0 0.1 0.2 0.3 0.4 Average result per bet so far ($) expected value −$0.053 per bet 1. One run of 5,000 bets: the average settles on −5.26 cents −200 −150 −100 −50 0 50 Result of one night of 1,000 bets ($) 0 200 400 600 800 1000 1200 1400 Number of simulated nights (of 20,000) expected −$53 2. 20,000 nights: a single night can land far from the expected −$53

On the left, I simulated the roulette bet spin by spin and tracked the average result per bet. After 10 spins the average was $0.00\good{\usd 0.00}: 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 −$0.040\bad{-\usd 0.040}, 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 1,000×(−0.0526)=−52.61{,}000 \times (-0.0526) = -52.6, so a loss of about $53. I simulated 20,000 nights:

  • The average night lost $52.4\bad{\usd 52.4}, very close to the expected value.
  • But in 5% of nights the loss was more than $104\bad{\usd 104}.
  • The worst night lost $202\bad{\usd 202}, almost four times the average.
  • And 4.7%\good{4.7\%} 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:

OptionOutcomesExpected 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 pp: you gain $1 or lose $1, so

E[flip]=p×(+1)+(1−p)×(−1)=2p−1\key{E[\text{flip}]} = p \times (+1) + (1 - p) \times (-1) = 2p - 1

A fair coin (p=0.5p = 0.5) is worth nothing on average. The roulette bet is a coin with p=0.4737p = 0.4737, worth 2×0.4737−1=−0.05262 \times 0.4737 - 1 = -0.0526, the house’s edge. A coin with a tiny edge in your favour, p=0.51p = 0.51, 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 p=0.549p = 0.549 and uneven payouts.

A useful property: expected values add up

The expected value of a total is the total of the expected values:

E[X+Y]=E[X]+E[Y]E[X + Y] = \key{E[X]} + \key{E[Y]}

This works even when XX and YY 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