Module 2: Probability for decisions · Lesson 2.1 · about 20 min
Probability rules with pictures
Probability as counting: the complement, "or" and "and" rules, independence and conditional probability, shown on a grid of 100 customers so every rule is something you can count.
Module 2 · about 20 minutes · school maths. You’ll be able to use the complement, addition and multiplication rules, tell when events are independent, and compute a conditional probability.
In everyday terms: picture 100 customers standing in a hall. “The chance a customer used a coupon” is how many of the 100 did. “The chance a coupon user returned the item” means: send everyone else out of the hall, then count again.
1. Probability is counting
A probability is a number from 0 (never) to 1 (always), often written as a percentage. For data, it is usually just a share: if 40 of 100 customers bought shoes, the probability a random customer bought shoes is 0.4. Every rule below is counting in disguise, so the grid below lets you count.
2. The complement
If 4 % of orders are returned, 96 % are not. Often the complement is easier to work out: “at least one of these 5 servers fails” is 1 − P(none fail).
3. “Or”: the addition rule
Adding counts everyone in A and everyone in B, so people in both get counted twice; subtract them once. If A and B cannot happen together (mutually exclusive, like “paid by card” and “paid by cash” for a single payment), the overlap is 0 and you just add.
4. “Given”: conditional probability
, read “probability of B given A”, restricts attention to the cases where A happened:
On the grid: look only at the shoe buyers and count what share also bought socks. Analysts use conditional probabilities constantly, usually without the name: conversion rate given mobile, churn rate given a complaint, return rate given a discount.
Order matters: and are different numbers. Mixing them up is a famous error, and Lesson 2.2 is about it.
5. “And”: the multiplication rule and independence
Rearranging the definition gives
Two events are independent when knowing one tells you nothing about the other: . Then the rule simplifies to . Coin flips are independent. Customer purchases usually are not: people who buy shoes are more likely to buy socks. That dependence is exactly what market basket analysis (“customers who bought this also bought…”) measures, and its “lift” is
Lift above 1 means the items go together.
- P(A)
- Share of all cases where A happens, from 0 (never) to 1 (always).
- P(not A) = 1 − P(A)
- The complement: everything that is not A.
- P(A or B) = P(A) + P(B) − P(A and B)
- Add, but take away the overlap you counted twice.
- P(A | B)
- "A given B": the share of the B cases that are also A. The bar means "only look at B".
- Independent
- Knowing B tells you nothing about A: P(A | B) = P(A).
- Physical meaning
- Conditioning is zooming in. P(returned | discount) zooms in on discounted orders only and asks what share of that smaller crowd came back.
“P(A | B) and P(B | A) are the same thing.” The share of discounted orders that were returned (90 of 600 = 15 %) is not the share of returned orders that had a discount (90 of 150 = 60 %). Always ask: out of which group?
Watch it happen, one step at a time:
Maths and principle
Principle: probabilities of overlapping events cannot simply be added or multiplied; you must account for the overlap, or for how one event changes the other.
Equations: complement ; or ; given ; and . ( means “and”, means “or”.)
Analogy: P(B | A) is like filtering a table to the rows where A is true, then computing the share of B. It is literally a SQL WHERE followed by an average.
6. Worked example
Made-up numbers. An online shop’s 2,000 orders last month:
| Used a discount | No discount | Total | |
|---|---|---|---|
| Returned | 90 | 60 | 150 |
| Kept | 510 | 1,340 | 1,850 |
| Total | 600 | 1,400 | 2,000 |
- P(returned) = 150 ÷ 2,000 = 7.5 %.
- P(returned | discount) = 90 ÷ 600 = 15 %. P(returned | no discount) = 60 ÷ 1,400 ≈ 4.3 %.
- These differ a lot, so returns and discounts are not independent. Discount orders come back about 3.5 times as often.
- P(discount or returned) = 600/2,000 + 150/2,000 − 90/2,000 = 660 ÷ 2,000 = 33 %.
Whether discounts cause returns is a different question (Lesson 8.3); the table only shows they go together.
7. Practice
- 5 % of parcels are damaged. What is P(not damaged)?
- Two independent servers each fail on 2 % of days. What is the chance at least one fails on a given day?
- 60 % of visitors are on mobile; 3 % of mobile visitors buy. What share of all visitors are mobile buyers?
Answers
- 95 %.
- 1 − P(neither fails) = 1 − 0.98 × 0.98 = 1 − 0.9604 = 3.96 %.
- P(mobile and buy) = 0.6 × 0.03 = 1.8 %.
Try it on your own data: the probability tree draws “and” and “given” as branches, the sample space builder builder counts outcomes for dice and cards, and cross-tab and chi-square builds a table like the one above from a CSV.
New words: probability, complement, mutually exclusive, conditional probability, independent, lift.
- Probability = favourable cases ÷ all cases; a two-way table of counts makes every rule visible.
- Complement: P(not A) = 1 − P(A).
- Or: add, then subtract the overlap.
- Given: divide by the size of the group you are looking inside; P(A | B) ≠ P(B | A).
- Independent events: P(A and B) = P(A) × P(B).
Check yourself
Sources
- OpenIntro Statistics, 4th edition (Diez, Cetinkaya-Rundel, Barr), Chapter 3 Probability https://www.openintro.org/book/os/
- Blitzstein, J. and Hwang, J. (2019), Introduction to Probability, 2nd edition, CRC Press, Chapters 1-2 https://projects.iq.harvard.edu/stat110
Your ticks stay in this browser. Save them as a file on the course home.
Updated 2026-11-22. Numbers in the examples are made up to show the idea unless a source is given. Simulations run in your browser; nothing you type is sent anywhere.