Search⌘ K
AI Features

Bayes' Theorem and Bayesian Thinking

Explore how to apply Bayes theorem to calculate conditional probabilities and update estimates based on prior information. Understand common pitfalls like reversing conditionals and ignoring base rates. Practice constructing count tables and interpreting test results to strengthen your reasoning in data science interviews.

An interviewer asks, “A condition affects 1% of items. A test correctly identifies 90% of affected items, while 10% of unaffected items also test positive. Given a positive result, what is the probability that the item has the condition?”

LetCCmean an item has the condition and++mean the test is positive. The target is:

The prompt does not ask for P(+∣C)P(+\mid C), even though the 90% detection rate gives us that quantity. This distinction is the high-risk part of the question. A test’s ability to detect known cases does not directly tell us how often a positive test identifies a real case.

A weak answer says 90%. That answer silently replaces the requested probability P(C∣+)P(C\mid +) with the supplied probability P(+∣C)P(+\mid C). The conditional bar changes the population in the denominator. For P(+∣C)P(+\mid C) ...