Factory Defects: Bayes' Theorem

Problem 2.6 • Given a defective bolt, which machine most likely produced it?

📋 Scenario: A factory has three machines (M₁, M₂, M₃) producing bolts. Each machine produces a different proportion of total output and has different defect rates.

❓ Question: A bolt is randomly selected and found to be defective. What is the probability it came from each machine?

🏭 Factory Machines

⚙️
Machine 1
Output: 30%
Defect Rate: 1%
⚙️
Machine 2
Output: 45%
Defect Rate: 2%
⚙️
Machine 3
Output: 25%
Defect Rate: 3%
⚠️
Defective Bolt Found!
Which machine produced it?

Posterior Probabilities P(Machine | Defect)

Machine 1
0%
Machine 2
0%
Machine 3
0%
Most Likely Source
Machine 2
47.4% probability

⚙️ Adjust Parameters

Machine 1

Output Share 30%
Defect Rate 1%

Machine 2

Output Share 45%
Defect Rate 2%

Machine 3

Output Share 25%
Defect Rate 3%

📐 Bayes' Theorem

P(Mᵢ|D) = P(D|Mᵢ) × P(Mᵢ) / P(D)
P(D) = 0.0185
= Σ P(D|Mᵢ)P(Mᵢ) (Total Probability)