Sub topic 2
Variance and streaks: why short runs feel unfair
This chapter assumes you can work with fractions and percentages, read simple Python, and recognize common game mechanics such as dice and loot drops. It builds on expected value, the long-run average of an outcome.
Variance and streaks
Expected value tells you the long-run average. Variance tells you how far short runs stray from that average. A fair coin has an expected value of 0.5 heads per flip, but ten flips can easily produce seven heads or six tails in a row. High variance means wide swings. Low variance means results stay close to the average.
Streaks are a normal part of random sequences. Players often read a streak as proof the game is rigged, when it is simply what randomness looks like over a few trials.
import random
def longest_streak(flips):
best = run = 1
for prev, cur in zip(flips, flips[1:]):
run = run + 1 if cur == prev else 1
best = max(best, run)
return best
rng = random.Random(7)
flips = [rng.choice("HT") for _ in range(100)]
print(longest_streak(flips))The gambler's fallacy
The gambler's fallacy is the belief that a result is "due" after a run of the opposite result. A fair coin has no memory. After five tails, the chance of heads on the next flip is still 0.5. Players apply this belief to drops, critical hits, and misses. Design around it: show the player their attempt count, or let a bad run end with a visible improvement.
Balancing skill and luck
Skill and luck both shape outcomes. The right balance depends on how many trials a match contains. A single die roll tells you almost nothing about skill, while many rounds let skill win out. Use this table as a rough starting point, then test it with real players.
| Match length | Suggested luck share | Typical use |
|---|---|---|
| One roll | High | Quick party games |
| Ten rounds | Medium | Casual competition |
| Hundreds of rounds | Low | Ranked play |
Keeping decisions meaningful under chance
A random outcome should not erase the player's choices. Let players choose which risk to take, which dice to keep, or when to stop. The random roll then decides the result, and the player's choice decides the strategy. If every choice produces the same result no matter what the player does, the player feels like a spectator.
Exercise
A boss drops a rare item with a 10% chance per kill. A player has missed nine times in a row and says the next kill is "due." Is the player right? Explain why.
Show answer
No. Each kill is an independent 10% chance. The nine earlier misses do not change the odds, so the chance on the next kill is still 0.10.