Lesson Explainer: Conditional Probability Mathematics

In this explainer, we will learn how to calculate conditional probability using formulas and Venn diagrams.

Conditional probability is the probability of an event occurring given some knowledge about the outcome of some other event. Depending on the form of the problem, there are a few different methods we can use to help us calculate conditional probabilities. We are going to use Venn diagrams and the conditional probability formula.

Before we go any further, we will need to use some of the rules of probability that you already know, so let us first remind ourselves of these.

Some Probability Rules

For any event 𝐴, if 𝑃(𝐴) is the probability of event 𝐴 occurring, then we have the following:

Rule 1

0≀𝑃(𝐴)≀1.

Rule 2

The sum of the probabilities of all possible outcomes is equal to 1.

Rule 3

The probability of event 𝐴 NOT occurring is known as the complement, 𝐴, of event 𝐴, or β€œnot 𝐴,” is given by 𝑃(𝐴)=1βˆ’π‘ƒ(𝐴).

This can be represented on a Venn diagram (𝐴 is the orange region):

Note

The complement of event 𝐴 is sometimes also written as 𝐴.

Rule 4

The probability of event 𝐴 or event 𝐡 occurring is known as the β€œunion” of 𝐴 and 𝐡 and is given by 𝑃(𝐴βˆͺ𝐡).

This can be represented on a Venn diagram (𝐴βˆͺ𝐡 is the orange region):

Rule 5

The probability of event 𝐴 and event 𝐡 occurring is known as the β€œintersection” of 𝐴 and 𝐡, and is given by 𝑃(𝐴∩𝐡).

This can be represented on a Venn diagram (𝐴∩𝐡 is the orange region):

Rule 6

The probability that event 𝐴 occurs, but event 𝐡 does not can be thought of as 𝑃(𝐴)βˆ’π‘ƒ(𝐴∩𝐡), or alternatively the intersection between 𝐴 and 𝐡, written 𝑃(𝐴∩𝐡) and represented on a Venn diagram as follows by the orange region.

Mutually Exclusive, or Disjoint Events

Next, let us recall the idea that events may be mutually exclusive (or disjoint). That is, the events cannot occur at the same time.

For example, an animal may either be a cat or a dog, but it cannot be both a cat and a dog. β€œBeing a cat” and β€œbeing a dog” are mutually exclusive events.

For mutually exclusive events, the probability of the intersection of those events is zero. In our example, 𝑃(∩)=0CatDog.

For mutually exclusive events, the probability that either of those events occur is simply the sum of their individual probabilities of occurring.

In our example, 𝑃(βˆͺ)=𝑃()+𝑃()CatDogCatDog.

Rule 7

In general, for two mutually exclusive events 𝐴 and 𝐡,

  • 𝑃(𝐴∩𝐡)=0,
  • 𝑃(𝐴βˆͺ𝐡)=𝑃(𝐴)+𝑃(𝐡).

Non-Mutually Exclusive Events

For example, a person may like cats, or they may like dogs. They may even like cats and dogs. β€œLikes cats” and β€œlikes dogs” are not mutually exclusive events.

We need to be careful how we calculate the probability that a person likes cats OR dogs, 𝑃(βˆͺ)LikesCatsLikesDogs.

If we simply added together the probability that a person likes cats and the probability that the person likes dogs, we would count the area of intersection (the probability they like both) twice. We need to make an adjustment for this in our calculation. 𝑃(βˆͺ)=𝑃()+𝑃()βˆ’π‘ƒ(∩)LikesCatsLikesDogsLikesCatsLikesDogsLikesCatsLikesDogs

Rule 8

In general, for non-mutually exclusive events 𝐴 and 𝐡,𝑃(𝐴βˆͺ𝐡)=𝑃(𝐴)+𝑃(𝐡)βˆ’π‘ƒ(𝐴∩𝐡).

As mentioned, conditional probability is the probability of an event occurring given some knowledge about the outcome of some other event.

We can mathematically define conditional probability as follows.

Definition: Conditional Probability

If the probability of an event 𝐡 is affected by the occurrence of an event 𝐴, then we say that the probability of 𝐡 is conditional on the occurrence of 𝐴. The notation for conditional probability is 𝑃(𝐡∣𝐴), read as β€œthe probability of 𝐡 given 𝐴.”

