topic badge
Middle Years

8.02 Conditional probability

Lesson

Conditional probability

We are often interested in probabilities under certain conditions. For example what is the probability of it snowing tomorrow given the temperature today, or if an even number is rolled on a die what is the probability that it is a six. Giving conditions will reduce the sample space we are concerned with. 

For two events $A$A and $B$B the probability of event $A$A occurring given that event $B$B has occurred has the notation $P\left(A|B\right)$P(A|B) which is read as the "probability of $A$A given $B$B".

Worked examples

Example 1

What is the probability of rolling a $6$6 given that an even number has been rolled?

Think: Let's  define the two events involved, event $A$A: rolling a six and event $B$B: rolling an even number.

Do: Since we know an even number has been rolled the possible outcomes has reduced from $\left\{1,2,3,4,5,6\right\}${1,2,3,4,5,6} to $\left\{2,4,6\right\}${2,4,6}. Of these there is one favourable outcome which is both even and a six.

$P\left(A|B\right)$P(A|B) $=$= $\frac{\text{Number of favourable outcomes}}{\text{Total number of outcomes}}$Number of favourable outcomesTotal number of outcomes
  $=$= $\frac{1}{3}$13

Reflect: If we consider how we found these figures we can come up with a rule for finding $P\left(A|B\right)$P(A|B). The number of outcomes possible was reduced to be the number of outcomes for event $B$B - since this was given to have happened. The number of favourable outcomes must be in the reduced set of outcomes and match event $A$A, hence it is the number of elements in $A\cap B$AB.  We can think about this in terms of the number of outcomes for certain events, and we get the formula:

$P\left(A|B\right)=\frac{\text{number in }\left(A\cap B\right)}{\text{number in }\left(B\right)}$P(A|B)=number in (AB)number in (B)

 

Example 2

$56$56 students from two year 12 classes were surveyed and asked if they studied Mathematics and/or Physics. The results are shown in the Venn diagram below:

(a) If a student is selected at random what is the probability the student studies Mathematics?

This is not a conditional probability question and can be calculated using the number of students studying Mathematics and the total number of students.

$P\left(\text{Mathematics}\right)$P(Mathematics) $=$= $\frac{\text{Number of favourable outcomes}}{\text{Total number of outcomes}}$Number of favourable outcomesTotal number of outcomes
  $=$= $\frac{35}{56}$3556
  $=$= $\frac{5}{8}$58

(b) If a student is selected at random what is the probability that the student studies Mathematics given that they study Physics?

This is a conditional probability, we have been given that the student selected studies Physics. This will reduce the students we are interested in to just those studying Physics:

We now have a reduced total outcome of $25$25 students and of these$15$15 study Mathematics.

$P\left(\text{Mathematics|Physics}\right)$P(Mathematics|Physics) $=$= $\frac{\text{Number of favourable outcomes}}{\text{Total number of outcomes}}$Number of favourable outcomesTotal number of outcomes
  $=$= $\frac{\text{number in }\left(\text{Mathematics}\cap\text{Physics}\right)}{\text{number in }\left(\text{Physics}\right)}$number in (MathematicsPhysics)number in (Physics)
  $=$= $\frac{15}{25}$1525
  $=$= $\frac{3}{5}$35

(c) If a student is selected at random what is the probability that the student studies Physics given that they study Mathematics?

This is a conditional probability, we have been given that the student selected studies Mathematics. This will reduce the students we are interested in to just those studying Mathematics:

We now have a reduced total outcome of $35$35 students and of these $15$15 study Physics.

$P\left(\text{Physics|Mathematics}\right)$P(Physics|Mathematics) $=$= $\frac{\text{Number of favourable outcomes}}{\text{Total number of outcomes}}$Number of favourable outcomesTotal number of outcomes
  $=$= $\frac{\text{number in }\left(\text{Physics}\cap\text{Mathematics}\right)}{\text{number in }\left(\text{Mathematics}\right)}$number in (PhysicsMathematics)number in (Mathematics)
  $=$= $\frac{15}{35}$1535
  $=$= $\frac{3}{7}$37

