Lecture 11 Bayes Theorem





P(Ac ∩ B) + P(A ∩ B)=P(B)
P(Ac ∩ B) and P(A ∩ B) are called joint
probability.
P(A) and P(B) are called marginal probability.
P(A|B) and P(B|A) are called conditional
probability.



Someone is shooting at a target. If it is
windy, he has a 40% chance hitting the
target. If there is no wind, his chance is
70%.
A. If there is a 12% chance of being windy,
what is his chance of hitting the target?
B. If he hits the target, what is the chance of
it being windy???

Bayes theorem:
◦ Bayes theorem deals with another type of question.
◦ Think about conditional probability: it answers the
question: if A happens then what is the chance for B to
happen? ( A is a condition for B)
◦ Bayes theorem answers another question: If B happens,
what is the chance of A happening. (A is still a condition for
B)


Think about total probability formula (two
events case)
P(A)=P(B1)P(A|B1)+P(B2)P(A|B2)
◦ Now we want to know P(B1|A)
◦ P(B1|A)
= P(B1)P(A|B1) / [P(B1)P(A|B1)+P(B2)P(A|B2)]
= P(B1)P(A|B1) / P(A)
◦ P(B2|A)
= P(B2)P(A|B2) / [P(B1)P(A|B1)+P(B2)P(A|B2)]
= P(B2)P(A|B2) / P(A)


It deals with the question that if we observe
an outcome from an event, A, that is
conditional on the outcome of another event,
B, what is the probability for each of the
outcomes of event B.
Compare with conditional probability:
◦ Conditional probability deals with that given the
outcome of B, what is the probability of A.


The denominator is always the probability
that an outcome of A, which is found from
total probability formula.
The numerator is the part in the total
probability formula that addresses the
outcome of B that we are interested in.






All the problems start with two events, A and B.
One event is always conditional on the other.
1. Determine which event is conditional on the
other. If the outcome of A depends on the
outcome of B, A is conditional on B.
2. Find out all the possible outcomes of B and
their corresponding probabilities.
3. Find out which outcome of A actually occurred.
4. Construct the total probability formula.
5. Apply the Bayes’ formula.







Let A={hit the target}, B={it is windy}. Then
BC={it is not windy}.
We want to calculate P(B|A)
By Bayes Theorem:
P(B|A)= P(B)P(A|B) / [P(B)P(A|B)+P(BC)P(A| BC)]
= P(B)P(A|B) / P(A)
= 0.12*0.4/(0.12*0.4+0.88*0.7
=0.07

In an exam, there is a problem that 60% of
students know the correct answer. However,
there is 15% chance that a student picked the
wrong answer even if he/she knows it and
there is also a 25% chance that a student
does not know the answer but guessed it
correctly. If a student did get the problem
right, what is the chance that this student
really knows the answer? What if he/she did
not get it right?

In order to detect whether a suspect is lying,
police sometimes use polygraph. Let
A={polygraph indicates lying} and B={the
suspect is lying}. If the suspect is lying, there
is a 88% chance of detecting it; if the suspect
is telling the truth, 86% of time the polygraph
will confirm it. We assume that 1% of the time
the suspects lie. If the result of polygraph
shows that the suspect is lying, what is the
chance that this person is really lying?

There is a new disease that the authority
believe 30% people are infected. A company
provided a test that can detect whether a
person has the disease or not. If the person
really has the disease, the test will miss it
10% of the time. If the person is not infected,
the test will show negative 75% of the time. If
someone has got a positive result, what is
his/her chance of really having the disease?

Always have a good idea of which outcome
are we looking at, so that we can correctly set
up the total probability formula.

Suppose you want to catch an early flight at
Indy airport. You have the following plans:
◦ 1. Let your friend drive you to the airport, with
20% chance of missing the flight.
◦ 2. Taking the Lafayette Limo with a 25% chance of
missing the flight.
◦ 3. Hitch hike yourself with 50% of missing the
flight.
If your preference is 40% taking Lafayette Limo,
35% hitch hike and 25% asking your friend to
drive, what is your chance of missing the flight.

If you actually caught the flight, what is
your chance of choosing hitch hike?



Kokomo, Indiana. In Kokomo, IN, 65% are
conservatives, 20% are liberals and 15% are
independents.
Records show that in a particular election 82%
of conservatives voted, 65% of liberals voted
and 50% of independents voted.
If the person from the city is selected at
random and it is learned that he/she did not
vote, what is the probability that the person is
liberal?