Skip to main content

Conditional probability

If two events are not independent, then the outcome of one event can change the probability of the second event occurring. Understanding the connection between these helps us make better predictions and decisions based on specific situations. Use this resource to learn about the concept of conditional probability.

Conditional probability is the chance that something happens, given that another event has already occurred.

Blue marbles.
Pulling different coloured marbles from a bag without replacing them is a good example to demonstrate conditional probability. Image by InspiredImages, via Pixabay

Dependent events

Conditional probability often involves dependent events. Two events are dependent if the outcome or occurrence of the first affects the probability of the second.

For example, if you draw a card from a deck and don't replace it, the probability of drawing a second card of a certain type depends on the first draw.

In the same way, if you know that it is raining, the chance of carrying an umbrella might be higher.

When two events, A and B, are dependent, the probability of both occurring is given by:

Pr(A and B)=Pr(AB)=Pr(A)×Pr(B|A)

We can rearrange this rule to find conditional probability. The probability of B given that A has occurred already is given by Pr(B|A), where:

Pr(B|A)=Pr(AB)Pr(A)

The probability of A given that B has occurred already is given by Pr(A|B), where:

Pr(A|B)=Pr(AB)Pr(B)

Example 1 – calculating conditional probability

A card is chosen at random from a pack. If the first card chosen is the jack of diamonds and it is not replaced, what is the probability that the second card is:

  1. a diamond?
  2. a jack?
  3. the queen of clubs?

Because the first card was the jack of diamonds and not replaced, there is one less diamond in the pack and one less card in the pack. There are 12 diamonds remaining in the deck of 51 cards. Here, the second event is dependent on the first event because there is no replacement of cards.
Pr(2|J1)=1251=417

After a jack of diamonds is drawn, there are 3 jacks remaining in the deck of 51 cards. Here, the second event is also dependent on the first event because there is no replacement of cards
Pr(J2|J1)=351=117

There is only 1 queen of clubs in the remaining deck of 51 cards. Here, the second event is independent of the first event.
Pr(Q2|J1)=151

Find the probability of obtaining two jacks if two cards are drawn is succession from a pack:

  1. with replacement
  2. without replacement.

If the cards are replaced, then the events are independent.
Pr(J1J2)=Pr(J1)×Pr(J2)=452×452=1169

If the cards are not replaced, then the probability of the second draw depends on the first draw—that is, they are dependent and the probability is conditional.
Pr(J1J2)=Pr(J1)×Pr(J2|J1)=452×351=1221

Find the Pr(A|B) if Pr(A)=0.7, Pr(B)=0.5 and Pr(AB)=0.8.

First, find Pr(AB).
Pr(AB)=Pr(A)+Pr(B)Pr(AB)0.8=0.7+0.5Pr(AB)Pr(AB)=0.7+0.50.8=0.4

Then, we can use the conditional probability equation:
Pr(A|B)=Pr(AB)Pr(B)=0.40.5=0.8

In a class of 15 girls and 12 boys, two students are to be randomly chosen to collect homework. What is the probability that both students chosen are girls?

If one girl is chosen first, there will be 14 girls out of the remaining 26 students to pick from. This probability is conditional.
Pr(G1G2)=Pr(G1)×Pr(G2|G1)=1527×1426=210702=35117

Given the information in the following table, find the probability that someone was sunburnt given that they were not wearing a hat.

Sunburnt Not sunburnt
Hat 3 77 80
No hat 12 8 20
15 85 100

We can let H be the event where a person is not wearing a hat. We are looking for Pr(S|H), the probability that a person is sunburnt, given that they were not wearing a hat.

Another way to do conditional probability is to reduce the sample space. The total sample space is 100 people. We can reduce this by excluding people wearing a hat. The sample space becomes 20.

Of this 20, 12 got sunburnt, so:
Pr(S|H)=1220=35

Exercise – calculating conditional probability

  1. The results of a survey of music preferences are shown in the Venn diagram.
    Venn diagram of music survey
    Music Survey, by RMIT is licensed under CC BY 4.0
    Find the probability that a student likes live music given that they like karaoke.
  2. Three cards are chosen at random from a pack without replacement. What is the probability of choosing 3 aces?
  3. In a maths class of 20 students, 5 failed the final exam. If 2 students are chosen at random without replacement, what is the probability that the first passed but the second failed?
  4. If Pr(X)=0.5, Pr(Y)=0.5 and Pr(XY)=0.2, find the probability of:
    1. Pr(X|Y)
    2. Pr(XY)
    3. Pr(X)×Pr(Y|X)
  5. In a family with three children, what is the probability that all three children will be girls given that the first child is a girl?

  1. 38
  2. 15525
  3. 1576
    1. 0.4
    2. 0.8
    3. 0.2
  4. 0.25

Keywords