Sub topic 4
Expected Value: The Average Outcome
Assume you know basic percentages, fractions, and common game mechanics such as dice, cards, and loot drops. You should also be able to read simple Python code.
Expected value is the long-run average result of a random event. Designers use it to compare mechanics, set rewards, and check whether a system gives more or less value than intended.
The basic calculation
Multiply each possible outcome by its probability, then add the results:
\[ \text{Expected value} = \sum(\text{outcome} \times \text{probability}) \]
For a fair six-sided die, each face has a probability of \(1/6\). The expected value is:
\[ (1 \times \frac{1}{6}) + (2 \times \frac{1}{6}) + \dots + (6 \times \frac{1}{6}) = 3.5 \]
A die never rolls 3.5. The value means that many rolls average 3.5 over a large number of trials.
faces = [1, 2, 3, 4, 5, 6]
expected_value = sum(faces) / len(faces)
print(expected_value) # 3.5The same method works for unequal probabilities. Imagine a chest with these possible rewards:
| Reward | Probability | Contribution |
|---|---|---|
| 0 coins | 50% | 0 |
| 10 coins | 40% | 4 |
| 50 coins | 10% | 5 |
The chest's expected value is \(0 + 4 + 5 = 9\) coins. If a player opens many chests, the average reward should approach 9 coins per chest. Individual players can receive much less or much more.
Using expected value in design
Expected value helps you compare choices with different risk levels. Consider two attacks:
- A reliable attack deals 6 damage every time.
- A risky attack deals 20 damage with a 40% chance and 0 damage otherwise.
The risky attack has an expected value of:
\[ 20 \times 0.40 + 0 \times 0.60 = 8 \]
Although the risky attack sometimes fails, its average damage is higher. That difference may justify its danger, limited uses, or strategic cost.
Expected value does not determine whether a mechanic is fun or balanced. A low-probability, high-reward action may create excitement even when its average result is poor. A high expected value may also be too strong if players can repeat the action without meaningful cost.
Averages and player experience
A mechanic can have a fair expected value but still feel unfair. A reward with a 1% success chance has an expected success rate of 1 in 100 attempts, but a player may fail 100 times in a row. The average describes the system as a whole, not the experience of each player.
When evaluating a mechanic, record both its expected value and its possible outcomes. Then ask:
- Can players understand the odds?
- Is failure costly?
- Can players make decisions that affect the result?
- Does a long failure streak damage trust?
Exercise
An item has a 25% chance to grant 12 points and a 75% chance to grant 4 points. What is its expected value?
Show answer
6 points: (12 × 0.25) + (4 × 0.75) = 3 + 3.