Skip to content
Science, DecodedContext Jamming

Rosetta Stone · 22 of 30

E\mathbb{E}

Expectation (expected value)

Operator: it does something

In plain English

The probability-weighted average. E[X]=∑xx p(x)\mathbb{E}[X] = \sum_x x\,p(x): every possible value, weighted by how likely it is, added up. A subscript says what is random: Ex∼p[f(x)]\mathbb{E}_{x \sim p}[f(x)] averages ff over samples drawn from pp. 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.5

Where the analogy bends: Exact for a known discrete distribution. With data, you estimate 𝔼 by averaging samples (Monte Carlo).

See it

123456E[X]
E[X]=∑xx P(x)\mathbb{E}[X] = \sum_x x\,P(x), a probability-weighted average and another Σ loop. Load the die toward 6 and watch the expectation move.

What it means, field by field

Mathematics

Expected value of a random variable; linearity: 𝔼[X+Y] = 𝔼[X] + 𝔼[Y].

Physics

Thermal averages ⟨E⟩; quantum expectation values ⟨ψ|Ĥ|ψ⟩ (angle-bracket notation).

AI / ML

Loss objectives 𝔼_{(x,y)∼D}[ℓ]; expected reward in RL; the mean of a sampled estimate.

Biology

Expected offspring number (fitness); expected heterozygosity.

In a research paper

Maximum-likelihood / cross-entropy training objective for generative models, including language models.
L(θ)=Ex∼D[−log⁡pθ(x)]\mathcal{L}(\theta) = \mathbb{E}_{x \sim \mathcal{D}}\left[-\log p_\theta(x)\right]

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.

Connected symbols

Where it appears on this site