There are many situations where we might apply the rules of conditional probability. For example, the probability that a person’s eyes are a particular color is affected by, or conditional on, the color of their parents’ eyes. Similarly, the time a journey takes is likely to be conditional on the mode of transport used. The value of your second card from a pack, if you do not replace the first, is conditional on the value of your first. These are all situations where conditional probability can be applied. We can define conditional probability mathematically as follows.

Let us look at an example involving two non-mutually exclusive events. This leads us to a situation where the probability of one event is conditional on the probability of the other.

Example 1: Conditional Probability with Venn Diagrams

On the street, 10 houses have a cat (C), 8 houses have a dog (D), 3 houses have both, and 7 houses have neither.

  1. Find the total number of houses on the street. Hence, find the probability that a house chosen at random has both a cat and a dog. Give your answer to three decimal places.
  2. Find the probability that a house on the street has either a cat or a dog or both. Give your answer to three decimal places.
  3. If a house on the street has a cat, find the probability that there is also a dog living there.

Answer

Part 1

Let us begin by putting the information we have into a Venn diagram. The left oval will contain houses with cats, the right oval will contain houses with dogs. The intersection of the ovals contains houses with both cats and dogs.

In examples like these, it is helpful to consider the intersection first. Although 10 houses have cats, some of them may also have dogs. Although 8 houses have dogs, some of them may also have cats. Since we are told that 3 houses have both cats and dogs, we can fill in this area of our Venn diagram first (the intersection of houses with cats and houses with dogs).

Now, if 10 houses have cats, and we know that 3 of them also have dogs, this leaves 10βˆ’3=7 houses that only have cats.

Likewise, if 8 houses have dogs, but 3 of those houses also have cats, then 8βˆ’3=5 houses just have dogs.

Finally, we are told that 7 houses have neither cats nor dogs, so we can fill in the area outside the ovals.

We can find the total number of houses by adding the numbers from each section of the diagram. So the total is 7+3+5+7=22. We could also calculate this without using the Venn diagram of course, using the numbers we are given in the question: 10+8+7βˆ’3=22. For this last calculation, notice the 3 houses with both a cat and a dog have been subtracted, because these have been counted twice: once within the 10 cat houses and again within the 8 dog houses.

Let us define C as being the event that a house has a cat and D as the event that a house has a dog.

As there are 3 houses with both a cat and a dog and 22 houses in total, the probability that a house has both a cat and a dog is then 𝑃(∩)=322=0.1363…CD.

Hence the probability is 0.136 to three decimal places.

Part 2

To find the probability that a house has either a cat or a dog or both, we can use the rule of probability that 𝑃(βˆͺ)=𝑃()+𝑃()βˆ’π‘ƒ(∩)CDCDCD. Hence, 𝑃(βˆͺ)=1022+822βˆ’322=1522=0.6818….CD

Hence, the probability that a house has either a cat or a dog or both is 0.682 to three decimal places.

Part 3

When answering the final part of this question, we must recognize that the phrase β€œif a house on the street has a cat” is setting a condition. By doing this, we are restricting the cases we are looking at to include only the 10 houses that own a cat.

Out of the 10 houses we are now considering, only 3 of them have dogs, so if a house on the street has a cat, then the probability it also has a dog is 310=0.3.

In part (3), we have actually calculated the conditional probability, 𝑃(∣)DC: the probability that a house has a dog (D), given that it has a cat (C).

By using a Venn diagram in our previous conditional probability example, we could see that when we are β€œgiven a condition”, it determines a subset of cases for us to consider. Being told that the house on the street had a cat meant that we were only looking at a subset of 10 houses. Further, when looking for houses in our subset that had a dog, we could see that these houses must have both a cat and a dog.

Thinking of probability as a proportion of cases that match a given condition, we can see that the probability that a house has a dog given that it has a cat can be expressed as 𝑃(∣)=𝑃(∩)𝑃().DogCatDogCatCat

This might be thought of as β€œWhat proportion of houses with cats actually had cats and dogs?”

This gives us a general conditional probability formula for events 𝐴 and 𝐡𝑃(𝐴∣𝐡)=𝑃(𝐴∩𝐡)𝑃(𝐡).

