Statistics

Conditional Probability

Last updated: March 2026 · Intermediate
Before you start

You should be comfortable with:

Real-world applications
💊
Nursing

Medication dosages, IV drip rates, vital monitoring

Conditional probability answers the question: “What is the probability of event A, given that event B has already happened?” The notation P(AB)P(A \mid B) is read as “the probability of A given B.” This concept is fundamental to interpreting real-world data, from medical test results to survey analysis.

The Conditional Probability Formula

The conditional probability of A given B is:

P(AB)=P(A and B)P(B)P(A \mid B) = \frac{P(A \text{ and } B)}{P(B)}

This formula takes the joint probability of both events happening and divides by the probability of the condition (event B). You are essentially narrowing the sample space to only those outcomes where B has occurred, then asking how likely A is within that restricted space.

Important: P(B)P(B) must be greater than 0 — you cannot condition on an impossible event.

Example 1: Cards

A card is drawn at random from a standard 52-card deck. Given that the card is red, what is the probability it is a face card?

Step 1: Identify the events.

  • Event A: the card is a face card (jack, queen, king)
  • Event B: the card is red (hearts or diamonds)

Step 2: Find the required probabilities.

A standard deck has 26 red cards and 6 red face cards (jack, queen, king of hearts and diamonds).

P(red and face)=652P(\text{red and face}) = \frac{6}{52}

P(red)=2652P(\text{red}) = \frac{26}{52}

Step 3: Apply the formula.

P(facered)=P(red and face)P(red)=6/5226/52=626=3130.231P(\text{face} \mid \text{red}) = \frac{P(\text{red and face})}{P(\text{red})} = \frac{6/52}{26/52} = \frac{6}{26} = \frac{3}{13} \approx 0.231

Answer: Given that a card is red, there is a 313\frac{3}{13} (about 23.1%) chance it is a face card.

Notice this equals the unconditional probability of drawing a face card (1252=313\frac{12}{52} = \frac{3}{13}), which makes sense — being red does not change the proportion of face cards. This tells us that “face card” and “red card” are independent events in a standard deck.

Conditional Probability from Two-Way Tables

Two-way tables (also called contingency tables) are one of the most practical tools for calculating conditional probabilities. The table organizes data by two categories, making it straightforward to read off the numbers you need.

Example 2: Employee Survey

A company surveyed 250 employees about job satisfaction:

SatisfiedNot SatisfiedTotal
Full-time12030150
Part-time6040100
Total18070250

Question A: What is the probability that an employee is satisfied, given that they are full-time?

We restrict the sample to full-time employees (150 total) and count how many are satisfied (120).

P(SatisfiedFull-time)=120150=0.80=80%P(\text{Satisfied} \mid \text{Full-time}) = \frac{120}{150} = 0.80 = 80\%

Question B: What is the probability that an employee is full-time, given that they are satisfied?

Now we restrict the sample to satisfied employees (180 total) and count how many are full-time (120).

P(Full-timeSatisfied)=120180=230.667=66.7%P(\text{Full-time} \mid \text{Satisfied}) = \frac{120}{180} = \frac{2}{3} \approx 0.667 = 66.7\%

Critical observation: P(AB)P(BA)P(A \mid B) \neq P(B \mid A) in general. In this example, 80% of full-time employees are satisfied, but only 66.7% of satisfied employees are full-time. These are different questions with different answers. Confusing P(AB)P(A \mid B) with P(BA)P(B \mid A) is one of the most common errors in probability.

Tree Diagrams

A tree diagram is a visual tool for organizing multi-stage probability problems. Each branch represents a possible outcome at that stage, and the probability is written along the branch. To find the probability of any complete path, you multiply along the branches.

Example 3: Manufacturing Defects

A company has two factories. Factory A produces 60% of the company’s output, and Factory B produces 40%. The defect rates differ: Factory A has a 2% defect rate, and Factory B has a 5% defect rate.

