The Addition Rule
Probability Theory
When Does A or B Happen? Count Without Double-Counting
The addition rule calculates the probability of A or B (or both) occurring. The key insight: subtract the overlap so you never count it twice.
- General rule — P(A or B) equals P(A) plus P(B) minus P(A and B)
- Mutually exclusive — When A and B cannot both occur, the formula simplifies
- Inclusion-exclusion — The principle extends to three or more events
- Venn diagrams — Visual proof of why double-counting happens and how to fix it
What You'll Learn
- 1Partition a union into disjoint pieces to derive the general addition rule from scratch
- 2Apply the simplified rule to mutually exclusive events without over-thinking the intersection
- 3Extend inclusion-exclusion to three events and identify which pair terms cancel
- 4Convert messy 'at least one' questions into a single complement product
Union probability is the daily bread of risk reporting: chance that either of two systems fails, chance that a user complains about either the app or the checkout, chance that a lot is rejected for either defect type. The naive instinct is to add the two probabilities, and that instinct is wrong exactly when the events overlap — which is most of the time. The addition rule is the correction term, and its structure — add the singles, subtract the intersection — generalizes cleanly to any number of events.
Why Naive Addition Double-Counts
Draw one card from a standard deck. Let be "the card is a heart" and be "the card is an ace." There are 13 hearts and 4 aces, so and . Adding gives , but only 16 distinct cards qualify: the 13 hearts plus the 3 aces of other suits. The ace of hearts was counted in both piles — once as a heart, once as an ace. That single card is the intersection , and its probability, , is precisely the correction the rule requires:
Every union calculation is a variant of this accounting problem. The events are sets of outcomes; the union is their set sum; and set sums obey the identity , which converts to probabilities the moment you divide by the size of the sample space.
The General Addition Rule
No independence assumption is needed, and none is implied. What you need instead is the joint probability — either given to you, computed with the multiplication rule, or read off a contingency table. A useful sanity check falls straight out of the formula: since , the union can never exceed the plain sum, and since the intersection cannot exceed either single probability, the union is always at least . Those two inequalities — Boole's and Fréchet's bounds for unions — let you bracket a joint probability even before the overlap is known.
import numpy as np
deck = [f"{rank} of {suit}"
for suit in ['Hearts', 'Diamonds', 'Clubs', 'Spades']
for rank in ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']]
hearts = [c for c in deck if 'Hearts' in c]
aces = [c for c in deck if c.split()[0] == 'A']
both = set(hearts) & set(aces)
p_a, p_b = len(hearts) / len(deck), len(aces) / len(deck)
p_ab = len(both) / len(deck)
p_union = p_a + p_b - p_ab
print(f"P(Hearts) = {p_a:.4f} = 13/52")
print(f"P(Ace) = {p_b:.4f} = 4/52")
print(f"P(Heart and Ace) = {p_ab:.4f} = 1/52")
print(f"P(Heart or Ace) = {p_union:.4f} = 16/52 = 4/13")
Mutually Exclusive Events and the Complement
When is empty the intersection term vanishes and the rule collapses to plain addition. Mutually exclusive (or disjoint) events — rolling an even number versus an odd number on one die, a card being both a heart and a spade — automatically satisfy this condition. The complement rule is the same idea wearing a different hat: and partition the sample space, so , giving the identity that powers countless "at least one" shortcuts. The table below shows the decision flow: check whether the intersection is empty first, because applying the simplified rule to overlapping events is the most common way students invent probabilities larger than one.
| Question | Events disjoint? | Correct formula | Worked result |
|---|---|---|---|
| Even or odd on one die | Yes | ||
| Heart or ace on one card | No | ||
| Pass math or pass science | Usually no | Needs joint term | Overlap is the both-pass cohort |
| Heads on a coin (A or Aᶜ) | Yes, by construction |
# Mutually exclusive: even versus odd on a single die roll
S = {1, 2, 3, 4, 5, 6}
even, odd = {2, 4, 6}, {1, 3, 5}
p_even, p_odd = len(even) / len(S), len(odd) / len(S)
p_both = len(even & odd) / len(S)
p_union_general = p_even + p_odd - p_both
p_union_simple = p_even + p_odd
print(f"P(Even) = {p_even:.4f}, P(Odd) = {p_odd:.4f}")
print(f"P(Even and Odd) = {p_both:.4f} -> disjoint, so the intersection term is zero")
print(f"General rule: {p_union_general:.4f} | Simplified rule: {p_union_simple:.4f}")
Inclusion-Exclusion for Three Events
Three events require alternating corrections: singles, minus pair overlaps, plus the triple overlap. The sign pattern exists because the triple region was removed three times by the pair terms and must therefore be restored once:
Roll one die with ("at most two"), ("two or three"), and ("at least three and at most four"). The singles contribute outcomes; the pairs , , and remove 2; the triple adds back 0. Four distinct outcomes remain — 1, 2, 3, 4 — so the union probability is . Notice the bookkeeping discipline: every intersection is computed as a set, never guessed. For events the pattern continues with terms, which is why direct enumeration becomes painful fast and why simulation or complement strategies take over beyond three events.
S = {1, 2, 3, 4, 5, 6}
A, B, C = {1, 2}, {2, 3}, {3, 4}
counts = {
'A': len(A), 'B': len(B), 'C': len(C),
'AB': len(A & B), 'AC': len(A & C), 'BC': len(B & C),
'ABC': len(A & B & C),
}
n_union = (counts['A'] + counts['B'] + counts['C']
- counts['AB'] - counts['AC'] - counts['BC']
+ counts['ABC'])
print(counts)
print(f"n(A ∪ B ∪ C) = {n_union} (outcomes {sorted(A | B | C)})")
print(f"P(A ∪ B ∪ C) = {n_union / len(S):.4f} = 2/3")
The At-Least-One Shortcut
"At least one" questions invert beautifully. Asking for the probability that at least one of ten independent components fails, each with failure rate 0.01, would take inclusion-exclusion with terms if done directly. Instead compute the only easy path — the probability that none fail — and subtract: . The same move prices "at least one defective item in a lot," "at least one goal in a match," and "at least one shared birthday," provided the stages are independent. When they are not, condition each factor as in the multiplication rule before multiplying, then take the complement at the end.
# Network packet survival: 10 links, each fails independently with p = 0.01
p_link_fail = 0.01
p_at_least_one = 1 - (1 - p_link_fail) ** 10
print(f"P(at least one link fails) = {p_at_least_one:.4f}")
# Simulate to confirm
np.random.seed(0)
trials = 200_000
fails = np.random.rand(trials, 10) < p_link_fail
simulated = np.mean(fails.any(axis=1))
print(f"Simulated: {simulated:.4f}")
print(f"Difference: {abs(simulated - p_at_least_one):.5f}")
Bounds When Overlap Is Unknown
Sometimes the intersection is genuinely unavailable — a vendor reports defect rates for two subsystems but not their joint rate. The addition rule still delivers bounds. Boole's inequality says the union is at most the sum of the singles; Fréchet's lower bound says it is at least the larger single. For and , the union lies somewhere in , with 0.7 attained when the events are disjoint and 0.4 when one nests inside the other. Those brackets are wide, and that width is the honest price of missing joint data — better to state the bound than to pretend independence and report a single fabricated number. Multi-label classification meets this daily: micro-averaged precision and recall need the intersection counts, and guessing them from marginals biases every metric that follows.
Common Mistakes
Adding P(A) and P(B) for overlapping events
Fix: Always subtract the intersection unless you have proven the events are disjoint; the card example inflates by exactly P(A and B).
Applying the simplified rule to 'drawing two hearts in a row'
Fix: Two draws are two events on one sequence, not mutually exclusive outcomes of a single trial; use the multiplication rule instead.
Enumerating at least one with inclusion-exclusion when the complement is one product
Fix: Compute P(none) by multiplying stage probabilities and subtract from one; it is shorter and less error-prone.
Best Practices
- Label whether events are disjoint before choosing between the simple and general formulas
- Use set operations in code to obtain intersection sizes rather than mental accounting
- Reserve inclusion-exclusion for three events; prefer complements or simulation beyond that
- Report the overlap alongside any union probability so readers can see the double-count you removed
Key Takeaways
- The general addition rule subtracts the intersection: P(A or B) = P(A) + P(B) − P(A and B)
- Mutually exclusive events have an empty intersection, so their union probability is the plain sum
- Inclusion-exclusion alternates signs across singles, pairs, triples, and beyond
- At-least-one questions collapse to 1 − P(none), the complement shortcut that beats term-by-term enumeration
Frequently Asked Questions
Can the addition rule ever give a probability above 1?
Only if you feed it inconsistent inputs. If P(A and B) is understated — say, zero for events that actually overlap — the sum P(A) + P(B) can exceed 1. The correct intersection always pulls the union back into range, which is why the rule doubles as a consistency check on reported marginals.
How does Bayes' theorem use the addition rule?
Bayes' rule divides a joint probability by a marginal, and that marginal is often itself a union — for example, total disease probability is the union of true positives and false positives across strata. Building the denominator correctly usually means applying the addition rule or the law of total probability first.
Is P(A or B) ever equal to P(A) plus P(B) for non-disjoint events?
Only in the degenerate case where the intersection has probability zero. For discrete events with positive probabilities, equality holds if and only if the events are mutually exclusive; for continuous events, "mutually exclusive" can be replaced by "the intersection has probability zero," which is why a uniform draw being simultaneously 0.5 and 0.6 has a union equal to the sum of two zero probabilities.
Interview Questions
Q1: State the general addition rule and explain each term.
P(A or B) = P(A) + P(B) − P(A and B). The first two terms count every outcome in the union, but outcomes in the intersection appear in both, so their probability is subtracted once to restore correct accounting.
Q2: Events A and B have probabilities 0.3 and 0.4. What can you say about their union?
Without the intersection it lies between max(0.3, 0.4) = 0.4 and min(1, 0.3 + 0.4) = 0.7. The lower bound means B contains A; the upper bound means they are disjoint.
Q3: How do you compute the probability of at least one success in five independent trials with success probability 0.2?
Use the complement: 1 − P(no successes) = 1 − 0.8^5 = 1 − 0.32768 = 0.67232. Direct enumeration of the single, pair, triple, quadruple, and quintuple successes gives the same value with five times the arithmetic.