Expected values
A finite expectation is the sum of each value multiplied by its probability.
On this page 7 sections
01Weight by how often a value occurs#
An expectation is the average specified by a probability model. A possible value contributes in proportion to its probability. The model supplies the weights; the number of distinct outcomes does not.
Suppose is with probability and with probability . In an imagined collection that follows those proportions exactly, three quarters contribute zero and one quarter contribute four. The average contribution is .
Multiply each value by its probability, then add:
The index runs over the possible values. Every probability is nonnegative, and the complete set sums to one.
PMF: , . Find .
Show answer and explanation
Weighted sum: + = .
02Keep values and weights separate#
For values with probabilities , the contributions are . Their sum is . A negative value contributes negatively; its probability remains positive.
Averaging the three values equally would answer a different question. Equal weighting is justified only when their probabilities are equal. Repeated observations can be summarized by frequencies, provided those frequencies supply the weights.
A model assigns numerical rewards , , with respective probabilities 0.7, 0.3. Find the expected reward .
Show answer and explanation
Weighted sum: + = .
03A mean need not be an outcome#
When only and can occur, an expectation of does not predict that the next observation will be . It describes the model's weighted average. Keep the value even when it is fractional or absent from the set of outcomes.
PMF: , . A learner rounds the mean to a possible outcome. Find the unrounded .
Show answer and explanation
Weighted sum: + = . Keep this mean.
If represents a model's loss on a randomly drawn example, is its expected loss. For losses and occurring with probabilities and , expected loss is . The rare large loss contributes , as much as all the common small losses together.
Moving probability from a lower value to a higher value increases the mean by . This explains why changing the population weights can change expected performance without changing the loss values themselves.
Multiply by probabilities, preserve signs, and keep the weighted mean even when it cannot occur.
- Compute a finite random variable's expectation.
Sources & further reading
- [1]Pishro-Nik, Introduction to Probability: Expectation ↗www.probabilitycourse.com · Article
- [2]Dive into Deep Learning, §2.6 Probability and Statistics ↗d2l.ai · Article