- Home
- >
- Conditional probability – Explanation & Examples

# Conditional Probability – Explanation & Examples

In probability theory, there are many scenarios where we deal with more than one event. For instance, in some cases, we are asked to find the probability of some event $A$ given that another event $B$ has already taken place.Â We use the concept of **conditional probability** to analyze such events.

**Conditional probability $P(A|B)$ is the probability of event A given the information that B has already taken place.**

After reading this article, you should understand:

- Conditional probability
- How to calculate the conditional probability
- Conditional probability properties and formulae
- Relation between conditional probability and independence

You are advised to refresh the following topics:

## What Is Conditional Probability

Let’ suppose we are playing a game in which we have to guess the day (i.e., Saturday, Sunday, etc.) of birth of a complete stranger. Since there are seven days in a week, we have a probability of $\frac{1}{7} = 14.28\%$ of making a correct guess. Now, what if we are given the information that the stranger was born on a day that starts with an “S.”? With this additional information, the probability of making a correct guess jumps to $\frac12 = 50\%$.

However, if we are given the additional information that the stranger was born on a sunny day, it does not help in making a correct guess, and the probability remains the same, i.e., $\frac17$. Conditional probability helps us understand and analyze such scenarios where we are interested in finding the probability of a given event, and we are also given some extra information that another event has taken place.

As suggested by the example above, sometimes this additional information changes the probability of an event, and sometimes it does not. We will discuss in detail how to analyze these scenarios using conditional probabilities.

## How to Calculate the Conditional Probability

To understand the concept of conditional probability, it will be helpful to first discuss what a sample space is.

#### Sample Space:

**A sample space is the collection of all possible outcomes.** For example, when we roll a six-sided fair die, there are six possible outcomes, so the sample space is given as $\text{S}=\{1,2,3,4,5,6\}$. Any subset of the sample space is called an** event**. For example, let us consider $E1=\{2,4,6\}$, which is a subset of sample space $S $ and it contains only even numbers. Similarly, $E2 = \{2\}$ is another event (i.e., subset) of $S$ that contains only element.

Let’s assume that for a specific roll of a die, we are given the information that the outcome is even, i.e., $E1$ has occurred. Now, what is the probability that the outcome is $2?$ When we are given no additional information, then there are six possible outcomes; however, when we know that the outcome is even, then there are only three possible outcomes, i.e., $\{2,4,6\}$. Since $2$ is one of three equally likely possibilities, therefore, $P(E1|E2) = \frac13$. Let’s consider another example:

**Example 1:**

We toss a coin three times. Let $E1$ be the event of getting all three Heads. Let $E2$ be the event that we get more Heads than Tails. Find the following probabilities:

1. $P(E1)$ and $P(E2)$.

2. $P(E1|E2)$

Solution:

1)

The sample space for three tosses can be written as $S = \{HHH, HHT, HTH, THH, TTT, TTH, THT, HTT\}$. Also, $E1 = \{HHH\}$ and $E2 = \{HHH, HHT, HTH, THH\}$. There are eight members of the sample space and all outcomes are equally likely, hence $P(E1) = \frac{1}{8}$ and $P(E2) = \frac38$.

2)

If we are given the information that $E2$ has occurred, then there are only three possibilities that are left, i.e., $\{HHH, HHT, HTH, THH\}.$ Note that $E1\{HHH\}$ is one of the three possibilities hence $P(E1|E2) = \frac13$.

### Conditional Probability Definition

**Conditional probability $P(A|B)$ is the probability of event A given the information that B has already taken place.**

### Conditional Probability Formulas

For simple problems, we can reason about conditional probabilities as we have done in the above examples. However, for more involved problems, it is better to use the formula for conditional probability. For any two events $A$ and $B$, $P(A|B)$ is given as

Â Â $P(A|B) = \frac{P(A \cap B)}{P(B)}$

Let’s reconsider the two examples discussed above, but this time, we use the formula for conditional probability.

**Example 2:**

We roll a six-sided fair die. Let $E1$ be the event that the outcome is $2$. Let $E2$ be the event that the outcome is even. Find $P(E1|E2)$.

Solution:

Note that $S = \{1,2,3,4,5,6\}$ has six elements. Also, $E1=\{2\}$ and $E2 = \{2,4,6\}$ and $E1 \cap E2 = \{2\}$, hence $P(E2) = \frac36$ and $P(E1 \cap E2) = \frac16$. Therefore,

$P(E1|E2) = \frac{\frac16}{\frac36} = \frac13$

**Example 3:**

We toss a coin three times. Let $E1$ be the event of getting all three Heads. Let $E2$ be the event that we get more Heads than Tails, find $P(E1|E2)$.

