• Skip to secondary menu
  • Skip to main content
  • Skip to primary sidebar
  • My Store
  • Glossary
  • Home
  • About Me
  • Contact Me

Statistics By Jim

Making statistics intuitive

  • Graphs
  • Basics
  • Hypothesis Testing
  • Regression
  • ANOVA
  • Probability
  • Time Series
  • Fun

Conditional Probability

By Jim Frost 4 Comments

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.

Meme of a cat enjoying a cardboard box.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:

Formula for conditional probability.

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:

Formula for the conditional probability of carrying an umbrella when it is raining.

Formula for the conditional probability of carrying an umbrella when it is not raining.

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!

P (Umbrella | Rain) = {\displaystyle \frac {0.20}{0.25}} = 0.80

P (Umbrella | No Rain) = {\displaystyle \frac {0.40}{0.75}} = 0.53

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.

Image of dice being rolled.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.

Calculations

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.

Formula for conditional probability of rolling a second six after rolling the first six.

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:

{\displaystyle \frac {0.028}{0.167}} = 0.167

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.

Share this:

  • Tweet

Related

Filed Under: Probability Tagged With: analysis example, conceptual

Reader Interactions

Comments

  1. Takota Lee says

    January 11, 2022 at 1:38 am

    Appreciate the explanation. I do have a question which I think conditional probability is the best solution but I could be wrong.

    For example: there are 20 envelopes. 10 have money and 10 do not. What is the probability of selecting an envelope with money before selecting 3 envelopes with no money? I am needing to find out the probability of selecting 1 thru 10 with money before getting 3 with no money.

    Clear as mud?

    Reply
  2. Mario M. Brenes says

    October 19, 2021 at 10:52 am

    I think you mean 6 not P on this statement

    “Consequently, the joint probability of two sixes is: P (62 ⋂ 61) = 0.167 * 0.167 = 0.028”

    Reply
    • Jim Frost says

      October 20, 2021 at 12:58 am

      Hi Mario,

      What I wrote is correct. It’s standard probability notation the signifies the joint probability of rolling two sixes. The P just means “probability.”

      Reply
  3. Arpit Rawat says

    October 18, 2021 at 7:59 am

    Very clear explanation. Thank you.

    Reply

Comments and Questions Cancel reply

Primary Sidebar

Meet Jim

I’ll help you intuitively understand statistics by focusing on concepts and using plain English so you can concentrate on understanding your results.

Read More...

Buy My Introduction to Statistics eBook!

New! Buy My Hypothesis Testing eBook!

Buy My Regression eBook!

Subscribe by Email

Enter your email address to receive notifications of new posts by email.

    I won't send you spam. Unsubscribe at any time.

    Follow Me

    • FacebookFacebook
    • RSS FeedRSS Feed
    • TwitterTwitter
    • Popular
    • Latest
    Popular
    • How To Interpret R-squared in Regression Analysis
    • How to Interpret P-values and Coefficients in Regression Analysis
    • Measures of Central Tendency: Mean, Median, and Mode
    • Normal Distribution in Statistics
    • Multicollinearity in Regression Analysis: Problems, Detection, and Solutions
    • How to Interpret the F-test of Overall Significance in Regression Analysis
    • Understanding Interaction Effects in Statistics
    Latest
    • Sampling Methods: Different Types in Research
    • Beta Distribution: Uses, Parameters & Examples
    • Geometric Distribution: Uses, Calculator & Formula
    • What is Power in Statistics?
    • Conditional Distribution: Definition & Finding
    • Marginal Distribution: Definition & Finding
    • Content Validity: Definition, Examples & Measuring

    Recent Comments

    • Chris Anderson on Guide to Data Types and How to Graph Them in Statistics
    • James on Introduction to Bootstrapping in Statistics with an Example
    • Khursheed Ahmad on Sampling Methods: Different Types in Research
    • Jim Frost on Interpreting Correlation Coefficients
    • Jim Frost on Interpreting Correlation Coefficients

    Copyright © 2022 · Jim Frost · Privacy Policy