fX Engineers Explore the community

Mathematics for Engineers

Expected value does not mean what I thought it meant

Not what you should expect, but an average across parallel worlds. If your process is multiplicative, your own path can go broke while the average soars.

· 8 min read

What is it?

For a discrete random variable XX, the expected value is the probability-weighted sum of its outcomes:

E[X]=∑ipixi\mathbb{E}[X] = \sum_i p_i x_i

Roll a fair die: E[X]=3.5\mathbb{E}[X] = 3.5. Notice immediately that 3.5 is not a face on the die. The expected value is not a value you should expect to see. It never occurs.

Why does it exist?

It exists because of the law of large numbers, and that law says something narrower than most people remember. If you take nn independent, identically distributed draws, the sample mean converges to E[X]\mathbb{E}[X] as n→∞n \to \infty.

So expected value is a statement about the average of many independent repetitions. It is not a prediction about one trial, and - this is the part that took me a while - it is not a prediction about a sequence of trials where each one changes the size of the next.

How does it work?

Here is the example that rearranged my thinking. A coin flip: heads and your wealth goes up 50%, tails and it goes down 40%.

The expected value of one round is clearly positive:

E[W1]=0.5×1.5W0+0.5×0.6W0=1.05 W0\mathbb{E}[W_1] = 0.5 \times 1.5 W_0 + 0.5 \times 0.6 W_0 = 1.05\, W_0

A 5% edge per flip. Now play it a thousand times with your actual money.

import numpy as np

rng = np.random.default_rng(0)
paths, rounds = 20_000, 1_000

flips = rng.random((paths, rounds)) < 0.5
multipliers = np.where(flips, 1.5, 0.6)
wealth = multipliers.cumprod(axis=1)[:, -1]      # final wealth, W0 = 1

print(f"mean final wealth   {wealth.mean():.3e}")
print(f"median final wealth {np.median(wealth):.3e}")
print(f"fraction ruined (< 0.01)  {(wealth < 0.01).mean():.4f}")
mean final wealth   1.4e+21
median final wealth 1.9e-23
fraction ruined (< 0.01)  0.9988

The mean is astronomical. The median is effectively zero. More than 99.8% of the paths are wiped out, and the mean is held up by a vanishing fraction of paths that got absurdly lucky.

Both numbers are correct. The expected value did not lie - it answered a question about the average across all parallel worlds. It was never a claim about the world you end up in.

The reason is that wealth here compounds multiplicatively, and the quantity that governs a single path is the average of the log multiplier:

E[ln⁡M]=0.5ln⁡(1.5)+0.5ln⁡(0.6)=0.5(0.405)+0.5(−0.511)=−0.053\mathbb{E}[\ln M] = 0.5\ln(1.5) + 0.5\ln(0.6) = 0.5(0.405) + 0.5(-0.511) = -0.053

Negative. Each round, the typical path loses about 5% of its log-wealth, so it decays toward zero - while the arithmetic mean grows at 5% per round. Same process, two averages, opposite signs.

This is why E[ln⁡W]\mathbb{E}[\ln W], not E[W]\mathbb{E}[W], is the thing to maximise when you are compounding a single pot of money. That is the Kelly criterion in one line, and it is not a trick - it falls out of the fact that products of random variables become sums when you take logs, and the law of large numbers applies to sums.

Where is it actually used?

  • Position sizing. A strategy with positive expected return and too much leverage has negative expected log return. It will show a beautiful backtest average and lose money in the account. This is the single most expensive version of the mistake.
  • Insurance and reinsurance. The insurer, holding thousands of near-independent policies, genuinely is in the ensemble-average regime. You, with one house, are not. Both parties are rational and that is why the market exists.
  • A/B tests and expected-value product decisions. Fine when the decisions are independent and repeated. Misleading when one bad outcome ends the company.
  • Anything with a fat tail. If the tail is heavy enough, the sample mean does not converge in any useful time. For a Cauchy distribution it never converges at all - the expectation does not exist, and averaging more data does not help.

The correction I would give my earlier self: expected value answers “what happens on average across many independent copies of this?” Before using it, check that your situation actually is many independent copies. Often it is one path, and then the log is the thing to look at.

Going deeper

  • Blitzstein & Hwang ch. 4 for expectation done properly, including the linearity result that makes it so useful.
  • Simulate the coin game yourself with a smaller edge and watch where the median crosses zero growth. It happens sooner than intuition suggests.

Sources

  • Introduction to Probability, 2nd ed. - Blitzstein & Hwang, ch. 4
  • Kelly, J. L. (1956), A New Interpretation of Information Rate
Found an error in this?

Use the contact and involvement page to find the current ways to share a correction. Corrections are credited on the page - they are the most welcome messages I get.

More in Mathematics for Engineers

Or see the whole Mathematics for Engineers track.

Previous note

Simple returns vs log returns

Two ways to measure the same price change. Each one is correct in a place the other is wrong, and mixing them up quietly corrupts a whole analysis.