Let
be the event that a randomly selected person has the condition, and
the event that the test returns a positive result. We are given that

(false positive; that is, the event that the test incorrectly returns a positive result)
(false negative; incorrectly returns a negative result)
We want to find
. By definition of conditional probability,

By the same definition,

and by the law of total probability,

So we have (and this is known as Bayes' rule)

