foundations of probability
Expected Value
You should know: random variables
Overview
In probability theory, the expected value (also called the expectation, mean, or first moment) is a generalization of the weighted average. It summarizes a random variable's distribution with a single number: the long-run average value you'd observe if you repeated the underlying random experiment infinitely many times. Unlike a simple average, the expected value weights each possible outcome by its probability, not by equal weight.
Intuition
If a random variable takes several possible values, each with its own probability, the expected value asks: 'if I repeated this experiment a huge number of times and averaged all the results, what number would I converge to?' Rolling a fair six-sided die repeatedly and averaging the results converges to 3.5 — not because 3.5 is ever actually rolled, but because it's the probability-weighted center of mass of {1,2,3,4,5,6}. Expectation is exactly a center of mass: each outcome xᵢ is a point with 'mass' pᵢ, and E[X] is where the whole distribution balances.
Interactive Graph
Formal Definition
For a discrete random variable X taking values x₁, x₂, ..., xₖ with probabilities p₁, ..., pₖ (summing to 1), the expected value is the probability-weighted sum of its possible values. For a continuous random variable with density f(x), the sum becomes an integral.
Weighted average of outcomes, weighted by their probabilities
The probabilities must sum to 1
The continuous analog, integrating over the probability density
Expected value of a fair six-sided die roll
Notation
| Notation | Meaning |
|---|---|
| The expected value of random variable XAlso written: μ, ⟨X⟩ | |
| The variance of X — the expected squared deviation from the mean | |
| The expected value of a function of X (law of the unconscious statistician) |
Properties
Linearity
Condition: always holds, even if X and Y are dependent
Constant
Condition: for a constant c
Product for independent variables
Condition: if X and Y are independent
Variance formula
Applications
Worked Examples
Apply the discrete expectation formula.
Answer: E[X] = $0.50 — the game favors the player by 50 cents on average.
Practice Problems
A fair six-sided die is rolled. Find E[X] where X is the value shown.
A lottery ticket costs $2. It pays $1000 with probability 1/2000, and $0 otherwise. Is the expected net profit positive or negative, and by how much?
An insurer charges a $300 annual premium. There is a 1% chance of a $20,000 claim in a year (otherwise no claim). What is the insurer's expected profit per policy?
A contractor's expected material cost is $40k and expected labor cost is $25k. Using linearity of expectation, what is the expected total cost — and does it require the costs to be independent?
Common Mistakes
Assuming E[X] must be a value X can actually take.
The expected value is a weighted average, not a possible outcome. E[X]=3.5 for a fair die even though a die never shows 3.5 — it's the long-run average, not a single realization.
Assuming E[XY] = E[X]E[Y] always holds.
This only holds when X and Y are independent. If they're dependent, E[XY] generally differs from E[X]E[Y] by their covariance: E[XY] = E[X]E[Y] + Cov(X,Y).
Quiz
Summary
- The expected value E[X] is the probability-weighted average of a random variable's possible values.
- For discrete X: E[X] = Σ xᵢpᵢ. For continuous X: E[X] = ∫ x f(x) dx.
- Linearity of expectation, E[aX+bY] = aE[X]+bE[Y], holds unconditionally, even when X and Y are dependent.
- Variance, Var(X) = E[(X−μ)²] = E[X²] − (E[X])², measures spread around the expected value.
- Expectation underlies fair-game analysis, expected utility theory, and loss functions in machine learning.
References
- WebsiteWikipedia — Expected value
Mathematics