Using Bayes' theorem, find the probability that a defective item came from a specific machine

Quick Overview

Use Bayes' theorem to find the probability that a defective item came from a given machine, when each machine's production share and defect rate are known. Tests priors, likelihoods, the law of total probability and reading a posterior correctly.

Using Bayes' theorem, find the probability that a defective item came from a specific machine

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Other

A factory runs several machines. For each machine you know its share of total production and its defect rate. An item drawn at random from the combined output turns out to be defective. How would you determine the probability that it was produced by a specific machine, using Bayes' theorem? ```hint What you know and what you want You are given each machine's defect rate. Write down which conditional probability that is, and which one the question asks for. ``` ```hint The denominator Before you can reverse the conditioning, you need the overall chance that a randomly chosen item is defective. ``` ### What a Strong Answer Covers - Identifies the prior (production share) and the likelihood (defect rate) for each machine - Computes the overall defect probability with the law of total probability - Applies Bayes' theorem to get the posterior for the chosen machine - Works a numeric example and checks that the posteriors across machines sum to 1 - Explains why the answer can differ sharply from the production share alone ### Follow-up Questions - You find two defective items and know they came from the same machine. How does the posterior change? - An inspector catches only some defects, and you only see items that were flagged. When does the detection rate matter for the answer? - The defect rates were estimated from small inspection samples. How would you reflect that uncertainty in the posterior?

Overview: Use Bayes' theorem to find the probability that a defective item came from a given machine, when each machine's production share and defect rate are known. Tests priors, likelihoods, the law of total probability and reading a posterior correctly.

General logo
General
Nov 25, 2026
mediumData ScientistOtherStatistics & Math
0
0

A factory runs several machines. For each machine you know its share of total production and its defect rate. An item drawn at random from the combined output turns out to be defective. How would you determine the probability that it was produced by a specific machine, using Bayes' theorem?

What a Strong Answer Covers Guidance

  • Identifies the prior (production share) and the likelihood (defect rate) for each machine
  • Computes the overall defect probability with the law of total probability
  • Applies Bayes' theorem to get the posterior for the chosen machine
  • Works a numeric example and checks that the posteriors across machines sum to 1
  • Explains why the answer can differ sharply from the production share alone

Follow-up Questions Guidance

  • You find two defective items and know they came from the same machine. How does the posterior change?
  • An inspector catches only some defects, and you only see items that were flagged. When does the detection rate matter for the answer?
  • The defect rates were estimated from small inspection samples. How would you reflect that uncertainty in the posterior?