Reflect: Notice in our example $P\left(A|B\right)\ne P\left(B|A\right)$P(A|B)P(B|A) and this is true in general. Can you see under what conditions they would be equal?

So we can calculate the probability of event A occurring given event B has occurred using:

$P\left(A|B\right)=\frac{\text{number in }\left(A\cap B\right)}{\text{number in }\left(B\right)}$P(A|B)=number in (AB)number in (B)

If we divide the top and bottom terms of this fraction by the total number of outcomes, each term would be expressible as a probability. This allows us to calculate conditional probabilities using the probabilities of events rather than the number of outcomes.

Conditional probability

For two events $A$A and $B$B, the probability of $A$A occurring given that$B$B has occurred is given by:

$P\left(A|B\right)=\frac{P\left(A\cap B\right)}{P\left(B\right)}$P(A|B)=P(AB)P(B)

If we know the conditional probability we can calculate the probability of $A$A and $B$B using either:

$P\left(A\cap B\right)=P\left(A|B\right)P\left(B\right)$P(AB)=P(A|B)P(B) OR $P\left(A\cap B\right)=P\left(B|A\right)P\left(A\right)$P(AB)=P(B|A)P(A)

 

Independent events using conditional probability

Recall that independent events are events where the occurrence of one event does not affect the probability of the other occurring. Such as rolling a dice and then tossing a coin, or tossing a coin repeatedly.  Now in the context of conditional probability this would mean that the probability of event $A$A occurring given event $B$B has occurred should simply be the probability of $A$A - that is, it shouldn't matter if event $B$B occurred or not. Mathematically we can write this property as:

$P\left(A|B\right)=P\left(A\right)$P(A|B)=P(A)

From our conditional formula we see that for independent events:

$P\left(A\cap B\right)$P(AB) $=$= $P\left(A|B\right)\times P\left(B\right)$P(A|B)×P(B)
  $=$= $P\left(A\right)\times P\left(B\right)$P(A)×P(B)

We can use this fact to test if two events are independent if we know the probability of $A$A$B$B and the probability of (A and B).

Independent events

The following statements are true for any two independent events, $A$A and $B$B:

  • $P\left(A\cap B\right)=P\left(A\right)\times P\left(B\right)$P(AB)=P(A)×P(B)
  • $P\left(A|B\right)=P\left(A\right)$P(A|B)=P(A)
  • $P\left(B|A\right)=P\left(B\right)$P(B|A)=P(B)


 

Practice questions

QUESTION 1

A student creates the following diagram of their favourite animals.

  1. How many of the animals have four legs?

  2. How many of the animals have four legs and stripes?

  3. What is the probability of selecting an animal with stripes given that it has four legs?

QUESTION 2

The probability of two independent events, $A$A and $B$B are, $P\left(A\right)=0.6$P(A)=0.6 and $P\left(B\right)=0.7$P(B)=0.7.

Determine the probability of:

  1. Both $A$A and $B$B occurring.

  2. Neither $A$A nor $B$B.

  3. $A$A or $B$B or both.

  4. $B$B but not $A$A.

  5. $A$A given that $B$B occurs.

QUESTION 3

A flight departs from Melbourne to Sydney. The probability that the flight departs on time, given the weather is fine in Melbourne is $0.9$0.9, and the probability that the flight departs on time, given the weather is not fine in Melbourne is $0.7$0.7. The probability that the weather is fine on any particular day in July is $0.4$0.4.

  1. By constructing a tree diagram or otherwise, find the probability that the flight from Melbourne to Sydney departs on time in a day in July.

    Give your answer in its simplest form.

  2. Find the probability that the weather is fine in Melbourne given that the flight departs on time on a day in July?

    Give your answer in its simplest form.

What is Mathspace

About Mathspace