2. Conditional Probability
Bayes Theorem — Quiz
Test your understanding of bayes theorem with 5 practice questions.
Practice Questions
Question 1
A disease has prevalence 5%. Two diagnostic tests are performed sequentially: Test 1 has sensitivity $0.80$ and specificity $0.90$, and Test 2 has sensitivity $0.85$ and specificity $0.85$. If a patient tests positive on both tests, what is the probability they have the disease?
Question 2
In a spam filter, the prior probability an email is spam is 15%. Three independent keywords X, Y, and Z appear with $P(X\mid \text{spam})=0.7$, $P(Y\mid \text{spam})=0.6$, $P(Z\mid \text{spam})=0.4$ and $P(X\mid \neg\text{spam})=0.1$, $P(Y\mid \neg\text{spam})=0.2$, $P(Z\mid \neg\text{spam})=0.05$. If an email contains X and Z but not Y, what is the probability it is spam?
Question 3
In Bayes' Theorem $P(A\mid B)=\frac{P(B\mid A)P(A)}{P(B)}$, what is the term $P(B)$ called?
Question 4
If the prior odds of hypothesis A are 2:1 and the likelihood ratio is 0.5, what are the posterior odds and the posterior probability of A?
Question 5
A factory has two machines. Machine 1 produces 30% of items with defect rate 2%, Machine 2 produces 70% with defect rate 5%. A sensor detects defects with sensitivity 95% and false positive rate 10%. If the sensor signals a defect, what is the probability it came from Machine 2?
