topic badge

5.05 Conditional probability

Introduction

We learned how to find probabilities for independent events in lesson  12.02 Probability  using the multiplication rule. Now, we will learn how to find probabilities when the events are not mutually exclusive and determine the independence of those events.

Conditional probability

In probability, an event is a set of outcomes of an experiment to which a probability is assigned. Two events in the same experiment can be classified as either independent or dependent events.

Independent events

Two events are independent if the occurrence of one event does not affect the likelihood of the occurrence of the other event

Example:

The outcomes of flipping two coins

Dependent events

Two events are dependent if the occurrence of one event affects the likelihood of the occurrence of the other event

Example:

The outcomes of drawing two cards in a standard deck without replacement

Conditional probability

Notated as P\left(B \vert A\right), it is the probability that event B occurs given that event A has already occurred

Example:

The probability of drawing a diamond from a standard deck of cards given a red card has been drawn without placement

Exploration

Vanessa has 12 songs in a playlist. Four of the songs are her favorite. She selects shuffle and the songs start playing in random order. Shuffle ensures that each song is played only once until all songs in the playlist have been played. Find the probability that:

  • The first song is one of her favorites
  • Two of her favorite songs are the first to be played
  • The first song is not one of her favorites, but the second one is one of her favorites
  1. Explain how you found each probability.
  2. Are the events in the last two scenarios independent or dependent?

Probability of Independent Events:

If two events, A and B, are independent, then the probability of both events occurring is the product of the probability of A and the probability of B:

\displaystyle P\left(A \cap B \right)=P\left(A\right) \cdot P\left(B\right)
\bm{P\left(A\right)}
Probability of event A
\bm{P\left(B\right)}
Probability of event B

Probability of Dependent Events:

For dependent events, the probability of B occurring depends on whether or not A occurred. The probability of both events occurring is the product of the probability of A and the probability of B after A occurs:

\displaystyle P\left(A \cap B \right)=P\left(A\right) \cdot P\left(B \vert A\right)
\bm{P\left(A\right)}
Probability of event A
\bm{P\left(B \vert A\right)}
Probability of event B given event A has occurred

If we need to find the conditional probability of P\left(B\vert A\right), we can solve the above formula to get:

\displaystyle P\left( B \vert A \right)=\dfrac{P\left( A \cap B \right)}{P\left( A \right)}
\bm{P\left(A \cap B\right)}
Probability of A and B
\bm{P\left(A\right)}
Probability of event A

We read P\left( B \vert A \right) as "The probability of B given A". This formula can be used to determine whether two events are independent.

For two independent events, A and B, we know from above that the probability of both happening is {P\left(A \cap B\right)=P\left(A\right)\cdot P\left(B\right)}. Substituting this into the conditional probability formula, we get:

\displaystyle P\left(B \vert A \right)\displaystyle =\displaystyle \dfrac{P\left(A\cap B\right)}{P\left(A\right)}
\displaystyle =\displaystyle \dfrac{P\left(A\right)\cdot P\left(B\right)}{P\left(A\right)}
\displaystyle =\displaystyle P\left(B\right)

and:

\displaystyle P\left( A \vert B \right)\displaystyle =\displaystyle \dfrac{P\left(A\cap B\right)}{P\left(B\right)}
\displaystyle =\displaystyle \dfrac{P\left(A\right)\cdot P\left(B\right)}{P\left(B\right)}
\displaystyle =\displaystyle P\left(A\right)

Therefore, events A and B are independent if P\left( B \vert A \right)=P\left(B\right) and P\left( A \vert B \right)=P\left(A\right). This reflects the definition of independent events, where the outcome of one event does not affect the likelihood of the occurrence of the other event.

Examples

Example 1

Charlie is going to randomly select a sequence of cards from a deck. If event A occurs just before event B, explain whether the following events are independent or dependent.

a

Event A: Selecting a red card and replacing it

Event B: Selecting a red queen

Worked Solution
Create a strategy

There are 2 red queens in a standard deck of cards, so the probability of selecting a red queen is \frac{2}{52}. If the events are independent, then this will remain the same regardless of which card was selected first. If the events are dependent, then this probability would change after the selection of the first card.

We can ask ourselves: will the probability of selecting a red queen change if a red card is selected first and replaced?

Apply the idea

Because the first card has been replaced, the probability of selecting a red queen will not be affected. The events are independent.

b

Event A: Selecting a black card without replacing it

Event B: Selecting a red queen

Worked Solution
Create a strategy

