Rosetta Stone · 22 of 30
Expectation (expected value)
Operator: it does something
In plain English
The probability-weighted average. : every possible value, weighted by how likely it is, added up. A subscript says what is random: averages over samples drawn from . Nearly every ML training objective is an expectation over the data, which training estimates with averages over mini-batches.
As code
// a fair die: E[X] = Σ x · p(x)
const outcomes = [1, 2, 3, 4, 5, 6];
const E = outcomes.reduce((acc, x) => acc + x * (1 / 6), 0); // 3.5Where the analogy bends: Exact for a known discrete distribution. With data, you estimate 𝔼 by averaging samples (Monte Carlo).
See it
What it means, field by field
Expected value of a random variable; linearity: 𝔼[X+Y] = 𝔼[X] + 𝔼[Y].
Thermal averages ⟨E⟩; quantum expectation values ⟨ψ|Ĥ|ψ⟩ (angle-bracket notation).
Loss objectives 𝔼_{(x,y)∼D}[ℓ]; expected reward in RL; the mean of a sampled estimate.
Expected offspring number (fitness); expected heterozygosity.
In a research paper
On average over the training data, how surprised the model is by what actually occurs.
Common misreadings
Assuming the expected value is a value you expect to see. A fair die never rolls 3.5.
Ignoring the subscript. 𝔼 over which distribution is the whole question.