Probability Rules
By the end of this lesson, you should be able to: use the addition rule without double counting, check 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.
Events and the basic rules
Probability starts with a sample space, the set of everything that could happen, and events, the parts of it you care about. For one user's visit to an app, the sample space is every possible visit. "Used search" is an event. So is "made a purchase".
The probability of an event, written , is a number from 0 to 1. Three rules cover most of what you'll need.
Everything adds to 1. If a set of outcomes covers every possibility, with no overlaps, their probabilities add up to exactly 1. It sounds trivial, but it's a useful check: if your categories are meant to cover everything and they don't add to 1, a case is missing or counted twice.
The complement. The chance that doesn't happen is
The addition rule. The chance that or happens, or both, is
The last term is the overlap. Without it, everyone who did both gets counted twice.
Say, for illustration, that 30% of an app's users used search last month, 20% used the saved-items list, and 8% used both. The share who used at least one of the two is 30% + 20% − 8% = 42%, not 50%. A report that adds the two shares straight overstates the reach of the two features by 8 points.
Independence
Two events are independent if knowing that one happened tells you nothing about the other. Formally, : the chance of given that happened is the same as the chance of overall. Conditional probability covers the notation in full.
When events are independent, and only then, the chance of both happening is the product:
That "only then" is where people get hurt. Independence is a claim about the world, and it has to be checked.
A British court case shows what happens when it isn't. Sally Clark was convicted of murdering her first two babies, who had both died suddenly in infancy. A medical expert witness estimated that for a family like hers, the chance of one sudden infant death was about 1 in 8,500. He squared it to get the chance of two: 1 in 73 million.
The Royal Statistical Society wrote to the Lord Chancellor to object. Squaring the figure, its president wrote, "would only be valid if SIDS cases arose independently within families", an assumption that would need to be justified, and "there are very strong reasons for supposing that the assumption is false". Brothers share genes and a home. If something in a family raises the risk of one sudden death, it raises the risk of a second, and the chance of two is much higher than the product.
The same thing turns up in engineering data. Google studied memory errors across its server fleet over two and a half years. If a memory module had an error one month, the chance of an error the next month went up by a factor of 35 to more than 200, compared with a module that had no error the month before. Errors cluster in faulty hardware. Treat each month as independent and you badly underestimate how often a module that has failed once will fail again.
Whenever you multiply probabilities, ask what could make the events depend on each other. Services that share a data centre, users from the same company, and days for the same user all share causes.
One more trap: independent isn't the same as mutually exclusive. Mutually exclusive events can't both happen, so . Knowing one happened tells you the other didn't, which makes them strongly dependent.
"At least one": compute "none" and subtract
Say a checkout bug fires on 1 in 10,000 orders, and a store takes about 25,000 orders a week. What's the chance it hits at least one?
Working it out directly means adding the chance of exactly one hit, exactly two, and so on up to 25,000. The complement is much shorter. The opposite of "at least one" is "none", and if orders are independent, "none" is a single multiplication:
Here that's , about 92%. The bug that "only" affects 1 in 10,000 orders almost certainly hit somebody this week.
The default shows the bug: 1 in 10,000, about 25,000 tries, a 91.9% chance of at least one hit. Move the chance to 1 in 100,000 and it drops to 22%. Move it to 1 in 1,000 and it's certain long before the week is out. A rare event isn't rare at volume.
Google's memory study shows the same arithmetic at fleet scale. More than 8% of memory modules had at least one error in a year. A machine holds several modules, and about a third of all machines had at least one.
Notice the expected count in the explorer too. It's just , here about 2.5 hits. The expected count and the chance of at least one answer different questions. Mixing them up is how "we expect 2.5 incidents" turns into "there's a 250% chance of an incident".
Whenever a question says "at least one", compute "none" and subtract. The same formula is behind the multiple testing problem, with and the number of metrics on a scorecard.
Counting
Some probability questions are counting questions. If one choice has options and a second, separate choice has , there are combined outcomes. The rest follows from that.
Permutations count arrangements where order matters:
Combinations count selections where order doesn't matter:
Ask whether swapping two picks gives a different outcome. If it does, use permutations.
| Question | Which | Answer |
|---|---|---|
| Fill 3 ranked slots on a home page from 12 products | Permutations | 1,320 |
| Pick an unranked bundle of 3 from 12 products | Combinations | 220 |
| 4 design factors with 3 options each | Multiplication | 81 versions |
| Pick 2 of 40 metrics to compare | Combinations | 780 pairs |
The last row matters most in practice. A dashboard with 40 metrics holds 780 pairs. Test every pair for a relationship at the 5% level and about 39 will look significant by chance alone.
The birthday problem puts counting and the complement together. In a room of 23 people, what's the chance at least two share a birthday? Compute "none share" instead. The first person can have any birthday, the second must avoid one day, the third must avoid two, and so on:
So the chance of a shared birthday is about 50.7%. Most people guess far lower, because they think of matches with their own birthday. With 23 people there are pairs, and each pair is a chance for a match.
Takeaways
- Subtract the overlap. . Adding 30% and 20% gives 42% when 8% did both.
- Multiply only when events are independent. Squaring 1 in 8,500 to get 1 in 73 million assumed that two deaths in one family were unrelated, which the Royal Statistical Society said there were strong reasons to doubt.
- Shared causes break independence. At Google, a memory error one month made an error the next month 35 to 200 times more likely.
- "At least one" means compute "none". : a 1-in-10,000 bug has a 92% chance of hitting 25,000 orders at least once.
- Expected count and probability are different questions. 2.5 expected hits, a 92% chance of at least one.
- Count pairs before you go looking for patterns. 40 metrics make 780 pairs, and 23 people make 253.
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)?
Working out "at least one" directly means adding up exactly one, exactly two, and so on to five. Use the complement instead.
The pattern to remember: whenever a question says "at least one", the complement is the short route. It turns a sum of many terms into one subtraction.
The independence assumption is doing real work here. If the five users all came from the same company and that company went under, their churn would be strongly dependent and would be wrong.
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 ranked list needs.
Order matters: permutations. Position 1 is a better slot than position 3, so a ranked list is a permutation:
Order doesn't matter: combinations. If you only care which three appear:
The two differ by exactly , the number of ways to arrange any three chosen items.
A ranked list needs the permutation count, because the same three items in a different order is a different experience with a different click-through rate.
When can you multiply two probabilities together?
IndependenceState the rule precisely, and give a product example where multiplying is wrong.
The general multiplication rule always holds:
It becomes only when and are independent, meaning : knowing happened tells you nothing about .
Where it fails: say 35% of an app's users open it on any given day. The chance a user opens it both today and tomorrow isn't , because users differ. Heavy users tend to open it on both days and inactive users on neither, so the two days are positively dependent and the real chance is well above the product.
That same dependence is why counts of sessions per user spread out more than a Poisson distribution predicts, as discrete distributions shows.
Independent isn't the same as mutually exclusive. Mutually exclusive events can't both happen, so , which makes them strongly dependent.
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 independence fails for a structural reason.
- OpenAI: a safety filter for a rare harm turns on rare events meeting volume, the same shape as the bug above.
References
- 1.P. Green, President of the Royal Statistical Society, letter to the Lord Chancellor on the use of statistical evidence in the case of R v Sally Clark, 23 January 2002. Reproduced in Chance News 11.01. Open
- 2.B. Schroeder, E. Pinheiro and W.-D. Weber, DRAM Errors in the Wild: A Large-Scale Field Study, Proceedings of ACM SIGMETRICS 2009. Data from Google's server fleet. Open