Contents/ Part VI · Probability/ Chapter 32

Rules of Probability

Single events are rarely the whole story. This chapter is about combining them: the addition rule for "or", the multiplication rule for "and", and the difference between mutually exclusive and independent events that trips up almost everyone the first time.

⏱️ ~13 min read
🐍 Notebook included
📊 Chapter 32

The Probability Fundamentals chapter gave us single probabilities. Real questions almost always combine events: the chance of this or that, of this and that, of at least one. A small set of rules, all flowing from Kolmogorov's axioms, handles every case.

The two core rules: the addition rule finds P(A or B), and the multiplication rule finds P(A and B). Knowing which to reach for starts with one question: is the word or, or and?
🧭
Two keywords, two rules

"Or" means at least one of the events happens, that is the addition rule. "And" means both happen together, that is the multiplication rule. Almost every probability calculation begins by spotting which keyword the question is really asking, then applying the matching rule and watching for the two classic traps (double-counting, and confusing exclusivity with independence).

1

The Addition Rule: P(A or B)

To find the probability that A or B happens, you add their probabilities, but if they can both happen you must subtract the overlap, or you count it twice.

P(A or B): add the two, then subtract the part counted twice A B A only B only A and B (overlap) P(A or B) = P(A) + P(B) - P(A and B) the overlap is inside both circles, so adding P(A) and P(B) counts it twice; subtract it once.

For the card example in the notebook, P(heart or face card) = 13/52 + 12/52 − 3/52 = 22/52. The three cards that are both a heart and a face card (the jack, queen, and king of hearts) would otherwise be double-counted.

2

The Multiplication Rule: P(A and B)

To find the probability that A and B both happen, you multiply. A probability tree makes it visual: the chance of a path is the product of the probabilities along its branches.

Two coin flips: multiply the branch probabilities along each path 0.5 (H)0.5 (T) 0.5 (H)0.5 (T) 0.5 (H)0.5 (T) start H T HH = 0.5 x 0.5 = 0.25 HT = 0.5 x 0.5 = 0.25 TH = 0.5 x 0.5 = 0.25 TT = 0.5 x 0.5 = 0.25 the four paths each have probability 0.25, and they sum to 1.
✖️
The general rule and the easy case

The full multiplication rule is P(A and B) = P(A) × P(B | A), where P(B | A) is the probability of B given A already happened (the Conditional Probability & Independence chapter develops this). When A and B are independent, A tells you nothing about B, so P(B | A) = P(B) and the rule simplifies to the plain product P(A) × P(B). Two dice both even: 1/2 × 1/2 = 1/4.

3

Mutually Exclusive vs Independent

These two terms sound similar and get swapped all the time, but they describe opposite kinds of relationship. Getting them straight is one of the most valuable things in this chapter.

MUTUALLY EXCLUSIVE A B cannot both happen P(A and B) = 0 so they are DEPENDENT INDEPENDENT A B can both happen, no influence P(A and B) = P(A) x P(B) neither changes the other
Mutually exclusiveIndependent
Can both occur?No, neverYes
P(A and B)= 0= P(A) × P(B)
RelationshipStrongly dependent (one rules the other out)No relationship
ExampleA die showing even vs oddTwo separate coin flips
⚠️
They are not opposites, and not synonyms

Mutually exclusive events are actually dependent: if A happens, B becomes impossible, so A changes B's probability dramatically. Independence is the opposite situation, where A changes nothing about B. The only safe move is to test: events are independent precisely when P(A and B) = P(A) × P(B). Never assume it from the wording.

4

Putting the Rules Together

Most problems are solved by picking the right rule, sometimes two in sequence. A quick decision guide:

What are you computing? A OR B add P(A)+P(B)-P(A and B) (drop the last term if exclusive) A AND B multiply P(A) x P(B|A) (= P(A) x P(B) if independent) AT LEAST ONE use the complement 1 - P(none) (none is an AND of failures)

The "at least one" pattern is worth memorizing because it shows up everywhere. P(at least one six in four rolls) = 1 − (5/6)⁴ ≈ 0.52: the chance of no sixes is an AND of four independent misses, and the complement turns it into "at least one". It crosses 50% at the fourth roll.

