Suppose a test for diagnosing a certain disease is successful in detecting the disease in $95$% of all persons infected, but it incorrectly diagnoses $4$% of all healthy people as having the serious disease. Suppose also that it incorrectly diagnoses $12$% of all people having another minor disease as having the serious disease. It is known that $2$% of the population has the serious disease, $90$% of the population is healthy, and $8$% has the minor disease.
Use Bayes formula to find the probability that a person selected at random has the serious disease, given that the test indicates that he or she does Use $H$ to represent healthy, $M$ to represent having the minor disease and D to represent having the serious disease.
This is what I've started with and I'm not sure if I'm on the right track because I don't fully understand this:
$5$% diseased people ($100-95$% successful diagnosis), $96$% of healthy people ($100-4$%incorrectly diagnosed), $88$% minor ($100-12$% of people having minor disease)
$P[M | H] 88 \cdot 8=7.04$%
$P[D | H]\ 5 \cdot 2=0.1$%
$P[H | H]\ 96 \cdot 90=86.4$%
$P[D| H]\ = 0.1+86.4+7.04=93.54$%
I don't understand Bayes Formula at all, please explain... am I on the right track?
I won't work the problem completely, but will try to give you a useful way to start.
You know $P(D) = 0.02, P(T|D) = 0.95,$ and $P(N|D^c) = 0.96,$ where $T$ indicates a positive test (disease detected) and $N = T^c$ indicates a negative test (no detection). You are asked to find $P(D|T).$
It seems to me that the information about the minor disease is a distraction.
If this is correct, then $P(D|T) = P(D\cap T)/P(T),$ and you can find $P(D\cap T) = P(D)P(T|D).$ And then you can find $P(T) = P(D\cap T) + P(D^c\cap T).$
What remains is for you to find $P(D^c\cap T)$ in a manner somewhat similar to the that used to find $P(D\cap T),$ but using complement rules.
Among the "Related" links in the right-hand margin of this page, you should find several completed computations of this type. This section from Wikipedia may also be helpful; let 'User' be $D.$ (This article is not easy to find via Google using sensible search words because commercial junk takes over their first few pages.)