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. When you incorporate existing facts into the calculations, it can change the probability 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 probability 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 probability that you’re carrying an umbrella? Wouldn’t your first question be, is it raining? Obviously, knowing whether it is raining affects the likelihood that you’re carrying an umbrella.
Related post: Probability Fundamentals
Conditional Probability Examples and Notation
P (A|B) denotes the conditional probability of event A occurring given that event B has occurred.
For example, imagine we’re assessing the probability 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 probability 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 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 probability of test result given the known status of a participant.
The following 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
The conditional probability formula for A given B is the following ratio:
The numerator of the formula is the joint probability that A and B occur together. We need the joint probability in the numerator because we’re interested in the subset of cases where both events happen.
The denominator is the probability that B occurs. We use that value in the denominator because the likelihood 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.
The numerator is a subset of the denominator. Together, the formula gives us the ratio of the probability 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. Usually, the ratio is somewhere between 0 and 1, indicating that A sometimes occurs after B.
Worked Example of Conditional Probability
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 probabilities related to rainy days and carrying umbrellas. The researchers were out observing the weather and people.
We want to see how the probabilities 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 probability that someone is carrying an umbrella given that it is raining.
- P (Umbrella | No Rain): What is the probability that someone is carrying an umbrella given that it is not raining.
To calculate the conditional probability, we’ll use the following two 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 probabilities 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 probabilities 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 probability 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 probability of A. In other words, whether B occurs or not has no effect on the likelihood 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 an 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.
We want to calculate the conditional probability of rolling a second six given that the first roll was a six. 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 (62 ⋂ P1). Each roll has a 1/6 = 0.167 chance of getting a six.
Consequently, the joint probability of two sixes is: P (62 ⋂ P1) = 0.167 * 0.167 = 0.028
And the probability of rolling a six on the first throw: P (61) = 0.167
Therefore, the conditional probability of rolling a 2nd six given that the first roll was a six is the following:
No surprise. The probability of throwing that 2nd six is still 1/6. The first six doesn’t affect the probability 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.