5

Probability Rules in Machine Learning & AI

The four moves you just learned, OR, AND, independence, and "at least one", are the grammar of real probability models. Two of them sit right at the heart of how a spam filter and a language model work.

Naive Bayes multiplies probabilities: the AND rule, assuming independence P(spam) 0.30 × P("free" | spam) 0.90 × P("win" | spam) 0.80 = score for "spam" 0.216 the chain rule (the multiplication rule applied over and over) is how a language model scores a whole sentence, one factor per word
Rule (this chapter)In ML / AI it becomesConcrete example
Multiplication (AND)How naive Bayes scores a classmultiply P(word | spam) across all the words
Independence assumptionThe "naive" in naive Bayeswords treated as independent given the class
Chain rule (repeated AND)How a language model factors a sentenceP(sentence) = product of P(word | previous words)
Addition (OR)Total probability over disjoint classessum P across mutually exclusive labels
Complement ("at least one")Ensembles and redundancy1 − P(every detector misses)
🤖
Why this matters for AI research

Naive Bayes is the multiplication rule plus a deliberately simple independence assumption that is usually false yet works remarkably well. The chain rule, just the multiplication rule applied over and over, is exactly how a language model assigns a probability to a sentence, multiplying one conditional factor per token. And "at least one" logic explains why stacking independent checks (ensembles, redundant safeguards) sharply raises the odds of catching a rare event. The same four moves scale all the way up to the algorithms later in the book.

🐍

See the rules in action

The companion notebook works the addition rule on a card deck (with a Venn picture of the overlap), checks the mutually exclusive special case on a die, multiplies independent events across two dice, runs the independence test that separates "mutually exclusive" from "independent", and builds an "at least one" curve from the complement, each verified by simulation.

📓 View Notebook (code & outputs) ▶ Open in Colab ⬇ View / Download on GitHub

View opens the rendered notebook instantly (no setup). Open in Colab runs & edits it live in your browser. To run locally, install numpy and matplotlib and launch jupyter notebook.

🎓 Key Takeaways

  • Addition (OR): P(A or B) = P(A) + P(B) − P(A and B); subtract the overlap so it is not double-counted.
  • Multiplication (AND): P(A and B) = P(A) × P(B | A); for independent events this is just P(A) × P(B).
  • Mutually exclusive ≠ independent: exclusive means P(A and B) = 0 (and therefore dependent); independent means P(A and B) = P(A) × P(B).
  • Test independence, never assume it: check whether P(A and B) equals P(A) × P(B).
  • "At least one" = 1 − P(none): combine the multiplication rule with the complement.
6

Practice Challenges

Five short challenges, beginner to intermediate. Try them on paper or in Python before checking the solutions.

1

Addition with overlap

Draw one card. Find P(red or king). Identify the overlap, apply the addition rule, and verify by simulation.

Hint: 26 red + 4 kings − 2 red kings.
2

Mutually exclusive

Roll one die. Find P(roll a 2 or a 5). Are these mutually exclusive? What happens to the overlap term?

Hint: P(2 and 5) = 0 on one die.
3

Multiplication (independent)

Flip a coin and roll a die. Find P(heads and a six). Are they independent? Verify by simulation.

Hint: 1/2 × 1/6.
4

Test independence

Given P(A)=0.5, P(B)=0.4: in case (i) P(A and B)=0.2, in case (ii) P(A and B)=0. For each, is the pair independent, mutually exclusive, or neither?

Hint: compare P(A and B) to P(A) × P(B) = 0.20.
5

At least one

A shooter makes 80% of free throws. Assuming independent shots, find P(at least one miss in 5 attempts) using the complement.

Hint: 1 − 0.8⁵.
Check your work

A fully-worked solutions notebook walks through all five challenges in the same visual style. Try them yourself first, then compare.

📓 View Solutions ▶ Open Solutions in Colab ⬇ View / Download on GitHub
7

Quiz: Test Yourself

Eight quick questions on the rules of probability. Answer them, hit Check Answers, and keep refining until you score 100%. Your progress is saved, so you can hop back to the chapter and return anytime.