To determine if the events are dependent or independent, we can ask ourselves: Will the probability of selecting a red queen still be \frac{2}{52} if the first card was not replaced?

Apply the idea

Because the first card has not been replaced, the probability of selecting a red queen will be affected because the total number of cards has changed. The events are dependent.

Example 2

A group of people were asked whether they went on a vacation last summer. The results are provided in the given table:

VacationNo vacationTotal
Male222648
Female322052
Total5446100

Find the probability that a randomly selected person went on a vacation, given that they are male.

Worked Solution
Create a strategy

For this event, A represents the people that went on vacation, and B represents the people that are male.

First we should find P\left(\text{B}\right) and P\left(A \cap B\right) and then substitute the values into the formula for P\left(A \vert B\right).

Apply the idea
\displaystyle P\left(\text{B}\right)\displaystyle =\displaystyle P\left(\text{Male}\right)
\displaystyle \text{}\displaystyle =\displaystyle \dfrac{48}{100}There were 48 males out of 100 people surveyed.
\displaystyle P\left(A \cap B\right)\displaystyle =\displaystyle P\left(\text{Vacation} \cap \text{Male}\right)
\displaystyle \text{}\displaystyle =\displaystyle \dfrac{22}{100}There were 22 males that went on vacation out of the 100 people surveyed.
\displaystyle P\left(A \vert B\right)\displaystyle =\displaystyle \dfrac{P\left( A \cap B \right)}{P\left( B \right)}Conditional probability formula
\displaystyle P\left(\text{Vacation} \vert \text{Male}\right)\displaystyle =\displaystyle \dfrac{P\left( \text{Vacation} \cap \text{Male} \right)}{P\left( \text{Male} \right)}
\displaystyle \text{}\displaystyle =\displaystyle \dfrac{\dfrac{22}{100}}{\dfrac{48}{100}}
\displaystyle \text{}\displaystyle =\displaystyle \dfrac{11}{24}

The probability that a person went on a vacation, given that they are male, is \dfrac{11}{24}.

Reflect and check

Alternatively, we could find this probability using a different method.

Because it is given that the person is a male, we are only selecting the person out of the 48 males that were surveyed. So the total number of outcomes is 48. The number of these people that went on vacation is 22. So the number of outcomes that match the event is 22. So can use the following formula:

\displaystyle P\left(\text{event}\right)\displaystyle =\displaystyle \dfrac{\text{number outcomes that match the event}}{\text{total number of possible outcomes}}
\displaystyle P\left(\text{Vacation} \vert \text{Male}\right)\displaystyle =\displaystyle \dfrac{22}{48}
\displaystyle \text{}\displaystyle =\displaystyle \dfrac{11}{24}

Example 3

A pile of playing cards has 4 diamonds and 3 hearts. One card is selected at random from the pile without replacement, then a second card is drawn.

Find the probability of selecting two hearts.

Worked Solution
Create a strategy

To model the situation, a tree diagram can be drawn. The sample space is:

  • Diamond, diamond
  • Diamond, heart
  • Heart, diamond
  • Heart, heart

Then, we can use the diagram to find the probability of selecting a heart and another heart. If we let event A represent drawing a heart first and event B represent drawing a heart second, we can use the notation P\left(A\cap B\right).

Apply the idea

For the first card, the probability of drawing a diamond is \dfrac{4}{7}, and the probability of drawing a heart is \dfrac{3}{7}. The probabilities for the second card are dependent on which card was drawn first.

The total number of cards will reduce to 6 because the first card was not replaced. If a diamond was selected first, then the number of diamond cards is now 3 and hearts will stil be 3. If a heart was selected first, then the number of diamond cards is still 4 and hearts will now be 2.

The probability tree shows this situation with the correct probability on each branch:

Because these events are dependent, we must use the formula {P\left(A\cap B\right)=P\left(A\right)\cdot P\left(B\vert A\right)} to find the probability of drawing two hearts.

The probability of selecting a heart first is P\left(A\right)=\dfrac{3}{7}

The probability of selecting a heart given a heart was selected first is P\left(B\vert A\right)=\dfrac{2}{6}

So the probability of selecting two hearts is

\displaystyle P\left(A\cap B\right)\displaystyle =\displaystyle \dfrac{3}{7}\cdot \dfrac{2}{6}
\displaystyle =\displaystyle \dfrac{6}{42}
\displaystyle =\displaystyle \dfrac{1}{7}

Example 4

Elia selects one card from a standard deck of 52 cards:

