Conditional probability

Kapitoly: Probability, Complementary phenomenon, Conditional probability, Probability of winning in Sportka, The probability of winning EuroJackpot

When calculating probability, we can add an additional condition to the random experiment. So a classic conditional probability problem might be the following example: we roll three dice. What is the probability that if a three is rolled on one of the dice, the total will be equal to seven?

Deriving the formula

Consider some random experiment (e.g., a roll of the dice) and two different phenomena A and B such that P(B) ≠ 0, i.e., the phenomenon B is not impossible. Then we can talk about conditional probability if we ask what is the probability of the phenomenon A, if the phenomenon B occurs ? We denote by P(A|B).

We will try to gradually arrive at a formula to calculate the conditional probability. For simplicity, let us imagine a tetrahedral die, i.e. a die on which only the numbers 1, 2, 3 or 4 can fall. Let's try to solve the problem: if we roll two tetrahedral dice, what is the probability that the sum of the values is equal to six if one of the dice rolled a number less than three?

We start by listing all the possibilities for the two tetrahedral dice. There are a total of 4 · 4 = 16.

$$\begin{eqnarray} &&[1, 1], [1, 2], [1, 3], [1, 4], \\ &&[2, 1], [2, 2], [2, 3], [2, 4], \\ &&[3, 1], [3, 2], [3, 3], [3, 4], \\ &&[4, 1], [4, 2], [4, 3], [4, 4] \end{eqnarray}$$

What do the phenomena A and B look like ? The phenomenon A is "the sum of the values on the dice is equal to six" and the phenomenon B is "a number less than three was rolled on one of the dice". And we are interested in the conditional probability of P(A|B) - what is the probability that the phenomenon A occurs if we know that the phenomenon B has occurred. First, we filter out from the previous table only those pairs that are also the phenomenon B, i.e. at least one number in the pair is less than three. We get:

$$\begin{eqnarray} &B=&[1, 1], [1, 2], [1, 3], [1, 4], \\ &&[2, 1], [2, 2], [2, 3], [2, 4], \\ &&[3, 1], [3, 2], \\ &&[4, 1], [4, 2] \end{eqnarray}$$

We can basically see this as the set of all possible outcomes. In fact, we may get two 4s on the dice, but we are saying by the additional condition B that we are not interested in such an outcome - we are only interested in outcomes where at least one dice has a number less than three.

And now we ask - now we just ask, what is the probability that the phenomenon A occurs if the set of all phenomena is equal to the set B? The conditional probability says nothing else. So in this set B we find those pairs that give a sum of six:

$$ [2, 4], [4, 2] $$

How would we now calculate the probability? We have a total of 2 favorable outcomes and the set of all outcomes is equal to the size of the set B, so 12. So the conditional probability is equal to

$$ P(A|B)=\frac{2}{12}=\frac16 $$

Now the point is how to generalize. We said that we can see the set B as the set of all possible solutions. What would the set of all favorable outcomes look like? It would be the set of those outcomes that are in A (that's the phenomenon we're interested in) but are also in B (that's the condition that constrains us). In other words, there is one more way that two tetrahedral dice can add up to 6: if a 3 is rolled on both of them. But that would not pass the condition B: at least one number is less than three in our case. Therefore, we do not include this result in the favorable solutions. The set of favorable solutions is thus equal to : A ∩ B, the intersection of the two phenomena. Putting this together, we get the formula:

$$ P(A|B) = \frac{|A \cap B|}{|B|}. $$

We can see from the formula why we assumed that P(B) ≠ 0; if this condition were not met, we would divide by zero, which could create a black hole.

The preceding formulas are valid if we are talking about the classical definition of probability, where all elementary phenomena have the same probability of occurrence. We can rewrite the formula in a more general form:

$$ P(A|B) = \frac{P(A\cap B)}{P(B)}. $$

Solved examples

  1. We roll two dice, black and white. What is the probability of rolling a four on the white die if the sum of the two values is equal to seven? Let's break it down: phenomenon A: "a four is rolled on the white die", phenomenon B (condition): "the sum is equal to seven". The phenomenon B contains all the pairs of values that add up to 7, i.e. B = {[1, 6], [2, 5], [3, 4], [4, 3], [5, 2], [6, 1]}. Now we compute A ∩ B, i.e. which pairs from B are also in A, i.e. that a four fell on the white die? Suppose the values are in the form [černá, bílá], so the only pair that belongs in A ∩ B is [3, 4]. Now we just plug in the formula:

$$ P(A|B) = \frac{|A \cap B|}{|B|}=\frac16. $$