Conditional Probability

Probability given additional information

Conditional Probability

What is Conditional Probability?

Conditional Probability: Probability of event A given that event B has occurred

Notation: P(A|B) (read: "probability of A given B")

Key insight: New information (B occurred) changes the probability of A

Conditional Probability Formula

P(AโˆฃB)=P(AโˆฉB)P(B)P(A|B) = \frac{P(A \cap B)}{P(B)}

where P(B) > 0

Interpretation: Of all outcomes where B occurred, what fraction also have A?

Denominator P(B): Reduces sample space to just outcomes in B
Numerator P(A โˆฉ B): Outcomes in both A and B

Example 1: Two-Way Table

Survey of 100 students:

| | Male | Female | Total | |-----------|------|--------|-------| | Athlete | 25 | 15 | 40 | | Non-athlete| 35 | 25 | 60 | | Total | 60 | 40 | 100 |

Find P(Athlete|Male):

P(AthleteโˆฃMale)=P(Athleteย andย Male)P(Male)=25/10060/100=2560=512P(\text{Athlete}|\text{Male}) = \frac{P(\text{Athlete and Male})}{P(\text{Male})} = \frac{25/100}{60/100} = \frac{25}{60} = \frac{5}{12}

Interpretation: Of the 60 male students, 25 are athletes, so 25/60 = 5/12

Alternative approach: Restrict to males only (60 students), find fraction who are athletes (25/60)

Example 2: Cards

Draw one card from standard deck.

P(Ace|Red) = ?

  • P(Red) = 26/52
  • P(Ace and Red) = 2/52 (Ace of Hearts, Ace of Diamonds)
  • P(Ace|Red) = (2/52)/(26/52) = 2/26 = 1/13

Interpretation: Of 26 red cards, 2 are aces

Rearranging the Formula

Multiplication Rule:

P(AโˆฉB)=P(B)ร—P(AโˆฃB)P(A \cap B) = P(B) \times P(A|B)

Also:

P(AโˆฉB)=P(A)ร—P(BโˆฃA)P(A \cap B) = P(A) \times P(B|A)

Use: Find probability of both events when you know conditional probability

Example: P(Draw 2 aces without replacement)

  • P(First ace) = 4/52
  • P(Second ace|First ace) = 3/51
  • P(Both aces) = (4/52) ร— (3/51) = 12/2652 = 1/221

Independence Test

Events A and B are independent if:

P(AโˆฃB)=P(A)P(A|B) = P(A)

Equivalently: P(B|A) = P(B)

Meaning: Knowing B occurred doesn't change probability of A

Example: Flip coin twice

  • P(Second heads) = 1/2
  • P(Second heads|First heads) = 1/2
  • These are equal, so independent

Non-example: Cards without replacement

  • P(Second ace) = 4/52 (before first draw)
  • P(Second ace|First ace) = 3/51
  • These differ, so NOT independent

Tree Diagrams for Conditional Probability

Example: Disease testing

  • P(Disease) = 0.01
  • P(Positive|Disease) = 0.95 (sensitivity)
  • P(Positive|No disease) = 0.05 (false positive rate)

Find P(Positive):

Tree diagram:

  • Branch 1: Disease (0.01) โ†’ Positive (0.95): 0.01 ร— 0.95 = 0.0095
  • Branch 2: Disease (0.01) โ†’ Negative (0.05): 0.01 ร— 0.05 = 0.0005
  • Branch 3: No disease (0.99) โ†’ Positive (0.05): 0.99 ร— 0.05 = 0.0495
  • Branch 4: No disease (0.99) โ†’ Negative (0.95): 0.99 ร— 0.95 = 0.9405

P(Positive) = 0.0095 + 0.0495 = 0.059

Bayes' Theorem

Find P(B|A) when you know P(A|B):

P(BโˆฃA)=P(AโˆฃB)ร—P(B)P(A)P(B|A) = \frac{P(A|B) \times P(B)}{P(A)}

Example continued: Find P(Disease|Positive)

P(DiseaseโˆฃPositive)=P(PositiveโˆฃDisease)ร—P(Disease)P(Positive)P(\text{Disease}|\text{Positive}) = \frac{P(\text{Positive}|\text{Disease}) \times P(\text{Disease})}{P(\text{Positive})}

=0.95ร—0.010.059=0.00950.059โ‰ˆ0.161= \frac{0.95 \times 0.01}{0.059} = \frac{0.0095}{0.059} \approx 0.161

Interpretation: Even with positive test, only 16.1% chance of having disease (because disease is rare!)

Common Two-Way Table Calculations

Given table with events A and B:

Joint probability: P(A and B) = (count in both)/(total)

Marginal probability: P(A) = (row/column total)/(grand total)

Conditional probability: P(A|B) = (count in both)/(count in B)

Conditional Probability Notation

P(A|B) โ‰  P(B|A) (usually)

Example:

  • P(Positive test|Disease) = 0.95 (sensitivity)
  • P(Disease|Positive test) = 0.161 (very different!)

Always read carefully and identify which event is the condition!

Applications