A standard deck of 52 cards with 2 black suits, clubs and spades, and 2 red suits, hearts and diamonds. Each suit has 13 cards: Ace, King, Queen, Jack, 10, 9, 8, 7, 6, 5, 4, 3, and 2.

She considers the following events:

  • Event A: A face card will be selected.

  • Event B: A red card will be selected.

a

Describe P\left( A \vert B \right).

Worked Solution
Create a strategy

The notation P\left( A \vert B \right) means the probability of A given B. This tells us that the event B has already happened, and we want to find the probability that event A has also happened.

Apply the idea

P\left( A \vert B \right) is the probability that the selected card is a face card, given that it is a red card.

b

Describe P\left( B \vert A \right).

Worked Solution
Create a strategy

The notation P\left( B \vert A \right) means the probability of B given A. This tells us that the event A has already happened, and we want to find the probability that event B has also happened.

Apply the idea

P\left( B \vert A \right) is the probability that the selected card is a red card, given that it is a face card.

c

Describe P\left( A \cap B\right).

Worked Solution
Create a strategy

The notation P\left( A \cap B \right) means the probability that both A and B occur.

Apply the idea

Given the events A and B, P\left( A \cap B\right) is the probability that both a face card and a red card is selected. This is the probability that a red face card is selected.

d

Determine if A and B are independent events using conditional probability.

Worked Solution
Create a strategy

Events A and B are independent if P\left( A \vert B \right)=P\left(A\right) and P\left( B \vert A \right)=P\left(B\right).

So we will need to find P\left(A\right), P\left(B\right), P\left(A \vert B\right), and P\left(B \vert A\right) to determine whether A and B are independent.

Apply the idea

The total number of cards is 52. There are 12 face cards and 26 red cards. These give us P\left(A\right)=\dfrac{12}{52}=\dfrac{3}{13} and P\left(B\right)=\dfrac{26}{52}=\dfrac{1}{2}

Out of the 26 red cards, 6 of them are face cards. This gives us P\left( A \vert B \right)=\dfrac{6}{26}=\dfrac{3}{13}.

Out of the 12 face cards, 6 of them are red. This gives us P\left( B \vert A \right)=\dfrac{6}{12}=\dfrac{1}{2}.

Since P\left( A \vert B \right)=P\left(A\right) and P\left(B \vert A \right)=P\left(B\right), we have shown that A and B are independent events.

Reflect and check

In the previous lesson, we verified independence by determining if P\left(A\cap B\right)=P\left(A\right)\cdot P\left(B\right) which we can also use to check our answer:

There are 6 red face cards, so P\left(A\cap B\right)=\dfrac{6}{52}=\dfrac{3}{26}

P\left(A\right)\cdot P\left(B\right)=\dfrac{3}{13}\cdot \dfrac{1}{2}=\dfrac{3}{26}

Therefore, P\left(A\cap B\right)=P\left(A\right)\cdot P\left(B\right) and the events are independent.

Example 5

Use conditional probability to determine if the following events are independent or not.

A group of students were asked whether they own a laptop and a tablet. The results of a survey showed that 8 students own both a laptop and tablet, 15 only own a laptop, 10 only own a tablet, and 17 own neither.

Worked Solution
Create a strategy

Let the probability of having a laptop be P\left(\text{L}\right) and the probability of having a tablet be P\left(\text{T}\right). We could test the independence of the two events by determining if P\left(\text{L} \vert \text{T}\right)=P\left(\text{L}\right) and {P\left(\text{T} \vert \text{L}\right)=P\left(\text{T}\right)} are true.

To help organize our data, we can put it into a table:

Own a tabletDo not own a tablet
Own a laptop815
Do not own a laptop1017
Apply the idea

Since we will be finding probabilities, we will need to know the totals of each of the rows and columns. Finding the sums, we get:

Own a tabletDo not own a tabletTotal
Own a laptop81523
Do not own a laptop101727
Total183250

From the table, we need to determine P\left(\text{L}\right), P\left(\text{T}\right), P\left(\text{L} \vert \text{T}\right), and P\left(\text{T} \vert \text{L}\right).

  1. We can determine P\left(\text{L}\right) by taking the sum of the row "Own a laptop" and dividing it by the total number of students. P\left(\text{L}\right) = \dfrac{23}{50}

  2. We can determine P\left(\text{T}\right) by taking the sum of the column "Own a tablet" and dividing it by the total number of students. P\left(\text{T}\right) = \dfrac{18}{50}=\dfrac{9}{25}

  3. P\left(\text{L} \vert \text{T}\right) is the probability that a student owns a laptop given they own a tablet. Looking at the table, we see there are 18 total tablet owners and 8 of them also have laptops. P\left(\text{L} \vert \text{T}\right)=\dfrac{8}{18}=\dfrac{4}{9}

  4. P\left(\text{T} \vert \text{L}\right) is the probability that a student owns a tablet given they own a laptop. Looking at the table, we see there are 32 total laptop owners and 8 of them also have tablets. P\left(\text{T} \vert \text{L}\right)=\dfrac{8}{23}