Let us now try an example using the conditional probability formula.

Example 2: Using the Conditional Probability Formula

Suppose 𝐴 and 𝐡 are two events. Given that 𝑃(𝐴∩𝐡)=23 and 𝑃(𝐴)=913, find 𝑃(𝐡∣𝐴).

Answer

Recall the conditional probability formula 𝑃(𝐴∣𝐡)=𝑃(𝐴∩𝐡)𝑃(𝐡).

However, in our question, we have been asked to find 𝑃(𝐡∣𝐴), so let’s reverse 𝐴 and 𝐡 in the general formula: 𝑃(𝐡∣𝐴)=𝑃(𝐡∩𝐴)𝑃(𝐴).

Further, by visualising the Venn diagram, it is clear that 𝑃(𝐡∩𝐴)=𝑃(𝐴∩𝐡).

The orange region of intersection can be described as either 𝐴∩𝐡, or 𝐡∩𝐴.

So, to find the probability of 𝐡 given 𝐴, we can use the formula 𝑃(𝐡∣𝐴)=𝑃(𝐡∩𝐴)𝑃(𝐴).

Substituting in the values we have been given, 𝑃(𝐡∣𝐴)==23Γ—139=2627.

The probability 𝑃(𝐡∣𝐴) is therefore 2627.

An important idea in probability theory is the independence of events.

If we repeatedly flip a coin to see if it lands head side up, or tail side up, each flip is an independent event. What happens in one flip does not affect the probabilities of heads or tails in any other flip.

Now consider the situation where we have a bag containing 5 lemon sweets and 5 chocolate sweets, and I take out one sweet at random and eat it, then the probability of getting a lemon sweet is 510=12, and the probability of getting a chocolate sweet is also 510=12. However, the probability of getting each flavour will be different for the next person to take one at random. If I ate a lemon sweet, then the next person has a probability of 49 of selecting a lemon sweet, and a 59 probability of selecting a chocolate sweet. However, if I ate a chocolate sweet, then the next person has a probability of 59 of selecting a lemon sweet, and only 49 probability of selecting a chocolate sweet. The probabilities of the next person picking each flavour of sweet are dependent upon what flavor I picked.

Definition: Independent and Dependent Events

Two events 𝐴 and 𝐡 are

  • independent if the fact that 𝐴 occurs does not affect the probability of 𝐡 occurring,
  • dependent if the fact that 𝐴 occurs does affect the probability of 𝐡 occurring.

And we have the following.

Rule 9

For independent events, 𝑃(𝐴∩𝐡)=𝑃(𝐴)×𝑃(𝐡).

But if we rearrange the formula for conditional probability, we find that 𝑃(𝐴∩𝐡)=𝑃(𝐴∣𝐡)×𝑃(𝐡).

Comparing with rule 9, this must mean that, for independent events, 𝑃(𝐴∣𝐡)=𝑃(𝐴) and similarly, for 𝑃(𝐡∣𝐴), that 𝑃(𝐡∣𝐴)=𝑃(𝐡).

This seems logical, as it is saying that for independent events, the probability that 𝐴 occurs given that 𝐡 occurs is the same as the probability that simply 𝐴 occurs (whether, or not, 𝐡 occurs). In other words, the probability that 𝐴 occurs is the same, regardless of the outcome of event 𝐡.

Usefully, this gives us a way of checking whether two events are independent.

Test for Independence of Events 𝐴 and 𝐡

If 𝑃(𝐴)=𝑃(𝐴∣𝐡) and 𝑃(𝐡)=𝑃(𝐡∣𝐴), then events 𝐴 and 𝐡 are independent.

It is important to note that both of these equations must be true for independence.

Let us look at an example.

Example 3: Determining Whether Two Events Are Independent Using Conditional Probability

Suppose 𝑃(𝐴)=25 and 𝑃(𝐡)=37. The probability that event 𝐴 occurs and event 𝐡 also occurs is 15. Calculate 𝑃(𝐴∣𝐡), and then evaluate whether events 𝐴 and 𝐡 are independent.

Answer

