Sub topic 3
Probability basics for designers
This chapter assumes you can work with fractions and percentages, know how dice, cards, and loot drops work in games, and can read short Python programs. It builds the vocabulary and the few rules that every later chapter relies on.
Why designers need a few rules
Players say "that felt unfair." A designer needs to answer whether it was unlikely or just uncommon. Probability gives you numbers to answer that, so you can tune a drop rate or a crit chance on purpose instead of by feel.
You only need four ideas: the sample space, the probability of an event, the rule for combining events, and the difference between replacement and no replacement.
Sample space and events
A sample space is the list of every outcome that can happen. For one six-sided die it is 1, 2, 3, 4, 5, 6. An event is any set of outcomes you care about, such as "roll 5 or more."
When every outcome is equally likely, the probability of an event is:
P(event) = favorable outcomes / total outcomes"Roll 5 or more" has two favorable outcomes (5 and 6) out of six, so P = 2/6 = 1/3, about 33%.
Probabilities always sit between 0 (impossible) and 1 (certain). Designers often write them as percentages, but the arithmetic is cleaner with decimals or fractions.
The equal-likelihood condition matters. Two dice summed give 11 possible totals (2 to 12), but those totals are not equally likely, so "1 in 11" is wrong for any one total. The fix is to list the equally likely outcomes, which here are the 36 ordered pairs of faces. Python can do the counting for you:
from fractions import Fraction
from itertools import product
def probability(event, outcomes):
hits = sum(1 for o in outcomes if event(o))
return Fraction(hits, len(outcomes))
two_dice = list(product(range(1, 7), repeat=2))
print(probability(lambda o: sum(o) == 7, two_dice)) # 1/6
print(probability(lambda o: o[0] == 6 or o[1] == 6, two_dice)) # 11/36Counting by brute force is a good habit. Whenever a rule gets complicated, enumerate the sample space and check your formula against it.
Probability, odds, and percentages
Designers, players, and bookmakers use different notations for the same thing.
| Notation | Meaning | Example for 1 chance in 4 |
|---|---|---|
| Probability | favorable / total | 1/4 or 0.25 |
| Percentage | probability x 100 | 25% |
| Odds for | favorable : unfavorable | 1:3 |
Odds of 1:3 do not mean 1/3. This is a common mistake in design documents. State which form you mean, and use probability or percentage in your own specs.
The complement rule
The probability that an event does not happen is 1 minus the probability that it does:
P(not A) = 1 - P(A)A 5% drop chance means a 95% chance of no drop. This rule is useful because many questions are easier to answer from the "nothing happens" side.
Combining events
Independent events: multiply for "and"
Two events are independent if one does not change the probability of the other. Separate die rolls and separate loot rolls are independent. The probability that both happen is the product:
P(A and B) = P(A) x P(B)Rolling two sixes in a row is 1/6 x 1/6 = 1/36.
Mutually exclusive events: add for "or"
Two events are mutually exclusive if they cannot both happen on the same roll. Rolling a 1 or a 2 on one die is an example. The probability of either is the sum:
P(A or B) = P(A) + P(B)So P(1 or 2) = 1/6 + 1/6 = 1/3.
If the events can overlap, adding double counts the overlap. For two dice, "at least one six" is not 1/6 + 1/6 = 1/3. The correct value is 11/36, because the case (6, 6) was counted twice. For overlapping events use P(A or B) = P(A) + P(B) - P(A and B).
"At least one": use the complement
"At least one success in n tries" is the most common question in loot design. Do not add the chances. Compute the chance that every try fails, then subtract from 1:
def at_least_one(p, n):
return 1 - (1 - p) ** n
print(round(at_least_one(0.05, 10), 4)) # 0.4013
print(round(at_least_one(0.05, 20), 4)) # 0.6415Ten tries at a 5% chance give about 40%, not 50%. Even 20 tries leave a 36% chance of nothing. Chapter 6 covers why this matters for player frustration.
Dependent events and drawing without replacement
Cards and shuffle-based systems are not independent. When you draw a card and keep it out of the deck, the next draw changes. This is sampling without replacement.
The chance of drawing two aces in a row from a 52-card deck is the first draw times the chance of the second given the first:
from fractions import Fraction
first = Fraction(4, 52)
second = Fraction(3, 51) # one ace and one card are gone
print(first * second) # 1/221If you wrongly treated the draws as independent, you would get (4/52)^2 = 1/169. The gap is small here but grows quickly in small decks, such as a 10-card hand mechanic.
With replacement (put the card back and reshuffle), draws are independent again. Know which of the two your game does, because it changes both the math and the feel.
Common errors
- Treating unequal outcomes as equal. Summed dice, weighted tables, and tiered loot all have unequal outcomes. Count the equally likely cases first.
- Confusing odds with probability. 1:3 is 25%, not 33%.
- Adding instead of using the complement. See "at least one" above.
- Ignoring dependence. Draws from a deck, a bag, or a limited pool change as items leave.
- Believing past rolls change independent odds. A coin that landed heads five times is still 50% on the next flip. Chapter 7 returns to this.
Check your design with code
The formulas above give exact answers. A quick simulation gives an independent check. If both agree, you probably set the problem up correctly:
import random
rng = random.Random(5)
trials = 100_000
hits = sum(
any(rng.random() < 0.05 for _ in range(10))
for _ in range(trials)
)
print(hits / trials) # close to 0.4013The simulated value will not match 0.4013 exactly, but it should land within a fraction of a percentage point. Chapter 16 develops this habit properly.
Exercise
A weapon has a 10% critical hit chance on each attack, and attacks are independent. (a) What is the probability of at least one crit in 3 attacks? (b) Why is "30%" the wrong answer?
Show answer
(a) The chance of no crit on one attack is 0.9. The chance of no crit in three attacks is 0.9^3 = 0.729. So P(at least one crit) = 1 - 0.729 = 0.271, or 27.1%. (b) 10% + 10% + 10% = 30% adds the chances as if the events could not overlap. But all three attacks can crit, and those overlapping cases get counted more than once. The complement method avoids the double counting.
Exercise
You draw two cards without replacement from a 52-card deck. What is the probability that both are hearts? Give a fraction.
Show answer
There are 13 hearts. The first draw is 13/52 = 1/4. After one heart is removed, 12 hearts remain among 51 cards, so the second draw is 12/51 = 4/17. Multiplying gives 1/4 x 4/17 = 1/17.