What is Conditional Probability?
A conditional probability is the likelihood of an event occurring given that another event has already happened. Conditional probabilities allow you to evaluate how prior information affects probabilities. For example, what is the probability of A given B has occurred? When you incorporate existing facts into the calculations, it can change the likelihood of an outcome.
Typically, the problem statement for conditional probability questions assumes that the initial event occurred or indicates that an observer witnesses it. The goal is to calculate the chances of the second event under the condition that the first event occurred.
This concept might sound complicated, but it makes sense that knowing an event occurred can affect the chances of another event.
For example, if someone asks you, what is the likelihood that you’re carrying an umbrella? Wouldn’t your first question be, is it raining? Obviously, knowing whether it is raining affects the chances that you’re carrying an umbrella.
Related post: Probability Fundamentals
Conditional Probability Examples
P (A|B) denotes the conditional probability of event A occurring given that event B has occurred.
For a conditional probability example, imagine we’re assessing the likelihood that someone owns a cat given the presence of an empty cardboard box on their floor. We’d use the following notation:
P (Cat | Open box on floor) = 0.8
This notation indicates that the chances of someone owning a cat given the presence of an open box on their floor is 0.8.
I know because I own cats and often have an empty box on my floor for them to enjoy!
For a more serious conditional probability example, consider medical testing, such as COVID tests. In this context, evaluating conditional probabilities is critical. You need to know the likelihood of obtaining a positive test result when a person has COVID and the chances of a negative result when a person does not have COVID.
For studies that assess medical tests, researchers already know whether a volunteer has COVID (or whatever disease they’re testing). They then administer a COVID test and record the results. Consequently, we’re evaluating the likelihood of a test result given the known status of a participant.
The following conditional probability notation represents these two cases:
- P (Positive COVID test | Person has COVID)
- P (Negative COVID test | Person does not have COVID)
Tests can perform well for one, both, or neither of these conditions. They need high conditional probabilities for both cases to limit the chances for false negatives and positives, respectively.
Conditional Probability Formula
Use the following conditional probability formula to find the probability of A given B:
In the conditional probability formula, the numerator of the ratio is the joint chance that A and B occur together. We need the joint likelihood in the numerator because we’re interested in the subset of cases where both events happen.
The denominator of the conditional probability formula is the likelihood that B occurs. We use that value in the denominator because the chances of event B defines the total sample space. Remember, the nature of a conditional probability is that a given event occurs, and the denominator accounts for that occurrence.
In the conditional probability formula, the numerator is a subset of the denominator. Together, the formula gives us the ratio of the chances of both events occurring relative to the likelihood that the given event occurs, which is the conditional probability!
Therefore, if the ratio equals one, event A always occurs when event B has occurred. Conversely, when the ratio equals zero, event A never occurs after B happens. For most conditional probability examples, the ratio is somewhere between 0 and 1, indicating that A sometimes occurs after B. Hence, we find the probability of A given B!
Related post: Joint Probability: Definition, Formula & Examples
Worked Conditional Probability Example
Let’s return to the conditional probability example of carrying an umbrella when it’s raining. Assume that a study in a rainy city assesses chances related to rainy days and carrying umbrellas. The researchers were out observing the weather and people.
We want to see how the chances of carrying an umbrella change depending on whether it is raining or not. That requires calculating the following two conditional probabilities:
- P (Umbrella | Rain): What is the likelihood that someone is carrying an umbrella given that it is raining.
- P (Umbrella | No Rain): What is the likelihood that someone is carrying an umbrella given that it is not raining.
To find our answers, we’ll use the following two conditional probability formulas:
The researchers find the following probabilities:
- P(Umbrella ⋂ Rain): 0.20
- P(Umbrella ⋂ No Rain): 0.40
- P(Rain): 0.25
- P(No Rain): 0.75
Calculating the Conditional Probabilities
If you look at the joint likelihoods in the first two bullets, it appears that the chance of carrying an umbrella when it’s not raining (0.40) is higher than when it is raining (0.20). That seems backward, and we’ll come back to that. For the correct answer, we need to calculate the conditional probability. Let’s plug these numbers into the conditional probability formula!
Based on the conditional probabilities, we see that people are more likely to carry an umbrella given that it’s raining (0.80) compared to when it’s not raining (0.53). That makes sense!
The joint likelihoods were misleading because they do not account for the fact that days with no rain are three times as likely as rainy days (0.75 vs. 0.25)! In this study, you’re more likely to see people carrying umbrellas when there’s no rain because there are many more days with no rain. The conditional probabilities consider that fact.
This example of conditional probabilities involves dependent events. We know that’s the case because when you change the initial event, the chances of the second event change. Consequently, the likelihood of the second event depends on the first event.
Now, let’s see what happens when we look at independent events.
Related post: Venn diagrams can display probabilities effectively
Example of Conditional Probabilities with Independent Events
When you assess conditional probabilities of independent events, the following is true:
P (A|B) = P (A)
What does that mean?
The probability of A given that B occurred equals the likelihood of A. In other words, whether B occurs or not has no effect on the chances of A. That makes sense because the events are independent! There’s also a mathematical proof for it, which I won’t cover.
Let’s work through a conditional probability example so you can see how that plays out!
Imagine we’re playing a game. For each turn, you roll two dice, but you roll them one at a time. You want to roll two sixes. The dice rolls are independent events because the outcome of the first roll does not affect the second roll.
Learn more about Independent Events: Definition & Probability.
We’ll use the conditional probability formula to find the likelihood of rolling a second six given that the first roll was a six. For this example, I’ll denote the first six as 61 and the second as 62.
Because these are independent events, we can use the multiplication rule to calculate the joint probability of P (P2 ⋂ P1). Each roll has a 1/6 = 0.167 chance of getting a six.
Consequently, the joint likelihood of two sixes is: P (62 ⋂ P1) = 0.167 * 0.167 = 0.028
And the chance of rolling a six on the first throw: P (61) = 0.167
By entering these values into the conditional probability formula, we know that the chances of rolling a 2nd six given that the first roll was a six is the following:
No surprise. The chance of throwing that 2nd six is still 1/6. The first six doesn’t affect the likelihood at all, which makes sense for independent events!
You can also calculate conditional probabilities and other types using contingency tables. To learn about that, read my post Using Contingency Tables to Calculate Probabilities.