Leave lesson

Probability · Combined events & tree diagrams

1 / 17

Conditional probability

Why "given that" shrinks the sample space to the group you were told about, so the denominator becomes that group's total — and why P(A given B) and P(B given A) are two different questions with two different answers.

Probability · Combined events & tree diagrams

Conditional probability

Why "given that" shrinks the sample space to the group you were told about, so the denominator becomes that group's total — and why P(A given B) and P(B given A) are two different questions with two different answers.

Why it works

Every probability you have met so far has the same shape:

P(event)=number of outcomes in the eventnumber of outcomes altogether.P(\text{event}) = \frac{\text{number of outcomes in the event}}{\text{number of outcomes altogether}}.

That bottom number is the sample space — the list of everything that could have happened. A "given that" question does not change how you count the top of the fraction. It changes the bottom, because the words given that tell you that a whole chunk of the sample space did not happen and is no longer in the running.

The idea in one sentence: "given that" shrinks the sample space to the group you were told about.

Here is a two-way table for 100100 pupils, recording their year group and whether they walk to school.
WalksDoes not walkTotal
Year 10121233334545
Year 11212134345555
Total33336767100100
Pick a pupil at random from all 100100. The probability they walk is 33100=0.33\frac{33}{100} = 0.33 — the whole table is the sample space, so 100100 sits on the bottom.

Now change the question: given that the pupil is in Year 10, what is the probability they walk? The condition has done something physical to the table. The Year 11 row is gone. You are no longer choosing from 100100 pupils, you are choosing from the 4545 pupils in the Year 10 row, and 1212 of those 4545 walk:

P(walksYear 10)=1245=4150.267.P(\text{walks} \mid \text{Year 10}) = \frac{12}{45} = \frac{4}{15} \approx 0.267.

Nothing clever happened. It is still favourable ÷\div total. It is just that "total" now means the total of the row you were told about, not the grand total. Writing 12100\frac{12}{100} instead would be answering a different question — "what is the probability the pupil is in Year 10 and walks?" — because that fraction is still measuring against all 100100 pupils.

Why the formula is the same thing. You will sometimes see conditional probability written as

P(AB)=P(A and B)P(B).P(A \mid B) = \frac{P(A \text{ and } B)}{P(B)}.

That is not a new rule; it is the counting above with everything divided by 100100. Take 1245\frac{12}{45} and divide top and bottom by the grand total:

1245=12/10045/100=0.120.45=P(Year 10 and walks)P(Year 10).\frac{12}{45} = \frac{12/100}{45/100} = \frac{0.12}{0.45} = \frac{P(\text{Year 10 and walks})}{P(\text{Year 10})}.

Same number, 0.2670.267. So if a question hands you probabilities instead of frequencies, divide; if it hands you a table of counts, just read the row.

The reversal trap, with numbers that prove it. P(AB)P(A \mid B) and P(BA)P(B \mid A) are different questions and usually have different answers, because they are measured against different groups. From the same table:
  • P(walksYear 10)=12450.267P(\text{walks} \mid \text{Year 10}) = \dfrac{12}{45} \approx 0.267 — out of the Year 10 row.
  • P(Year 10walks)=12330.364P(\text{Year 10} \mid \text{walks}) = \dfrac{12}{33} \approx 0.364 — out of the walkers column.
The top of both fractions is the same cell, 1212: those are the pupils who are in Year 10 and walk, and swapping the order of "and" changes nothing. What changes is the group you are choosing from — a row of 4545 against a column of 3333. Getting 0.2670.267 when the question wanted 0.3640.364 is not a rounding slip; it is answering the other question entirely.

A blunter example fixes the idea for good. Almost everyone who has just been struck by lightning is outdoors, so P(outdoorsstruck)P(\text{outdoors} \mid \text{struck}) is close to 11. Almost nobody outdoors has just been struck by lightning, so P(struckoutdoors)P(\text{struck} \mid \text{outdoors}) is close to 00. Same two events, same overlap, wildly different answers — because the denominators are wildly different sizes.

Running it backwards. Because P(AB)P(A \mid B) is (the count in the overlap) ÷\div (the size of group BB), knowing the conditional probability and the size of the group hands you the overlap by multiplying:

overlap=P(AB)×n(B).\text{overlap} = P(A \mid B) \times n(B).

If 4040 people ordered a dessert and P(ice creamdessert)=0.35P(\text{ice cream} \mid \text{dessert}) = 0.35, then 0.35×40=140.35 \times 40 = 14 people had ice cream. Note the multiplier lands on 4040 — the group named after the word "given" — and never on the grand total. That single missing frequency is often all you need to finish a table.

Testing independence. Two events are independent when knowing one happened tells you nothing about the other. Written in this language, that is

P(AB)=P(A).P(A \mid B) = P(A).

The condition shrank the sample space, but the proportion inside the smaller group came out the same as in the whole group. In the table above, P(walks)=0.33P(\text{walks}) = 0.33 but P(walksYear 10)0.267P(\text{walks} \mid \text{Year 10}) \approx 0.267 — those are not equal, so walking to school and year group are not independent here: hearing "Year 10" really does change the odds. The comparison that decides independence is always the conditional against the plain probability. Comparing P(AB)P(A \mid B) with P(BA)P(B \mid A) tests nothing at all.