Probability Rules
By the end of this lesson, you should be able to: use the addition rule without double counting, test whether two events are independent instead of assuming it, turn any "at least one" question into a complement, and count the ways something can happen.
An engineer says the edge case is one in ten thousand
So it's fine. Ship it.
Pantry ran 25,079 checkouts last week. The chance that a 1-in-10,000 bug hit at least one of them is:
91.9%. It almost certainly fired, roughly two or three times, and somebody's groceries didn't arrive.

Read the left panel across. At 1 in 1,000 the bug is a certainty long before a week is out. At 1 in 100,000 the weekly chance is 22.2%, which is roughly once a month. Nothing here is a judgement call about severity. It's arithmetic that takes ten seconds, and it's usually the missing input in an argument about whether an edge case matters.
The rules, on one week of Pantry
Probability starts with a sample space, the set of everything that could happen, and an event, a subset of it you care about. Take the 120,000 users from last week and define three events:
- : ordered at least once.
- : contacted support.
- : on iOS.
Three rules cover almost everything you'll be asked.
Probabilities live between 0 and 1, and everything sums to 1. Trivial-sounding, and it's the check that catches a surprising number of errors: if your categories are exhaustive and mutually exclusive, their probabilities must add to exactly 1. When they don't, a case is missing or double counted.
The complement. . So 81.89% of users ordered nothing.
The addition rule. For "A or B", you can't just add, because anyone in both gets counted twice:
On the data: , and the directly measured is 0.3145. Skip the subtraction and you get 0.3442, overstating by three points. That's the whole reason "how many users did either of these things" is asked in interviews.
Independence is a claim, not a convenience
The multiplication rule. If and are independent, .
That "if" is where people get hurt. Independent means knowing one tells you nothing about the other, and it is a property of the world that you have to check.
Check it on Pantry:
| Pair | Observed | If independent | Ratio |
|---|---|---|---|
| Ordered and on iOS | 0.0852 | 0.0852 | 1.00 |
| Ordered and 3+ sessions | 0.1503 | 0.0966 | 1.56 |
The first pair is genuinely independent, so multiplying is fine. The second isn't, and multiplying understates the truth by a third.
The conditional version says it more directly:
Knowing somebody's platform tells you nothing about whether they'll order. Knowing they opened the app three times tells you a great deal. That's what independence is and isn't, and conditional probability picks it up from here.
The common failure isn't forgetting the multiplication rule. It's using it on events that share a cause. "System availability is 99.9% per service, we have four services, so 99.6% overall" assumes four independent failures. If all four sit in one availability zone, they fail together and the real number is far worse. Whenever you multiply probabilities, say out loud what would make them dependent.
Turn "at least one" into "none"
Back to the bug. "At least one" is awkward to compute directly, because you'd have to add up the chance of exactly one, exactly two, exactly three, all the way to 25,079.
The complement makes it one line. The opposite of "at least one" is "none", and "none" is a plain multiplication when the checkouts are independent:
| Bug rate | P(at least one) in a week |
|---|---|
| 1 in 1,000 | 1.0000 |
| 1 in 10,000 | 0.9186 |
| 1 in 100,000 | 0.2218 |
| 1 in 1,000,000 | 0.0248 |
Whenever a question contains "at least one", compute "none" and subtract. It's the highest-value reflex in this lesson, and it shows up again almost immediately: the multiple testing problem is this exact formula with = 0.05 and = the number of metrics on your scorecard.
There's a companion number worth quoting alongside it. The expected count is just , here hits. Expected count and probability-of-at-least-one answer different questions, and mixing them up is how "we expect 2.5 incidents" becomes "there's a 250% chance of an incident".
Counting, because multiplication is most of it
Some probability questions are really counting questions, and the machinery is small.
If a choice has options and an independent second choice has , there are combined outcomes. Everything else follows.
Permutations, when order matters:
Combinations, when it doesn't:
The only question is whether swapping two picks makes a different outcome.
| Question | Which | Answer |
|---|---|---|
| Fill 3 ordered hero slots from 12 products | Permutations | 1,320 |
| Pick an unordered 3-item bundle from 12 products | Combinations | 220 |
| 4 layout factors at 3 levels each | Multiplication | 81 cells |
| Pick 2 of 40 metrics to compare | Combinations | 780 pairs |
That last row is worth sitting with. A scorecard of 40 metrics contains 780 pairs, and if you go looking for interesting relationships between them at the 5% level, roughly 39 will look significant with nothing going on. The counting is the easy part. Knowing to do it is the skill.
Takeaways
- Rare times volume stops being rare. A 1-in-10,000 bug has a 91.9% chance of firing in a 25,079-checkout week, and an expected 2.51 hits.
- Subtract the overlap. . Skipping the last term overstated Pantry's "ordered or contacted support" by three percentage points.
- Independence is checkable. Ordering and platform matched their independent prediction at 1.00 times; ordering and session count came in at 1.56 times, so multiplying there is wrong.
- The dangerous multiplication is the one over a shared cause. Four services at 99.9% are not 99.6% together if they share an availability zone.
- "At least one" means compute "none". , and the same formula reappears as the multiple testing problem.
- Expected count and probability are different questions. 2.51 expected hits, 91.9% chance of at least one.
Quick check
A payments team reports each of their three providers is up 99.5% of the time, and concludes that the chance all three are down at once is 0.5% cubed, about 1 in 8 million. What should you push back on?
A growth team wants to test 3 headline options, 2 button colours and 2 hero images as a full factorial, then check 6 metrics in each cell. Roughly how many cell-and-metric results will they look at, and why does it matter?
Practice
What is the chance at least one of 5 trial users churns?
ComplementEach trial user churns independently with probability 0.2. What is P(at least one churns)?
How many ways can you pick and rank 3 recommended items from 10?
CountingAnswer it with order mattering and with order not mattering, and say which one a ranking surface needs.
When can you multiply two probabilities together?
IndependenceState the rule precisely, and give a case at Pantry where multiplying is wrong.
Take it further
- Meta: a 60-metric scorecard is the counting argument in this lesson applied to a real experiment readout.
- Facebook: a Feed change spreads between friends is a case where the independence assumption fails for a structural reason.
- OpenAI: integrity measurement turns on rates meeting volume, the same shape as the bug above.
That closes the free module. Next, conditional probability takes the line seriously and builds the rest of the subject on it.