BAYES THEORAM
Example
Example
• Lets consider another example of the use of Bayes Theorem. This time we are
given different information from the previous example.
• In a certain clinic 0.15 of the patients have got the HIV virus. Suppose a blood test
is carried out on a patient. If the patient has got the virus the test will turn out
positive with probability 0.95. If the patient does not have the virus the test will
turn out positive with probability 0.02.
• If the test is positive what are the probabilities that the patient
a) has the virus
b) does not have the virus?
• If the test is negative what are the probabilities that the patient
c) has the virus
d) does not have the virus?
• Lets give the events the following labels
H = the patient has got the virus
P = the outcome of the test is positive
• The question above gives us the following information.
P(H) = 0.15
P(P/H)=0.95
P(P/H’)=0.02
• And we are asked to find the following
a) P(H | P)
b) P(H’/P)
c) P(H’/P’)
d) P(H’/P’)
• To find the first of these, P(H|P), we can write
down Bayes Theorem
P(H/P) = P(P/H).P(H)
P(P)
• But we notice that we are given two of the
values on the right-hand side P(P|H) and P(H)
but we are not given P(P) – the probability of a
positive result. So we have to work this out
ourselves.
• Now there are two ways that a patient could
have a positive result:
– he has the virus and he gets a positive result
– he does not have the virus and he gets a positive
result
• We have to work out the probabilities of both
these cases and add them together.
P(P)=P(H^P)+P(H’^P)
• Now from the second axiom of probability we
have
P(H^P)=P(P/H)P(H)
=0.95*0.15=0.1425
P(H’^P)=P(P/H’)P(H)
= 0.02*0.85 = 0.017
SO
P(P)=0.1425+0.017=0.1595
P(H/P) = P(P/H).P(H)
P(P)
P(H/P) = 0.95 × 0.15 / 0.1595
= 0.8934
(B) P(H’/P)
P(H’/P)=1-P(H/P)
= 1- 0.8934
= 0.01066
( C ) P(H/P’)
P(H/P’)= P(P’/H)P(H)
P(P’)
= (0.05 * 0.15) / ( 1 - 0.1595)
= 0.0089233
(D) P(H/P)
P(H/P)=1-P(H/P’)
=1-0.0089233
=0.99107