To find the probability of 𝐴 given 𝐡, we can use the formula 𝑃(𝐴∣𝐡)=𝑃(𝐴∩𝐡)𝑃(𝐡).

Substituting in the values we have been given, we have 𝑃(𝐴∣𝐡)==15Γ—73=715.

If events 𝐴 and 𝐡 are independent, then one of the equations that must be true is 𝑃(𝐴∣𝐡)=𝑃(𝐴).

This is not the case since 𝑃(𝐴∣𝐡)=715=0.466… and 𝑃(𝐴)=25=0.400. Since 𝑃(𝐴∣𝐡)≠𝑃(𝐴), events 𝐴 and 𝐡 are not independent.

Example 4: Using Venn Diagrams to Calculate Dependent Probabilities

The figure shows a Venn diagram with some of the Probabilities given for two events 𝐴 and 𝐡.

  1. Work out 𝑃(𝐴∩𝐡).
  2. Work out 𝑃(𝐴).
  3. Work out 𝑃(𝐡∣𝐴).

Answer

Let us first define variables to represent any missing probabilities in our Venn diagram. In this case there is just one missing probability, so let us use π‘₯ to represent it.

We know that the probabilities on our Venn diagram must sum to one, as they represent all possible outcomes (rule 2). We can therefore calculate the value of π‘₯ by subtracting the sum of the other probabilities from one:π‘₯+0.3+0.2+0.4=1π‘₯=1βˆ’0.3βˆ’0.2βˆ’0.4π‘₯=0.1.

Now we have a complete Venn diagram, which will help us to answer the questions.

Part 1

𝑃(𝐴∩𝐡) means the probability of a result in the region defined by the intersection of region 𝐴 and the region β€œnot 𝐡”. First, let us shade region 𝐴:

Then let us shade region β€œnot 𝐡”:

So the region (𝐴∩𝐡) consists of areas shaded twice:

This is the region we defined with the probability π‘₯, so 𝑃(𝐴∩𝐡)=0.1.

Part 2

To find 𝑃(𝐴), we simply need to sum the probabilities of the regions making up region 𝐴.

𝑃(𝐴)=0.1+0.2𝑃(𝐴)=0.3.

Part 3

𝑃(𝐡∣𝐴) is the probability that event 𝐡 occurs given that event 𝐴 occurs. To find 𝑃(𝐡∣𝐴) using our Venn diagram, we could ask ourselves β€œwhat proportion of the region representing event 𝐴 contains cases where event 𝐡 also occurs?”

Let us first restrict the cases to the region where event 𝐴 has occurred. In fact, this can be illustrated by the same diagram we drew in part 2. Now, given that we are only considering events in this shaded region, let’s further shade the subset of this region in which event 𝐡 occurs.

So, 𝑃(𝐡∣𝐴)=0.2(0.1+0.2)𝑃(𝐡∣𝐴)=0.20.3𝑃(𝐡∣𝐴)=23.

We could check our answer using the conditional probability formula 𝑃(𝐡∣𝐴)=𝑃(𝐴∩𝐡)𝑃(𝐴).

From the Venn diagram, we can see that 𝑃(𝐴∩𝐡)=0.2, and 𝑃(𝐴)=0.1+0.2. Substituting these values into the conditional probability formula gives us 𝑃(𝐡∣𝐴)=0.2(0.1+0.2), which again simplifies to 23 or 0.667 to three decimal places.

Let us finish by recapping on some key points.

Key Points

  • If the probability of an event 𝐡 is affected by the occurrence of an event 𝐴, then we say that the probability of 𝐡 is conditional on the occurrence of 𝐴. The notation for conditional probability is 𝑃(𝐡∣𝐴), read as the probability of 𝐡 given 𝐴.
  • For two events, 𝐴 and 𝐡, we can use Venn diagrams, and the conditional probability formula to help work out the conditional probability of 𝐴 given 𝐡. The formula is given by𝑃(𝐴∣𝐡)=𝑃(𝐴∩𝐡)𝑃(𝐡).
  • We can use conditional probabilities to help us determine whether two events are dependent or independent.
  • Events 𝐴 and 𝐡 are independent if 𝑃(𝐴∣𝐡)=𝑃(𝐴) and 𝑃(𝐡∣𝐴)=𝑃(𝐡).

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.