Conditional Probability

Shodor > Interactivate > Discussions > Conditional Probability

Mentor: In the Three Boxes game, each box contains two chips: the first has two red chips, the second has two green chips, and the third has one red and one green chip. We do not know which box contains which chips. We take one chip out of a box without looking inside, and when we look at it we find it is green. What are the chances, theoretically speaking, that the second one is also green?

Student 1: There is only one box out of three that has two green chips, so the probability should be 1/3.

Student 2: We know that the first chip was green. There are only two boxes holding green chips. One of them has two green chips, so the probability is 1/2.

Student 1: But wait, we have played the game on the computer many times. The experimental probability was getting closer and closer to 2/3.

Mentor: We have three competing answers! It means that the problem is not very simple. Let us look at several easier problems and then return to The Three Boxes.

Mentor: Let us look at a dice game with two six-sided dice. The sum of the dice decides who wins (see Multi-dice fun for a detailed discussion of the game, or the activity page (Game 4) to play a related game). What is the probability that the sum of the numbers on the dice is seven?

Student: There are six ways of getting the sum of seven:

1, 6

2, 5

3, 4

4, 3

5, 2

6, 1

There are 36 possible ways two dice can roll, so the probability of the sum of seven is 6 out of 36, or 1/6.

Mentor: Let us call:

Event A={The sum of the numbers the dice show is 7 or 9}.
Event B={The second die shows 2 or 3}.

Let us compute P(A) and P(B) (the probabilities of Events A and B) using the most straightforward method: counting chances. That is, we can count the favorable situations and find the total number of outcomes. The following table lists the outcomes and sums of the dice in case of each outcome:

We can highlight the places in the table that correspond to all the outcomes in Event A and Event B:

Event A={The sum of the numbers the dice show is 7 or 9}.
Event B={The second die shows 2 or 3}.

Mentor: What is P(A) (the probability of Event A)?

Student: There are 10 outcomes in Event A out of 36 total outcomes, so P(A) = 10/36 = 5/18.

Mentor: What is the probability of getting a sum of 7 or 9, when we know that the second die has rolled a 2 or 3?

Student 1: Why is it not the same as P(A)?

Student 2: Because not all of the 36 outcomes are possible now. Even some of the outcomes that give the sum of 7 or 9 are impossible. We have to count the outcomes all over again.

Mentor: Mathematicians would say that our question is about conditional probability, because it asks: "What is the probability of Event A on condition of Event B? That is the same thing as "in the case of Event B." There even exists a special sign for just that kind of probability (when people invent something new, they often invent notation to go with it; you can make up your own notation when you invent something). Recall that instead of writing "the probability of Event A" we can simply write P(A). Well, instead of writing: " The probability of Event A on condition of Event B" people write:


Student: It's much shorter!

Mentor: To compute P(A/B), we can go through the same procedure. In order to have the sum of 7 or 9 if the second die rolls a 2 or 3, we must have the following pairs of numbers on the dice (see the table):

5, 2


4, 3


6, 3

That makes 3 outcomes. Out of what total number of possible outcomes? We now know for sure that Event B={The second die shows 2 or 3} happened. It means that the outcomes that are not in Event B are not possible. So, how many outcomes do we count as possible?

Student 1: Only the outcomes in Event B. There are 12 of them.

Student 2: So the conditional probability is:

P(A/B) = 3/12 = 1/4 = .25 or 25%

Mentor: I want to show you something. What is the probability that Events A and B happen at the same time?

Student: There are 3 outcomes out of 36 in this case, so we have P(A and B) = 3/36 = 1/12

Mentor: To summarize,

P(A/B) = 1/4

P(A and B) = 1/12

P(B) = 1/3

We also have 1/4 = (1/12) / (1/3)

In other words, if we divide the probability of A and B happening at the same time by the probability of B, we get the conditional probability P(A/B). In the language of formulas, it means:

P(A/B) = P(A and B)/P(B)

Is it a coincidence?

Student: If it were, you would not be asking.

Mentor: I could be, just for the fun of it... Anyway, why do you think it is not a coincidence?

Student 1: How were we computing P(A/B)? First of all, we took the number of outcomes that were in A and B at the same time. Then we divided it by the number of outcomes in B:

Student 2: It looks much like your formula for conditional probability, only we have the numbers of outcomes instead of probabilities. Can we turn them into probabilities somehow?

Mentor: How do you get the probability of an event if you know the number of outcomes in the event?

Student: I figure out the total number of all possible outcomes and divide by it.

Mentor: You know, it does not change the fraction if you divide both the numerator and the denominator by the same number...

Student: I know! If we divide both the numerator and the denominator of the outcome formula by the total number of outcomes, we will get the probability formula:

which is the same as:

Mentor: Let us try other examples to see if this conditional probability rule always works.

Student 1: I will call

Event K = {The first die rolls 5 or 6} and

Event L = {The second die rolls 1}

What is the probability of K on condition of L?

Student 2: It is 2/6 = 1/3. Looking at the table, I see that there are 2 outcomes in K that can happen if L happens: (5, 1) and (6, 1). The total number of possible outcomes is 6, all the outcomes in L.

Student 1: The formula also works, because:

P(K/L) = P(K and L) / P(L) = (2/36) / (6/36) = 1/3

Mentor: By the way, if you remember the discussion and the formula for two independent events happening simultaneously, you can use it to find P(K and L).

Student: The formula is:

P(K and L) = P(K) * P(L),

so P(K and L) = 2/6 * 1/6 = 2/36

The same number we got by counting the outcomes.

Mentor: Let us now look at The Three Boxes Game. Do you think you can solve the mystery now?

Student 1: The Three Boxes Game is all about conditional probability. The question is: "What is the probability that the second chip in the box is green, given that the first one is green?" We can use the formula to solve it. Let us call:

Event A = {the second chip in the box is green}

Event B = {the first chip in the box is green}

Then we are looking for P(A/B), and we can use the formula P(A/B) = P (A and B) / P(B).

Student 2: P(A and B) = 1/3, because there is one box out of three where both chips are green.

Student 1: P(B) = 3/6 = 1/2, because there are three green chips out of six total.

Student 2: Then the formula gives us:

P(A/B) = (1/3) / (1/2) = 2/3

Mentor: Ta-da! We got the same number in the experiments.

a resource from CSERD, a pathway portal of NSDL NSDL CSERD