Medical testing: P(Disease|Positive test)
Quality control: P(Defective|From certain machine)
Weather: P(Rain tomorrow|Rain today)
Sports: P(Win|Home game)

Common Mistakes

โŒ Confusing P(A|B) with P(B|A)
โŒ Assuming conditional independence means independence
โŒ Forgetting to restrict to condition when calculating from table
โŒ Using wrong denominator in formula

Practice Approach

  1. Identify condition: What do we know occurred?
  2. Restrict sample space: Consider only outcomes where condition is true
  3. Find fraction: Of those outcomes, what fraction satisfies event?
  4. Check: P(A|B) should be between 0 and 1

Quick Reference

Definition: P(AโˆฃB)=P(AโˆฉB)P(B)P(A|B) = \frac{P(A \cap B)}{P(B)}

Multiplication Rule: P(AโˆฉB)=P(B)ร—P(AโˆฃB)P(A \cap B) = P(B) \times P(A|B)

Independence Test: P(A|B) = P(A)

Bayes' Theorem: P(BโˆฃA)=P(AโˆฃB)ร—P(B)P(A)P(B|A) = \frac{P(A|B) \times P(B)}{P(A)}

Remember: Conditional probability is about updating probabilities based on new information!

๐Ÿ“š Practice Problems

1Problem 1easy

โ“ Question:

A standard deck has 52 cards (26 red, 26 black). If you draw one card and it's red, what is the probability it's a heart?

๐Ÿ’ก Show Solution

Step 1: Understand conditional probability Given: Card is red Find: P(Heart | Red)

This is "probability of Heart GIVEN that it's Red"

Step 2: Identify the reduced sample space Original sample space: 52 cards Given it's red: Only 26 red cards possible New sample space: 26 red cards

Step 3: Count favorable outcomes in reduced space Red cards: 13 hearts + 13 diamonds = 26 Hearts: 13

Step 4: Calculate conditional probability P(Heart | Red) = (Hearts among red cards) / (Total red cards) = 13/26 = 1/2

Step 5: Verify using conditional probability formula P(Heart | Red) = P(Heart AND Red) / P(Red)

P(Heart AND Red) = P(Heart) = 13/52 (hearts are red) P(Red) = 26/52

P(Heart | Red) = (13/52) / (26/52) = 13/52 ร— 52/26 = 13/26 = 1/2

Answer: P(Heart | Red) = 1/2 or 0.5

This makes sense: Given the card is red, it's equally likely to be a heart or diamond.

2Problem 2easy

โ“ Question:

In a school, 30% of students play basketball (B) and 20% play basketball and volleyball (B and V). If a student plays basketball, what is the probability they also play volleyball?

๐Ÿ’ก Show Solution

Step 1: Identify given information P(B) = 0.30 P(B AND V) = 0.20 Find: P(V | B) = ?

Step 2: Use conditional probability formula P(V | B) = P(V AND B) / P(B)

Note: P(V AND B) = P(B AND V) = 0.20

Step 3: Calculate P(V | B) = 0.20 / 0.30 = 2/3 โ‰ˆ 0.667

Step 4: Interpret Among students who play basketball:

  • 2/3 (about 67%) also play volleyball
  • This is different from overall volleyball rate in school

Step 5: Create a table for clarity Play V Don't Play V Total Play B 0.20 0.10 0.30 Don't Play B ? ? 0.70 Total ? ? 1.00

Among the 30% who play basketball:

  • 20% play both (so 20%/30% = 2/3 play volleyball)
  • 10% play only basketball

Answer: P(V | B) = 2/3 โ‰ˆ 0.667 or about 66.7%

3Problem 3medium

โ“ Question:

Roll a fair die. Event A: roll is even. Event B: roll is greater than 3. Find P(A|B) and P(B|A). Are they equal?

๐Ÿ’ก Show Solution

Step 1: Identify sample space and events Sample space S = {1, 2, 3, 4, 5, 6}

Event A (even): {2, 4, 6} P(A) = 3/6 = 1/2

Event B (greater than 3): {4, 5, 6} P(B) = 3/6 = 1/2

Event (A AND B): {4, 6} P(A AND B) = 2/6 = 1/3

Step 2: Calculate P(A | B) P(A | B) = P(A AND B) / P(B) = (2/6) / (3/6) = 2/6 ร— 6/3 = 2/3

Interpretation: Given roll is greater than 3, what's probability it's even? Options given B: {4, 5, 6} Even among these: {4, 6} = 2 out of 3 P(A | B) = 2/3

Step 3: Calculate P(B | A) P(B | A) = P(A AND B) / P(A) = (2/6) / (3/6) = 2/6 ร— 6/3 = 2/3

Interpretation: Given roll is even, what's probability it's greater than 3? Options given A: {2, 4, 6} Greater than 3 among these: {4, 6} = 2 out of 3 P(B | A) = 2/3

Step 4: Compare P(A | B) = 2/3 P(B | A) = 2/3 They ARE equal in this case!

Step 5: Why are they equal here? This happens when P(A) = P(B)

