Session 07-04 - Conditional Probability

Section 07: Probability & Statistics

Author

Dr. Nikolai Heinrichs & Dr. Tobias Vlćek

Entry Quiz - 10 Minutes

Quick Review from Session 07-03

Test your understanding of Combinatorics

  1. Calculate \(\binom{8}{3}\)

  2. How many ways can 5 people line up in a row?

  3. A committee of 3 is chosen from 10 people. How many ways?

  4. What’s the probability of getting exactly 3 heads in 5 coin flips? (Use combinations)

Learning Objectives

What You’ll Master Today

  • Define conditional probability: \(P(A|B) = \frac{P(A \cap B)}{P(B)}\)
  • Apply the multiplication rule: \(P(A \cap B) = P(A|B) \cdot P(B)\)
  • Construct and use tree diagrams for sequential events
  • Apply the law of total probability
  • Test for independence using conditional probability

. . .

Conditional probability is heavily tested on the Feststellungsprüfung!

Part A: Conditional Probability Concept

Motivation

Question: A card is drawn from a deck. What’s the probability it’s a king?

. . .

\[P(\text{King}) = \frac{4}{52} = \frac{1}{13}\]

. . .

Question: Given that the card is a face card, what’s the probability it’s a king?

. . .

The condition changes the sample space!

\[P(\text{King} | \text{Face card}) = \frac{4}{12} = \frac{1}{3}\]

Conditional Probability Definition

ImportantDefinition: Conditional Probability

The probability of A given that B has occurred:

\[P(A|B) = \frac{P(A \cap B)}{P(B)}\]

where \(P(B) > 0\).

. . .

Read “\(P(A|B)\)” as “probability of A given B”

Visual Interpretation

Example Calculation

In a company: 60% work full-time, 30% work full-time AND have a degree.

Question: What’s the probability an employee has a degree, given they work full-time?

. . .

Let D = has degree, F = full-time

\[P(D|F) = \frac{P(D \cap F)}{P(F)} = \frac{0.30}{0.60} = 0.50\]

. . .

Given that someone works full-time, there’s a 50% chance they have a degree.

Part B: Multiplication Rule

From Conditional to Joint Probability

Rearranging the definition:

ImportantMultiplication Rule

\[P(A \cap B) = P(A|B) \cdot P(B)\]

or equivalently:

\[P(A \cap B) = P(B|A) \cdot P(A)\]

. . .

Both formulas give the same result!

Example: Sequential Selection

A box contains 5 red and 3 blue balls. Two balls are drawn without replacement.

Question: What’s the probability both are red?

. . .

Let \(R_1\) = first ball red, \(R_2\) = second ball red

\[P(R_1 \cap R_2) = P(R_2|R_1) \cdot P(R_1)\]

. . .

\[= \frac{4}{7} \times \frac{5}{8} = \frac{20}{56} = \frac{5}{14}\]

Extended Multiplication Rule

For three or more events:

\[P(A \cap B \cap C) = P(A) \cdot P(B|A) \cdot P(C|A \cap B)\]

. . .

Example: Drawing 3 cards without replacement

\[P(\text{3 aces}) = \frac{4}{52} \times \frac{3}{51} \times \frac{2}{50} = \frac{24}{132,600} = \frac{1}{5,525}\]

Part C: Tree Diagrams

Visual Tool for Sequential Events

Tree diagrams show:

  • Branches = outcomes at each stage
  • Branch labels = probabilities (conditional if sequential)
  • Multiply along paths = joint probability
  • Add across paths = union probability

Example: Quality Control

A machine produces items that pass through 2 inspections.

  • 90% pass inspection 1
  • Of those passing inspection 1: 95% pass inspection 2
  • Of those failing inspection 1: 60% pass inspection 2

Reading Tree Diagrams

From the previous example:

. . .

P(item passes both inspections): Follow Pass-Pass path \[0.90 \times 0.95 = 0.855\]

. . .

P(item passes inspection 2): Add all paths ending with Pass I2 \[0.855 + 0.060 = 0.915\]

. . .

P(passed I1 | passed I2): (We’ll use Bayes for this later!) \[P(I_1|I_2) = \frac{P(I_1 \cap I_2)}{P(I_2)} = \frac{0.855}{0.915} \approx 0.934\]

Break - 10 Minutes

Part D: Law of Total Probability

Partitioning the Sample Space

ImportantLaw of Total Probability

If events \(B_1, B_2, ..., B_n\) partition the sample space (mutually exclusive and exhaustive):

\[P(A) = \sum_{i=1}^{n} P(A|B_i) \cdot P(B_i)\]

. . .

Common case with two partitions:

\[P(A) = P(A|B) \cdot P(B) + P(A|B') \cdot P(B')\]

Example: Market Segments

A company sells to three market segments:

  • Segment A: 50% of customers, 20% buy premium
  • Segment B: 30% of customers, 35% buy premium
  • Segment C: 20% of customers, 50% buy premium

. . .

Question: What percentage of all customers buy premium?

. . .

\[P(\text{Premium}) = 0.20(0.50) + 0.35(0.30) + 0.50(0.20)\] \[= 0.10 + 0.105 + 0.10 = 0.305\]

30.5% of customers buy premium products.

Part E: Independence Revisited

Testing Independence

ImportantIndependence Test

Events A and B are independent if and only if:

\[P(A|B) = P(A)\]

(Learning B occurred doesn’t change the probability of A)

. . .

Equivalently: \(P(B|A) = P(B)\) or \(P(A \cap B) = P(A) \cdot P(B)\)

Example: Testing Independence

Survey data shows:

  • \(P(\text{Exercise regularly}) = 0.40\)
  • \(P(\text{Healthy weight}) = 0.55\)
  • \(P(\text{Healthy weight}|\text{Exercise}) = 0.70\)

. . .

Question: Are “exercise regularly” and “healthy weight” independent?

. . .

Test: Is \(P(\text{Healthy}|\text{Exercise}) = P(\text{Healthy})\)?

\(0.70 \neq 0.55\)

. . .

Conclusion: Events are NOT independent - exercise is associated with healthy weight.

Guided Practice - 20 Minutes

Practice Problems

Work in pairs

Problem 1: 70% of students study math, 60% study economics, and 45% study both. a) Find \(P(\text{Econ}|\text{Math})\) b) Find \(P(\text{Math}|\text{Econ})\) c) Are these events independent?

Problem 2: Draw a tree diagram for: A bag has 3 red and 2 blue marbles. Two marbles are drawn without replacement. Find \(P(\text{both same color})\).

Wrap-Up & Key Takeaways

Today’s Essential Concepts

  • Conditional probability: \(P(A|B) = \frac{P(A \cap B)}{P(B)}\)
  • Multiplication rule: \(P(A \cap B) = P(A|B) \cdot P(B)\)
  • Tree diagrams: Multiply along paths, add across paths
  • Total probability: Sum over all branches
  • Independence: \(P(A|B) = P(A)\)

Next Session Preview

Coming Up: Bayes’ Theorem

  • Reversing conditional probabilities
  • Prior and posterior probabilities
  • Medical testing applications (sensitivity, specificity)
  • Business decision making

. . .

TipHomework

Complete Tasks 07-04 - focus on tree diagrams and conditional probability!