Tree Diagram: Factory Production and Defects

0.600.40AB0.020.980.050.95DefectiveNot Def.DefectiveNot Def.= 0.012= 0.588= 0.020= 0.380

Reading the tree: Multiply along each branch to get joint probabilities.

  • P(Factory A and Defective) = 0.60×0.02=0.0120.60 \times 0.02 = 0.012
  • P(Factory A and Not Defective) = 0.60×0.98=0.5880.60 \times 0.98 = 0.588
  • P(Factory B and Defective) = 0.40×0.05=0.0200.40 \times 0.05 = 0.020
  • P(Factory B and Not Defective) = 0.40×0.95=0.3800.40 \times 0.95 = 0.380

Verification: All four joint probabilities must sum to 1.

0.012+0.588+0.020+0.380=1.0000.012 + 0.588 + 0.020 + 0.380 = 1.000 \checkmark

What is the overall probability that a randomly selected product is defective?

Add all paths leading to “Defective”:

P(defective)=0.012+0.020=0.032=3.2%P(\text{defective}) = 0.012 + 0.020 = 0.032 = 3.2\%

Given that a product is defective, what is the probability it came from Factory B?

P(Bdefective)=P(B and defective)P(defective)=0.0200.032=0.625=62.5%P(B \mid \text{defective}) = \frac{P(B \text{ and defective})}{P(\text{defective})} = \frac{0.020}{0.032} = 0.625 = 62.5\%

Even though Factory B makes only 40% of the products, it is responsible for 62.5% of the defective ones because of its higher defect rate.

Independence and Conditional Probability

Conditional probability provides a precise way to define independence. Two events A and B are independent if and only if:

P(AB)=P(A)P(A \mid B) = P(A)

In words: knowing that B happened does not change the probability of A. When this holds, the conditional probability formula simplifies to the multiplication rule for independent events:

P(A and B)=P(A)P(B)P(A \text{ and } B) = P(A) \cdot P(B)

Example: In the employee survey above, is employment type independent of satisfaction?

P(Satisfied)=180250=0.72P(\text{Satisfied}) = \frac{180}{250} = 0.72

P(SatisfiedFull-time)=120150=0.80P(\text{Satisfied} \mid \text{Full-time}) = \frac{120}{150} = 0.80

Since 0.800.720.80 \neq 0.72, the events are not independent. Full-time employees are more likely to be satisfied than the overall workforce.

Real-World Application: Nursing — Interpreting Diagnostic Test Results

In healthcare, conditional probability is essential for understanding what a test result actually means. Two key measures describe a diagnostic test:

  • Sensitivity = P(positivedisease)P(\text{positive} \mid \text{disease}) — the probability of a positive result given the patient has the disease
  • Specificity = P(negativeno disease)P(\text{negative} \mid \text{no disease}) — the probability of a negative result given the patient does not have the disease

Consider a screening test with the following characteristics:

  • Sensitivity: 95% — the test catches 95% of true cases
  • Specificity: 90% — the test correctly clears 90% of healthy patients
  • Disease prevalence: 1% — the disease occurs in 1% of the population

A patient tests positive. What is the probability they actually have the disease? That is, what is P(diseasepositive)P(\text{disease} \mid \text{positive})?

This is a problem where P(AB)P(A \mid B) and P(BA)P(B \mid A) are very different. The sensitivity tells us P(positivedisease)=0.95P(\text{positive} \mid \text{disease}) = 0.95, but we need P(diseasepositive)P(\text{disease} \mid \text{positive}) — the reverse. Solving this requires Bayes’ theorem, which builds directly on the conditional probability concepts covered here.

The surprising result (which you will see on the Bayes’ theorem page) is that even with a 95%-accurate test, a positive result in a low-prevalence condition means only about an 8.8% chance the patient is actually affected. This is why nurses are trained to understand that a positive screening result is not a diagnosis — it is a signal to pursue confirmatory testing.

