The Overconfident Defect Scanner

In a chip fab, 1% 1\% of chips coming off the line are defective. An optical scanner flags 99% 99\% of defective chips (its sensitivity) and correctly passes 95% 95\% of good chips (its specificity), meaning 5% 5\% of good chips get wrongly flagged. A chip is pulled at random from the line and the scanner flags it. What is the probability the chip is actually defective?

Answer

Free accounts unlock one worked solution a day. Pro includes every answer.