sciandu
Mathematics

Mathematics

Conditional probability

Once you already know something, the odds look different. How to read that off a two by two table.

How likely is it that someone in your class turns up late for a lesson? Counted across everyone, that is maybe one person in four. Now somebody tells you: this person comes by bus. Straight away you judge it differently, because buses get stuck in traffic. That is what this topic is about: an extra piece of information changes a probability, often by quite a lot.

Knowing shrinks the group

A conditional probability is the probability of an event once you already know that something else is true. It is written P(AB)P(A|B) and read as: the probability of AA given BB. The idea behind it is simple. You no longer look at all the cases, only at the smaller group in which BB holds. Inside that group you then count favourable over possible cases exactly as usual.

The two by two table

Two features at once can be sorted into a two by two table. Example: 40 children were asked how they get to school and whether they were late today. 20 come by bus, 8 of them were late and 12 on time. 20 come on foot, 2 of them were late and 18 on time. Those four numbers are the four cells, and around the edge sit the totals: 10 children late, 30 on time, 40 altogether. Each edge total is a whole group, each cell is a case where both things apply together.

Now you calculate inside that group only: of the 20 bus children, 8 were late, so 8 divided by 20, which is 0.4. Without that information it would have been 10 out of 40 children, so only 0.25. Among the children on foot it is 2 out of 20, so 0.1. The same question, three different numbers, depending on what you already know. That is exactly why the condition is worth having: it sharpens the prediction. Sometimes, though, the same number comes out as without the condition. The extra information then carries nothing new, and the two features are called independent. That is the special case.

P(AB)=nABnBP(A\mid B) = \frac{n_{A \cap B}}{n_B}
Count the cases where A and B apply together and divide by all cases with B.
Marble bag
Blue3
Yellow5
P(Blue) = 3/8 = 37.5%
Try it: set 2 blue and 3 yellow marbles and the bag shows P(blue) = 40%. Now draw one yellow marble and put it aside, which leaves 2 blue and 2 yellow. Set that, and 40% turns into 50%. Those 50% are the conditional probability of blue given that you know the first marble was yellow.

Swapping the condition gives something else

P(AB)P(A|B) and P(BA)P(B|A) look almost the same, yet they mean different things. For our 40 children: of the 20 bus children, 8 were late, which is 0.4. But of the 10 late children, 8 came by bus, which is 0.8. The top is the same 8 both times, the bottom is a different group, so the answer differs. Mixing these up leads to wrong conclusions fast, for instance when reading results of medical tests.

Exercises

0 of 6 solved

Time to try it yourself. You can't break anything, every attempt counts.

What does P(AB)P(A|B) mean?

In a bakery 100 guests were surveyed. 40 bought cake, 50 bought coffee, 30 bought both. What is the probability that a guest bought cake? Give it as a decimal.

Same bakery: 100 guests, 40 with cake, 50 with coffee, 30 with both. How likely is it that a guest bought cake, given that they bought coffee? Give the result as a decimal.

For P(AB)P(A|B) you divide the number of cases with A and B by the number of cases with .

Why is the probability of cake among coffee buyers, 0.6, larger than the 0.4 among all guests?

Match each probability to the count you divide by when working it out.

P(A)P(A)
P(AB)P(A|B)
P(BA)P(B|A)

Where this leads