Determining if the two events are independent:

\displaystyle P\left(\text{L} \vert \text{T}\right)\displaystyle =\displaystyle P\left(\text{L}\right)Prbability of independent events
\displaystyle \dfrac{4}{9}\displaystyle \neq\displaystyle \dfrac{23}{50}Substitute known values
\displaystyle P\left(\text{T} \vert \text{L}\right)\displaystyle =\displaystyle P\left(\text{T}\right)Prbability of independent events
\displaystyle \dfrac{8}{23}\displaystyle \neq\displaystyle \dfrac{9}{25}Substitute known values

Since P\left(\text{L} \vert \text{T}\right)\neq P\left(\text{L}\right) and P\left(\text{T} \vert \text{L}\right)\neq P\left(\text{T}\right), the two events are dependent.

Reflect and check

Instead of using the table to find P\left(\text{L} \vert \text{T}\right), we could have used the conditional probability formula. We can determine P\left(\text{L}\cap\text{T}\right) by taking the number of students that own both a laptop and a tablet and dividing it by the total number of students. P\left(\text{L}\cap\text{T}\right)=\dfrac{8}{50}

Now, we can use the formula to find P\left(\text{L}\vert \text{T}\right) and P\left(\text{T}\vert \text{L}\right):

\displaystyle P\left(\text{L} \vert \text{T}\right)\displaystyle =\displaystyle \dfrac{P\left(\text{L}\cap\text{T}\right)}{P\left(\text{T}\right)}Conditional probability
\displaystyle =\displaystyle \dfrac{\frac{8}{50}}{\frac{18}{50}}Substitute known values
\displaystyle =\displaystyle \dfrac{8}{18}Evaluate the division
\displaystyle P\left(\text{T} \vert \text{L}\right)\displaystyle =\displaystyle \dfrac{P\left(\text{L}\cap\text{T}\right)}{P\left(\text{L}\right)}Conditional probability
\displaystyle =\displaystyle \dfrac{\frac{8}{50}}{\frac{23}{50}}Substitute known values
\displaystyle =\displaystyle \dfrac{8}{23}Evaluate the division

These are the same conditional probabilities we found before, so we still would have found the events to be dependent.

Idea summary

For dependent events, the probability of one event affects the likelihood of the other event. For events A and B, the probability of both occurring is:

\displaystyle P\left(A \cap B \right)=P\left(A\right) \cdot P\left(B \vert A\right)
\bm{P\left(A\right)}
Probability of event A
\bm{P\left(B \vert A\right)}
Probability of event B given event A has occurred

If we need to find the conditional probability of P\left(B\vert A\right), the probability of B given A, we can solve the above formula to get:

\displaystyle P\left( B \vert A \right)=\dfrac{P\left( A \cap B \right)}{P\left( A \right)}
\bm{P\left(A \cap B\right)}
Probability of A and B
\bm{P\left(A\right)}
Probability of event A

Events A and B are independent if P\left( B \vert A \right)=P\left(B\right) and P\left( A \vert B \right)=P\left(A\right).

Outcomes

S.CP.A.3

Understand the conditional probability of A given B as P(A and B)/P(B), and interpret independence of A and B as saying that the conditional probability of A given B is the same as the probability of A, and the conditional probability of B given A is the same as the probability of B.

S.CP.A.4

Construct and interpret two-way frequency tables of data when two categories are associated with each object being classified. Use the two-way table as a sample space to decide if events are independent and to approximate conditional probabilities.

S.CP.A.5

Recognize and explain the concepts of conditional probability and independence in everyday language and everyday situations.

S.CP.B.6

Find the conditional probability of A given B as the fraction of B's outcomes that also belong to A, and interpret the answer in terms of the model.

S.CP.B.8 (+)

Apply the general multiplication rule in a uniform probability model, P(A and B) = P(A)P(B|A) = P(B)P(A|B), and interpret the answer in terms of the model.

S.MD.B.6 (+)

Use probabilities to make fair decisions.

What is Mathspace

About Mathspace