Practice Problems

Test your understanding with these problems. Click to reveal each answer.

Problem 1: A survey of 500 students found that 200 play sports, 150 play music, and 60 play both. What is the probability that a student plays music, given that they play sports?

P(MusicSports)=P(Music and Sports)P(Sports)=60/500200/500=60200=0.30P(\text{Music} \mid \text{Sports}) = \frac{P(\text{Music and Sports})}{P(\text{Sports})} = \frac{60/500}{200/500} = \frac{60}{200} = 0.30

Answer: Given that a student plays sports, there is a 30% chance they also play music.

Problem 2: Using the same survey data, what is the probability that a student plays sports, given that they play music?

P(SportsMusic)=60/500150/500=60150=0.40P(\text{Sports} \mid \text{Music}) = \frac{60/500}{150/500} = \frac{60}{150} = 0.40

Answer: Given that a student plays music, there is a 40% chance they also play sports. Notice this is different from the answer to Problem 1.

Problem 3: A box contains 8 chocolates: 5 milk and 3 dark. You eat one chocolate (it turns out to be milk), then pick another. What is the probability the second chocolate is dark?

After eating one milk chocolate, the box has 4 milk and 3 dark (7 total).

P(dark secondmilk first)=370.429P(\text{dark second} \mid \text{milk first}) = \frac{3}{7} \approx 0.429

Answer: The probability is 37\frac{3}{7}, or about 42.9%.

Problem 4: At a clinic, 70% of patients are adults and 30% are children. Among adults, 40% have insurance. Among children, 60% have insurance. A randomly selected patient has insurance. What is the probability they are a child?

Step 1: Find P(insurance)P(\text{insurance}).

P(insurance)=P(adult)×P(insadult)+P(child)×P(inschild)P(\text{insurance}) = P(\text{adult}) \times P(\text{ins} \mid \text{adult}) + P(\text{child}) \times P(\text{ins} \mid \text{child})

=0.70×0.40+0.30×0.60=0.28+0.18=0.46= 0.70 \times 0.40 + 0.30 \times 0.60 = 0.28 + 0.18 = 0.46

Step 2: Apply the formula.

P(childinsurance)=P(child and insurance)P(insurance)=0.180.460.391P(\text{child} \mid \text{insurance}) = \frac{P(\text{child and insurance})}{P(\text{insurance})} = \frac{0.18}{0.46} \approx 0.391

Answer: About 39.1% of insured patients are children.

Problem 5: A two-way table shows that out of 300 orders, 180 were online and 120 were in-store. Of the online orders, 27 had returns. Of the in-store orders, 12 had returns. What is P(onlinereturn)P(\text{online} \mid \text{return})?

Total returns = 27+12=3927 + 12 = 39.

P(onlinereturn)=2739=9130.692P(\text{online} \mid \text{return}) = \frac{27}{39} = \frac{9}{13} \approx 0.692

Answer: Given that an order was returned, there is about a 69.2% chance it was an online order.

Key Takeaways

  • Conditional probability is P(AB)=P(A and B)P(B)P(A \mid B) = \frac{P(A \text{ and } B)}{P(B)} — the probability of A within the restricted world where B is true.
  • Two-way tables make conditional probability calculations straightforward: restrict to the given row or column, then divide.
  • Tree diagrams organize multi-stage problems by multiplying along branches to get joint probabilities.
  • P(AB)P(BA)P(A \mid B) \neq P(B \mid A) in general — confusing these is one of the most common probability errors.
  • Events are independent when P(AB)=P(A)P(A \mid B) = P(A) — knowing B happened does not change the probability of A.
  • In healthcare, sensitivity P(+disease)P(\text{+} \mid \text{disease}) and the reverse P(disease+)P(\text{disease} \mid \text{+}) are very different — understanding this distinction can affect patient care.

Return to Statistics for more topics in this section.

Last updated: March 29, 2026