Resources
Expected value is not a value you expect
The expected value of a fair six-sided die is \(3.5\), and no roll can produce 3.5. That is not a problem with the definition. Expected value is a long-run average, not a prediction of the next outcome.
The definition
For a discrete random variable \(X\),
\[\mu_X = E(X) = \sum x_iP(X=x_i)\]Each possible value is weighted by its probability, and the result describes where the average of many independent repetitions will tend over the long run. It does not have to be one of the values the random variable can actually take.
Watch the average settle
Top: the probability distribution, with a dashed vertical at the expected value and short marks one standard deviation either side. Bottom: the running average of the outcomes drawn so far, against the number of trials, with the same expected value as a dashed target. The scale is logarithmic in the number of trials, because the interesting behavior is the settling and it happens over orders of magnitude. On three of the four presets the dashed vertical falls in the gap between two bars, so the running average converges to a number that no single trial can ever produce.
The upper panel shows the probability distribution, and the dashed vertical line marks the theoretical expected value. The lower panel shows the running average of simulated outcomes, and with more trials, the running average tends to move toward the theoretical mean.
For several presets, the expected value lies between possible outcomes. The running average can still converge to that value because an average is not itself required to be an observed outcome.
Examples
For a fair die, \(E(X) = \tfrac{1+2+3+4+5+6}{6} = 3.5\), and for the number of heads in five fair coin flips, \(E(X)=2.5\). Again, 2.5 heads is impossible in one repetition.
A raffle can have an expected value of $1.50 even if no ticket pays $1.50. The mean describes the probability distribution as a whole, and it does not identify the most likely outcome.
Standard deviation matters too
Expected value alone can hide substantial risk or variability. The standard deviation of a random variable describes the typical distance of outcomes from the mean over repeated trials, and a lottery may have a small positive expected value but a large standard deviation because almost every outcome is near zero and a very small fraction are extremely large.
Two random variables with the same expected value can therefore behave very differently. The mean describes location, and the standard deviation describes spread.
The binomial shortcuts
For a binomial random variable with \(n\) trials and success probability \(p\),
\[\mu_X=np \qquad\text{and}\qquad \sigma_X = \sqrt{np(1-p)}\]For example, if \(n=10\) and \(p=0.3\), then \(\mu_X=3\;\text{and}\;\sigma_X = \sqrt{2.1} \approx1.449\). These formulas are exact for a binomial distribution, and they are not approximations.
When a variable is binomial
A binomial random variable counts successes across a fixed number of trials. The usual conditions are:
- a fixed number of trials
- two possible outcomes on each trial
- a constant probability of success
- independence between trials
If the number of trials continues until the first success, the variable is not binomial because the number of trials is not fixed. Drawing without replacement from a small finite population can also violate the constant-probability and independence conditions. The formulas \(np\) and \(\sqrt{np(1-p)}\) should be used only after the binomial model is justified.
Long run does not mean smooth
A running average can move away from the expected value before moving back toward it, and this is especially visible for skewed distributions with rare large outcomes. The law of large numbers is a statement about long-run behavior, and it does not require the average to improve monotonically after every additional trial.