A random variable assigns a number to each outcome of an experiment. A discrete random variable $X$ takes separate values, each with a probability, listed in a probability distribution. All probabilities must sum to $1$: $\sum P(X = x) = 1$. A small carnival game charges nothing to spin a wheel paying out the following:
| $x$ (payout, \$) | 0 | 2 | 5 | 10 |
|---|---|---|---|---|
| $P(X = x)$ | 0.5 | 0.3 | 0.15 | 0.05 |
The expected value (mean) is the long-run average per play, $$E(X) = \sum x \, P(X = x) = 0(0.5) + 2(0.3) + 5(0.15) + 10(0.05) = 0.6 + 0.75 + 0.5 = 1.85.$$ So each spin pays out \$1.85 on average. If the operator charges \$2 to play, the expected profit per play is $2 - 1.85 = \$0.15$, and a game is called fair when the expected gain to each side is zero.