The classic framing: a test for a rare condition has some prior probability of the condition (prior), a sensitivity (probability the test is positive given the condition is present), and a false positive rate (probability the test is positive given the condition is absent). Given a positive result, what's the actual probability the condition is present?
This is the exact mechanism behind why a rare-disease test with a seemingly-impressive sensitivity can still have a low posterior probability of a positive result being real — one of the most consistently counter-intuitive real results in applied probability.
Your task: implement bayes_posterior(prior, sensitivity, false_positive_rate), returning P(condition∣positive).