General rule: P(A | B) = P(B | A) if and only if P(A) = P(B)

Proof: If P(A) = P(B), then: P(A | B) = P(A AND B) / P(B) = P(A AND B) / P(A) = P(B | A)

Step 6: But this is NOT generally true! Example where they differ:

  • P(Rain | Cloudy) โ‰ˆ 0.3 (30% of cloudy days have rain)
  • P(Cloudy | Rain) โ‰ˆ 0.9 (90% of rainy days are cloudy)

Very different! Don't confuse P(A|B) with P(B|A)!

Answer: P(A|B) = 2/3 and P(B|A) = 2/3. They are equal in this specific case because P(A) = P(B) = 1/2. However, conditional probabilities are generally NOT equal: P(A|B) โ‰  P(B|A) in most cases.

4Problem 4medium

โ“ Question:

A bag contains 3 red marbles and 2 blue marbles. Draw two marbles WITHOUT replacement. What is the probability both are red?

๐Ÿ’ก Show Solution

Step 1: Understand "without replacement" After drawing first marble, don't put it back Second draw from reduced sample

Step 2: Use conditional probability P(Both Red) = P(1st Red AND 2nd Red) = P(1st Red) ร— P(2nd Red | 1st Red)

Step 3: Calculate P(1st Red) Initially: 3 red, 2 blue, total 5 P(1st Red) = 3/5

Step 4: Calculate P(2nd Red | 1st Red) Given 1st was red:

  • Remaining: 2 red, 2 blue, total 4
  • Sample space reduced!

P(2nd Red | 1st Red) = 2/4 = 1/2

Step 5: Calculate P(Both Red) P(Both Red) = P(1st Red) ร— P(2nd Red | 1st Red) = 3/5 ร— 1/2 = 3/10 = 0.3

Step 6: Verify using counting Total ways to draw 2 marbles from 5: C(5,2) = 5!/(2!ร—3!) = 10 ways

Ways to draw 2 red from 3 red: C(3,2) = 3!/(2!ร—1!) = 3 ways

P(Both Red) = 3/10 โœ“

Step 7: Compare with replacement If we replaced the first marble: P(1st Red) = 3/5 P(2nd Red | 1st Red) = 3/5 (same as first) P(Both Red) = 3/5 ร— 3/5 = 9/25 = 0.36

WITHOUT replacement: 3/10 = 0.30 (lower) WITH replacement: 9/25 = 0.36 (higher)

Makes sense: removing a red marble makes it harder to get another red

Answer: P(Both Red) = 3/10 = 0.3

Key insight: Without replacement, outcomes are dependent. The first draw affects probabilities for the second draw (conditional probability).

5Problem 5hard

โ“ Question:

A medical test is 95% accurate for detecting a disease when present, and 90% accurate when the disease is absent. If 2% of the population has the disease, what is the probability a person with a positive test actually has the disease? Use a tree diagram.

๐Ÿ’ก Show Solution

Step 1: Organize the information P(Disease) = 0.02 P(No Disease) = 0.98

P(Positive | Disease) = 0.95 (true positive rate) P(Negative | Disease) = 0.05 (false negative rate)

P(Positive | No Disease) = 0.10 (false positive rate) P(Negative | No Disease) = 0.90 (true negative rate)

Find: P(Disease | Positive) = ?

Step 2: Create tree diagram and calculate joint probabilities

First Branch: Disease Status โ”œโ”€ Disease (0.02) โ”‚ โ”œโ”€ Positive (0.95): 0.02 ร— 0.95 = 0.0190 โ”‚ โ””โ”€ Negative (0.05): 0.02 ร— 0.05 = 0.0010 โ”‚ โ””โ”€ No Disease (0.98) โ”œโ”€ Positive (0.10): 0.98 ร— 0.10 = 0.0980 โ””โ”€ Negative (0.90): 0.98 ร— 0.90 = 0.8820

Step 3: Find P(Positive) using Law of Total Probability P(Positive) = P(Positive AND Disease) + P(Positive AND No Disease) = 0.0190 + 0.0980 = 0.1170

Step 4: Use Bayes' Theorem P(Disease | Positive) = P(Positive | Disease) ร— P(Disease) / P(Positive) = P(Disease AND Positive) / P(Positive) = 0.0190 / 0.1170 โ‰ˆ 0.162

Step 5: Interpret the result Only about 16.2% of people who test positive actually have the disease!

Why so low?

  • Disease is rare (2%)
  • Many false positives from the 98% without disease
  • Even with 90% specificity, 10% of 98% = 9.8% false positives
  • False positives (9.8%) greatly outnumber true positives (1.9%)

Step 6: Create a table per 10,000 people Test Positive Test Negative Total Has Disease 190 10 200 No Disease 980 8,820 9,800 Total 1,170 8,830 10,000

P(Disease | Positive) = 190/1,170 โ‰ˆ 0.162

Answer: P(Disease | Positive) โ‰ˆ 0.162 or 16.2%

This counterintuitive result shows why positive tests often require confirmation - most positive results are false positives when the condition is rare!