Conditional probability
When calculating probability, we can add an extra condition to a probability experiment. A classic conditional probability problem is the following: we roll three dice. What is the probability that the total is seven, given that one of the dice shows a three?
Deriving the formula
Take a probability experiment (for example rolling dice) and two different events A and B such that P(B) ≠ 0, that is, the event B is not impossible. Then we can talk about conditional probability when we ask: what is the probability of the event A if the event B has happened? We write this P(A ∣ B).
Let’s try to work our way to a formula that we can use to calculate conditional probability. To keep things simple, imagine a four-sided dice, that is, a dice that can only show the numbers 1, 2, 3 or 4. We will try to solve this problem: when we roll two four-sided dice, what is the probability that the sum of the values is six, given that at least one of the dice shows a number less than three?
We start by listing all the outcomes we can get with two four-sided dice. There are 4 · 4 = 16 of them.
What do the events A and B look like? The event A is: “the sum of the values on the dice is six” and the event B is: “at least one of the dice shows a number less than three”. And we are interested in the conditional probability P(A ∣ B) – the probability that the event A happens, given that we know the event B has happened. First, from the previous table we pick out only those pairs that are also in the event B, that is, at least one number in the pair is less than three. We get:
We can essentially see this as the set of all possible outcomes. Strictly speaking, the dice could show two fours, but with the extra condition B we are saying that such an outcome does not interest us – we only care about outcomes where at least one dice shows a number less than three.
And now we simply ask: what is the probability that the event A has happened, if the set of all outcomes is equal to the set B? That is all that conditional probability says. So in this set B we find the pairs that give a sum of six:
How would we work out the probability now? We have 2 favourable outcomes in total, and the set of all outcomes has the size of the set B, that is, 12. The conditional probability is therefore
And now the question is how to generalise this. We said that we can see the set B as the set of all possible outcomes. What would the set of all favourable outcomes look like? It would be the set of outcomes that are in A (that is the event we are interested in) but are also in B (that is the condition that restricts us). In other words: there is one more way for two four-sided dice to give a sum of 6: when both show a three. But in our case that would not pass the condition B: at least one number is less than three. So we do not include this outcome among the favourable outcomes. The set of favourable outcomes is therefore A ∩ B, the intersection of the two events. Putting this together, we get the formula:
The formula shows why we assumed that P(B) ≠ 0; if this condition were not met, we would be dividing by zero, which could create a black hole.
The previous formula holds when we are talking about theoretical probability, where all the elementary events have the same probability of occurring. We can rewrite the formula in a more general form:
Worked examples
- We roll two dice, one black and one white. What is the probability that the white dice shows a four, given that the sum of the two values is seven? Let’s write it out: event A: “the white dice shows a four”, event B (the condition): “the sum is seven”. The event B contains all the pairs of values that add up to 7, that is, B = {(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)}. Now we work out A ∩ B, that is, for which pairs in B is it also true that they are in A, in other words that the white dice shows a four? Suppose the values are in the form (black, white), so the only pair that belongs to A ∩ B is (3, 4). Now we just substitute into the formula:
Chapters: Probability, Complementary event, Binomial distribution, Conditional probability, Probability of winning a 6 from 49 lottery (Sportka), Probability of winning the Eurojackpot