Statistics 🎲 Probability

Conditional Probability

What "given that B happened" really does — it shrinks the world down to B, and you count again inside it.

Intro StatisticsAP Statistics level
💡
The big idea: Learning that event B happened doesn't just add a fact — it shrinks the world of possibilities down to B alone. A conditional probability \( P(A\mid B) \) asks: within that smaller world, what fraction is also in A? That one move — restrict the sample space, then re-count — is the whole of conditional probability, and it is what makes independence and two-way tables click into place.
🎯 By the end, you'll be able to
  • Explain conditional probability as restricting the sample space to the outcomes where the condition is true
  • Use the rule P(A|B) = P(A and B) / P(B) to compute a conditional probability
  • Read conditional probabilities off a two-way table by choosing the right row or column as the denominator
  • Recognise independence as the case where conditioning changes nothing: P(A|B) = P(A)
📎 You should already know
  • Basic probability as a fraction of equally likely outcomes
  • Reading counts and totals from a table

Extra information shrinks the world

Someone rolls a fair die behind a screen and tells you one thing: the result is even. What is the chance it is a 6 now? Not \(1/6\) any more. The words the result is even quietly threw away three of the six faces. Only \(\{2,4,6\}\) are still possible, so a 6 is one of three equally likely outcomes — a chance of \(1/3\).

That is the entire idea of a conditional probability. Writing \(P(A\mid B)\) — read the probability of A given B — means: assume B has happened, so B is now the only world that exists, and ask what share of that world is also in A.

🔑 The definition
The conditional probability of A given B is the fraction of the B-world that also lands in A. You take the outcomes that are in both A and B, and divide by all of B — because B, not the original space, is now your denominator. This is defined only when \(P(B) > 0\): you cannot condition on something that never happens.
\[ P(A \mid B) = \frac{P(A \cap B)}{P(B)}, \qquad P(B) > 0 \]
P(A given B) equals the probability of A and B together, divided by the probability of B. The A∩B on top is the slice of the new world that counts; the P(B) on the bottom is the new world itself.

Why divide by P(B)?

Dividing by \(P(B)\) is a re-basing step. Before you knew anything, every probability was measured against the whole sample space, which sums to 1. Once you condition on B, the leftover B-world is smaller than 1, so you rescale it back up to a full 100% by dividing by its size \(P(B)\). After that division the conditional probabilities of everything inside B add up to 1 again — a proper probability world of its own.

The numerator \(P(A \cap B)\) has to be the overlap, not all of A. Parts of A that sit outside B are gone: they were ruled out the moment B was announced.

See it on a grid of 100 outcomes

The simulation below shows 100 equally likely outcomes as a 10 by 10 grid, so a probability is simply a count out of 100. Use the sliders to set how many outcomes fall in event A (purple), in event B (blue), and in the overlap that is in both (green).

Then press Condition on B. Every square outside B fades out, and the readout's denominator drops from 100 to just the number of B cells. In that greyed, smaller world, \(P(A\mid B)\) is nothing more than the share of what remains that is green — the outcomes that are in A as well.

🎮 Interactive: restrict the sample space to B LIVE
A grid of 100 equally likely outcomes. Set the sizes of A, B, and their overlap, then press Condition on B to grey out everything else. P(A|B) is the green share of the B-world that is left — watch the denominator fall from 100 to the count of B cells.
✨ When conditioning changes nothing: independence
Sometimes learning B tells you nothing about A — the fraction of the B-world in A is the same as the fraction of the whole world in A. That is exactly what independence means: \(P(A\mid B) = P(A)\). In the grid, drag the overlap until \(P(A\mid B)\) matches \(P(A)\) and conditioning on B leaves A's chance untouched. Independence is a special balance point, not the usual case — most real events do shift each other's odds.
\[ P(A \mid B) = P(A) \quad\Longleftrightarrow\quad P(A \cap B) = P(A)\,P(B) \]
Two equivalent tests for independence. If knowing B leaves P(A) unchanged, then the overlap is exactly the product of the two probabilities — and vice versa.

Reading it off a two-way table

Most of the time you meet conditional probability as a table of counts. Picture 200 commuters, sorted two ways — how they travelled and whether they arrived on time:

  • Train riders: 120 — of these, 90 were on time and 30 were late.
  • Drivers: 80 — of these, 50 were on time and 30 were late.

The column totals are 140 on time and 60 late, adding to 200. To read a conditional like \(P(\text{Late}\mid\text{Drove})\), keep only the row you are conditioning on — the 80 drivers become your new denominator — and count the late ones inside it: \(30/80 = 0.375\). Compare that with the overall \(P(\text{Late}) = 60/200 = 0.30\): driving raises the chance of being late, so these two events are not independent.

\[ P(A \cap B) = P(A \mid B)\,P(B) \]
The multiplication rule — just the definition rearranged. It says the chance of A and B together is the chance of B, then the chance of A within B.
📝 Worked example: Using the commuter table (Train: 90 on time, 30 late; Drove: 50 on time, 30 late), find P(On time | Drove) — the probability a commuter was on time, given they drove.
  1. Condition on Drove: throw away the train row and keep only the 80 drivers. This is your new denominator.
  2. Count the outcomes in A (On time) inside that world: 50 of the drivers were on time.
  3. Apply the definition: \(P(\text{On time}\mid\text{Drove}) = \dfrac{50}{80}\).
✓ P(On time | Drove) = 50/80 = 0.625. Compared with the overall on-time rate of 140/200 = 0.70, drivers were on time a bit less often, so 'on time' and 'drove' are not independent.

Check your understanding

1. What does P(A | B) mean?
Conditioning on B restricts the world to B, then measures A's share inside that smaller world. It is not P(A and B), and it is not the same as P(A) unless the two events happen to be independent.
2. If P(A and B) = 0.2 and P(B) = 0.5, then P(A | B) equals…
P(A | B) = P(A and B) / P(B) = 0.2 / 0.5 = 0.4.
3. In the commuter table, 120 people took the train and 30 of them were late. What is P(Late | Train)?
Condition on the 120 train riders, then count the 30 late ones inside that group: 30/120 = 0.25. Dividing by the whole 200 would answer a different question, P(Late and Train).
4. Events A and B are independent exactly when…
Independence means knowing B does not change A's probability, so P(A | B) = P(A). Equivalently, P(A and B) = P(A) times P(B). P(A and B) = 0 would instead mean the events cannot both happen.
✅ Key takeaways
  • A conditional probability P(A|B) is computed inside the restricted world where B has happened — B becomes the new denominator.
  • The rule is P(A|B) = P(A and B) / P(B), defined only when P(B) > 0.
  • Rearranged, it gives the multiplication rule P(A and B) = P(A|B) times P(B).
  • On a two-way table, condition by keeping only the relevant row or column and dividing within it.
  • A and B are independent when conditioning changes nothing: P(A|B) = P(A), equivalently P(A and B) = P(A) times P(B).