topic badge

10.06 Conditional probability

Lesson

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

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".

Hint!

When considering whether a question is referring to a conditional probability, remember to look out for the following phrases:

  • Given that ....
  • If ......., what is the probability that .....

Let's start with a simple question so that we can get comfortable with this style of problem.

Worked examples

Example 1

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

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

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

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 we were told that this event had to have happened. The number of favourable outcomes must be in the reduced set of outcomes and these match event $A$A. This means they must be the outcomes common to both event $A$A and $B$B: that is, they are in $A\cap B$AB.  If $n\left(X\right)$n(X)represents the number of outcomes in event $X$X, then:

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

For simple problems, you may prefer to simply find the number of favourable outcomes in the reduced sample space to calculate your answers. However this formula will be required to find unknown values in purely numerical questions. 

Let's look at another example using a Venn diagram.

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 problem since have been told 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{n\left(\text{Mathematics}\cap\text{Physics}\right)}{n\left(\text{Physics}\right)}$n(MathematicsPhysics)n(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 and 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{n\left(\text{Physics}\cap\text{Mathematics}\right)}{n\left(\text{Mathematics}\right)}$n(PhysicsMathematics)n(Mathematics)
  $=$= $\frac{15}{35}$1535
  $=$= $\frac{3}{7}$37

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?

Conditional probability

For two events $A$A and $B$B we can calculate the probability of event $A$A occurring given event $B$B has occurred using:

$P\left(A|B\right)=\frac{n\left(A\cap B\right)}{n\left(B\right)}$P(A|B)=n(AB)n(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. And so, the probability of $A$A occurring given that $B$B has occurred is also 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)

Practice questions

Question 1

At a university there are $816$816 students studying first year engineering, $497$497 of whom are female (set $F$F). $237$237 of these women are studying Civil Engineering, and there are $348$348 students studying Civil Engineering altogether (set $C$C).

  1. State the value of $w$w in the diagram.

  2. State the value of $x$x in the diagram.

  3. State the value of $y$y in the diagram.

  4. State the value of $z$z in the diagram.

  5. What is the probability that a randomly selected male student does not study Civil Engineering?

Question 2

This table describes the departures of trains out of a train station for the months of March and April.

Month Departed on time Delayed
March $148$148 $38$38
April $140$140 $20$20
  1. How many trains departed during March and April?

  2. What percentage of the trains in April were delayed? Write your answer as a percentage to 1 decimal place.

  3. What fraction of the total number of trains during the 2 months were ones that departed on time in March?

  4. What is the probability that a train selected at random in April would have departed on time?

    Give your answer as a simplified fraction.

  5. What is the probability that a train selected at random from the 2 months was delayed?

    Give your answer as a simplified fraction.

Independent events

When we talk about events that are independent, we are talking about the fact that one event occurring has no impact on the chances of another event occurring. Each event is independent of the other.

This means that conditional probability doesn't really come into play here. If events $A$A and $B$B are independent, and we know that $B$B has already happened, this will have no bearing on whether $A$A happens. The sample space has not changed size, and neither has the number of favourable outcomes.

Thus we can express independent events as:

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

If we return to our formula to calculate conditional probability, $P\left(A|B\right)=\frac{P\left(A\cap B\right)}{P\left(B\right)}$P(A|B)=P(AB)P(B), we can rearrange it to get: 

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

Using the property we have established above, we can rewrite this as:

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

Both of these rules can be used to test if two events A and B are independent. 

Worked example

Example 3

Consider events $A$A and $B$B such that: $P\left(A\cup B\right)=0.8$P(AB)=0.8$P\left(A\cap B\right)=0.4$P(AB)=0.4, $P\left(B|A\right)=0.8$P(B|A)=0.8.

Are events $A$A and $B$B independent?

Think: The easiest way to work this out is to firstly represent this information with a Venn diagram.

Do:

Note that we knew the probability of event $A$A using the following calculation:

$P\left(B|A\right)$P(B|A) $=$= $\frac{P\left(B\cap A\right)}{P\left(A\right)}$P(BA)P(A)
$0.8$0.8 $=$= $\frac{0.4}{P\left(A\right)}$0.4P(A)
$P\left(A\right)$P(A) $=$= $0.5$0.5

Now let's use our rule for independence:

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

And:

$P(A)\times P(B)$P(A)×P(B) $=$= $0.5\times0.7$0.5×0.7
$P(A)\times P(B)$P(A)×P(B) $=$= $0.35$0.35

Hence:

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

Alternatively, we could use:

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

Using either rule, we can see that events $A$A and $B$B are not independent.

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)

Remember, independent and mutually exclusive events are NOT the same thing. Mutually exclusive events are those that have the property $P(A\cap B)=0$P(AB)=0

Practice questions

Question 3

Two events $A$A and $B$B are such that:

$P\left(A\cap B\right)=0.02$P(AB)=0.02 and $P\left(A\right)=0.2$P(A)=0.2.

  1. If $P\left(B\right)=0.1$P(B)=0.1, are the events $A$A and $B$B independent?

    Yes

    A

    No

    B
  2. Are the events $A$A and $B$B mutually exclusive?

    Yes

    A

    No

    B

Question 4

Consider the following Venn Diagram.

  1. Find $P$P$($($A\cap B$AB$\cap$$\overline{C}$C$)$).

  2. Find $P$P$($($\left(A\cup B\right)$(AB)$\cap$$\overline{C}$C$)$).

  3. Find $P$P$($($B$B$|$|$C$C$)$).

  4. Find $P$P$($($\overline{A}$A$|$|$C$C$)$).

  5. Find $P$P$($($A\cup B$AB$|$|$\overline{C}$C$)$).

Outcomes

MA11-7

uses concepts and techniques from probability to present and interpret data and solve problems in a variety of contexts, including the use of probability distributions

What is Mathspace

About Mathspace