Solution:

Note that $E1 = \{HHH\}$ and $E2 = \{HHH, HHT, HTH, THH\}$, hence $E1 \cap E2 = \{HHH\}$. As we have noted in the above example that the sample space contains $8$ members, hence $P(E1 \cap E2) = \frac18$ and $P(E2) = \frac38$. Hence,

$P(E1|E2) = \frac{P(E1 \cap E2}{P(E2} = \frac{\frac18}{\frac38} = \frac13$

**Example 4:**

The game of cricket is started by first tossing a coin. The team that wins the toss decides whether to go bowling first or to bat first. The team that wins the toss usually has a higher probability of winning the game. Let’s suppose that for a particular team (let’s call it Team-A), we know that the probability of winning is equal to 70% if Team-A has won the toss. What is the probability that Team-A will win the match and also win the toss?

Solution:

Let $A$ be the event that Team-A wins the game. Let $B$ is the event that Team-A wins the toss. We are given the information that $P(A|B) = 0.7$. We need to find $P(A \cap B)$. From the formula of conditional probability, we can write:

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

We can rearrange it as follows:

$P(A \cap B) = P(A|B) \times P(B)$

Since tossing a coin results in Heads or Tails with equal probability, so Team-A can win the toss with $50\%$ probability, i.e., $P(B) = 0.5$. Hence,

$P(A \cap B) = 0.7 \times 0.5 = 0.35 = 35\%$.

### Conditional Probability and Venn Diagram

We have stated the formula for the conditional probability; however, we did not explain how this formula is derived. The formula for conditional probability can be most easily understood using a Venn diagram. Let us make a Venn diagram for an arbitrary experiment with sample space $S$ and two events $A$ and $B$, as shown below. Let’s assume that areas of the events shown in the Venn Diagram correspond to their respective probabilities. Remember that the area of the entire sample space in the Venn diagram corresponds to $1$.

When we are interested in the conditional probability $P(A|B)$, i.e., probability of $A$ given the information that $B$ has occurred, then only those possibilities that are members of $B$ have some probability of occurrence, and all events that are not part of $B$ cannot take place and hence have zero probability. Accordingly, only those members of A will have any probability that is shared by both $A$ and $B$ as shown by the shaded region in the Venn diagram.

Hence, it is obvious that $P(A|B)$ will be proportional to $P(A \cap B)$, i.e., $P(A|B) \propto P(A \cap B)$.

Now comes the question that why do we have to divide with $P(B)$. Note that once it is known that $B$ has taken place, then the probability of $B$, i.e., $P(B|B)$, must be equal to one. In other words, $B$ becomes kind of a new sample space. Now let’s assume that $A$ and $B$ have the same elements, so $A$ and $B$ completely overlap, as shown in the Venn diagram below:

In this case, $P(A|B)$ should be equal 1, which is only possible if we divide $P(A \cap B)$ with $P(B)$.

## Conditional Probability PropertiesÂ

As stated above, the information that event $B$ has taken place makes $B$ kind of a new sample space. Hence the standard properties of probability are valid for conditional probabilities, i.e.,

**Property 1:** If $S$ is the sample space and $B$ be any event, then $P(S|B) = P(B|B) = 1$.

**Property 2:** Let $A$, $B$, $C$ be three arbitrary events, then $P(A \cup B | C) = P(A|C) + P(B|C) – P(A\cap B|C)$.

**Property 3:** Let $A$ and $B$ be two events, let $A’$ represents $\textrm{NOT} A$, then $P(A’|B) = 1 – P(A|B)$.

**Property 4:** Two events $A$ and $B$ are termed as independent if $P(A|B) = P(A)$.

**Example 5:**

In a probability exam, Question-1 (Q1), Question-2(Q2), and Question-3 (Q3) are all related to the topic of conditional probability. If a student solves Q1 correctly, then the probability that he/she will correctly solve Q2 is 70%, and Q3 is 50%, and both Q2 and Q3 is 30%. We know that a given student has correctly solved Q1. What is the probability that he/she will at least solve one more question correctly.

Solution:

Let $E1$, $E2$, $E3$ be the events that a student has correctly solved Q1, Q2 and Q3, respectively. We are interested in $P(E2 \, \textrm{OR}\, E3|E1) = P(E2 \cup E3|E1)$. Remember that, in set theory, “OR” means either $E2$ or $E3$ or both. From the properties of conditional probability, we can write

$P(E2 \cup E3|E1) = P(E2|E1) + P(E3|E1) – P(E2\cap E3|E1)$

$P(E2 \cup E3|E1) = 0.7 + 0.5 – 0.3 = 0.9 = 90\%$

The first three properties are the same as the ones that we have already seen in the basic probability theory. Property 4 is a new concept, so lets consider it in further detail

### Conditional Prob and Independent Events

Two events are termed as independent if one event cannot affect the probability of the other. In terms of conditional probability, two events $A$ and $B$ are independent, if $P(A|B) = P(A)$. In other words, $A$ is independent of $B$ if the information that $B$ has taken place does not affect the probability of $A$. Note that if $P(A|B) = P(A)$, then we can easily show using the formula of conditional probability that $P(B|A) = P(B)$. We leave it as an exercise for the readers to prove it themselves.

Another interesting corollary of the definition of independence is that if $A$ and $B$ are independent, then $P(A \cap B) = P(A)P(B)$ (again, we leave it for the reader to prove this relation as an exercise).

**Example 6:**

Let us reconsider the example of tossing a coin three times. Let $E1$ be the event that the first outcome is Heads. Let $E2$ be the event that the second outcome is Heads. Let $E3$ be the event that we get more Heads than Tails. Find the following:

1. Are $E1$ and $E2$ independent?

2. Are $E1$ and $E3$ independent?

Solution:

**1)**

$E1 = \{HHH, HHT, HTH, HTT\}$, $E2 = \{HHH, HHT, THH, THT\}$ and $E3= \{HHH, HHT, HTH, THH\}$. We note that $E1$, $E2$ and $E3$ all have $4$ elements and as described earlier, the sample space of this experiment has $8$ elements; therefore,

$P(E1) = P(E2) = P(E3) = \frac12$

Now to figure out if $E1$ and $E2$ are independent, we need to find $P(E1|E2)$. If $P(E1|E2) = P(E1)$, then the events are independent. The formula for conditional probability states that

$P(E1|E2) = \frac{P(E1 \cap E2)}{P(E2}$

We note that $E1 \cap E2 = \{HHH, HHT\}$, hence $P(E1 \cap E2) = \frac28 = \frac14$. Accordingly,

$P(E1|E2) = \frac{P(E1 \cap E2)}{P(E2} = \frac{\frac14}{\frac12} = \frac12 = P(E1)$

Hence, $E1$ and $E2$ are independent.

**2)**

To check if $E1$ and $E3$ are dependent or independent, first we find

$ E1 \cap E3 = \{HHH, HHT, HTH\}$. Hence, $P(E1 \cap E2) = \frac38$ and

$P(E1|E3) = \frac{P(E1 \cap E3)}{P(E3} = \frac{\frac38}{\frac12} = \frac34 \neq P(E1)$

Therefore, $E1$ and $E3$ are not independent events.

**Example 7:**

A factory is producing light bulbs. The probability that a light bulb will be defective is $0.01$. All light bulbs are independent of the others. A quality assurance manager is randomly testing light bulbs. The first light bulb that she tested turns out to be defective. What is the probability that the second light bulb she would test would be defective as well?

Solution:

Let $E1$ be the event that the first light bulb is defective. Let $E2$ be the event that the second light bulb is defective. We are interested in the probability of $P(E1\, \textrm{AND}\, E2) = P(E1 \cap E2)$. Since all bulbs are independent, hence

$P(E1 \cap E2) = P(E1) \times P(E2) = (0.01)^2$

### Practice Questions:

**1.**The probability of a certain event $A$ is $10$%, and that of another event $B$ is $50$%. If it is known that $P(A|B) = 20%$. Find

a) $P(A \cap B)$

b) $P(P \cup B)$

**2.** In City-A, the probability that the temperature will be less than 20 C on a given day is $30\%$. The probability of rain on a given day is $10\%$. The probability that it would either be less than 20 C or raining or both is $20\%$. What is the conditional probability of rain, given that the temperature is less than 20 C?

**3.** We roll a dice twice. Let $E1$ is the event that the first outcome is even. Let $E2$ is the event that the second outcome is odd. Let $E3$ is the event that both outcomes are the same

- Are $E1$ and $E2$ independent?
- Are $E2$ and $E3$ independent?
- Are $E3$ and $E1$ independent?

**4.**

Team-A is going to play 5 matches in a tournament. The probability that Team-A wins a match is $30\%$. All matches are independent of each other. Find the probability that.

- Team-A wins all matches.
- Team A wins no match.

### Answer Key

**1.**

a) 0.1

b) 0.5

**2.** 66.6%

**3.**

a) Yes

b) Yes

c) Yes

**4.**

1)Â 0.24 %

2)Â 16.8 %