Tasks 07-06 - Contingency Tables & Bayes

Section 07: Probability & Statistics

Problem 1: Bayes’ Theorem Basics (x)

A medical test has the following characteristics: - Sensitivity: 90% (correctly identifies 90% of sick people) - Specificity: 95% (correctly identifies 95% of healthy people) - Prevalence: 5% (5% of the population has the disease)

  1. What is \(P(+|D)\)?
  2. What is \(P(-|D')\)?
  3. Calculate \(P(D|+)\) (PPV)
  4. Calculate \(P(D'|-)\) (NPV)

Problem 2: Contingency Table Construction (xx)

A company surveyed 200 employees about their commute method and job satisfaction: - 55% commute by car - 40% are highly satisfied - 30% commute by car AND are highly satisfied

  1. Construct a complete contingency table
  2. Find \(P(\text{Car}|\text{Highly Satisfied})\)
  3. Find \(P(\text{Highly Satisfied}|\text{Car})\)
  4. Are commute method and satisfaction independent?

Problem 3: Medical Testing - Full Analysis (xx)

A screening test for a disease has: - Sensitivity = 85% - Specificity = 92% - The disease affects 3% of the population

  1. Create a contingency table for a population of 10,000
  2. Calculate PPV directly from the table
  3. Calculate NPV directly from the table
  4. If you test positive, how worried should you be? Interpret PPV.

Problem 4: Factory Quality (xx)

A factory has two machines: - Machine A produces 70% of output, 4% defect rate - Machine B produces 30% of output, 6% defect rate

  1. What is the overall defect rate?
  2. A defective item is found. What’s the probability it came from Machine A?
  3. Create a contingency table for 1000 items
  4. Verify your answer to (b) using the table

Problem 5: Exam-Style Problem - 2025 Format (xxx)

In a city, a rapid test for a virus is available: - The test correctly identifies 92% of infected people (sensitivity) - The test correctly identifies 97% of non-infected people (specificity) - Currently 8% of the population is infected (prevalence)

A person tests positive.

  1. Calculate the probability that this person is actually infected (PPV).

  2. Now suppose the prevalence increases to 20% due to an outbreak. Recalculate PPV.

  3. Explain why PPV changes with prevalence.

  4. At what prevalence would PPV equal 80%? (Set up the equation and solve)

Problem 6: Exam-Style Problem - 2023 Format (xxx)

A company conducts employee surveys. Based on historical data: - 60% of employees are satisfied with their job - Of satisfied employees, 75% recommend the company to others - Of unsatisfied employees, 20% still recommend the company

  1. Create a contingency table for 500 employees
  2. What proportion of employees recommend the company?
  3. An employee recommends the company. What’s the probability they are satisfied?
  4. Are satisfaction and recommendation independent? Justify with calculations.