Bayes Theorem PDF
Bayes Theorem PDF
Bayes’ Theorem
Bayes’ Theorem (or Bayes’ Rule) is a very famous theorem in statistics. It was originally stated by the
Reverend Thomas Bayes.
If we have two events A and B, and we are given the conditional probability of A given B, denoted
P(A|B), we can use Bayes’ Theorem to find P(B|A), the conditional probability of B given A.
P(A|B)P(B)
Bayes’ Theorem: P(B|A) =
P(A|B)P(B) + P(A|B0 )P(B0 )
Example:
Q: In a factory there are two machines manufacturing bolts. The first machine manufactures 75%
of the bolts and the second machine manufactures the remaining 25%. From the first machine 5%
of the bolts are defective and from the second machine 8% of the bolts are defective. A bolt is se-
lected at random, what is the probability the bolt came from the first machine, given that it is defective?
A:
Let A be the event that a bolt is defective and let B be the event that a bolt came from Machine 1.
Check that you can see where these probabilites come from!
P(B) = 0.75 P(B0 ) = 0.25 P(A|B) = 0.05 P(A|B0 ) = 0.08
Now, use Bayes’ Theorem to find the required probability:
P(A|B)P(B)
P(B|A) =
P(A|B)P(B) + P(A|B0 )P(B0 )
0.05 × 0.75
=
0.05 × 0.75 + 0.08 × 0.25
= 0.3846
Try this:
Exercise: Among a group of male pensioners, 10% are smokers and 90% are nonsmokers. The proba-
bility of a smoker dying in the next year is 0.05 while the probability for a nonsmoker is 0.005. Given
one of these pensioners dies in the next year, what is the probability that he is a smoker?