LECTURE 3
Conditional Probability
Lecturer: Nguyen Thi Thu Van
Email: [Link]@[Link]
Content
Conditional probability
Statistical independence
Marginal probability
Decision trees
Multiplication rule
Bayes’ theorem
Conditional Probability
The probability of event A
given that event B has
occurred.
Multiplication rule
P(A B) P(A | B) P(B)
P(A B) P(A) P(B)
Examples Dependent vs. Independent events
Independent events
are not affected by Dependent events
previous events. depend on what
happened before.
What color marbles could be picked out of the bag next time?
Example
Suppose 50 percent of the customers at
Pizza Palooza order a pizza, 80 percent
order a soft drink, and 40 percent order both
a pizza and a soft drink.
Is ordering a soft drink
independent of ordering
a pizza?
An other Example
Over 1,000 people try to climb Mt. Everest every year.
Of those who try to climb Everest, 31 percent
succeed. The probability that a climber is at least 60
years old is 0.04. The probability that a climber is at
least 60 years old and succeeds in climbing Everest
is 0.005.
Find the probability of success, given that a climber
is at least 60 years old.
Is success in climbing Everest independent of age?
From the Law of independent events to System Reliability
Suppose that a website has two independent file servers A and B.
If each has 99 percent reliability, what is the total reliability?
Let A, B = the event the server A, B will be uptime, respectively.
The principle of redundancy: when individual components have
a low reliability, high reliability can be still achieved with
massive redundancy.
Example
Bob sets two alarm clocks (battery-powered) to be
sure he arises for his Monday 8:00 a.m.
accounting exam. There is a 75 percent chance
that either clock will wake Bob.
What is the probability that Bob will oversleep?
If Bob had three clocks, would he have a 99
percent chance of waking up?
An other Example
Suppose that
A hospital’s backup power system has three
independent emergency electrical generators,
each with uptime averaging 95 percent (some
downtime is necessary for maintenance).
Any of the generators can handle the hospital’s
power needs.
Does the overall reliability of the backup power
system meet the five nines test?
Odds of an Event
Odds of an Event
The odds in favor of event A The odds against event A
Number of Event A Number of Event Not A
Number of Event Not A Number of Event A
The odds in favor of Red The odds against Red
P ( A) 1 P ( A)
P( A) P( A) Odds
Odds = P ( A) P ( A)
P( A ') 1 P( A)
What are odds of an event?
The odds in favor of an event A is the ratio of the
probability that event A will occur to the probability
𝑃 𝐴
that event A will not occur: 𝑂𝑑𝑑𝑠 𝑖𝑛 𝑓𝑎𝑣𝑜𝑟𝐴 =
1−𝑃(𝐴)
Its reciprocal is the odds against event A:
1−𝑃(𝐴)
𝑂𝑑𝑑𝑠 𝑎𝑔𝑎𝑖𝑛𝑠𝑡 𝐴 =
𝑃 𝐴
Statisticians usually speak of probabilities rather than
odds, but in sports and games of chance, we often
hear odds quoted.
Example. Suppose the IRS tax audit rate is 1.41
percent among taxpayers earning between
$100,000 and $199,999.
Let 𝐴 = the event that the taxpayer is audited and
set 𝑃 𝐴 = 0.0141.
The odds against an audit are
𝑃(𝑛𝑜 𝑎𝑢𝑑𝑖𝑡) 𝑃(𝐴′) 1 − 𝑃(𝐴) 1 − 0.0141
= = = = 70
𝑃(𝑎𝑢𝑑𝑖𝑡) 𝑃(𝐴) 𝑃(𝐴) 0.0141
meaning 70 to 1 against being audited.
How to Find Probability?
Contingency Table
Collect data of 100 cars:
Each car either has AC or no AC
Each car either has GPS or no GPS
GPS No GPS Total
AC 35 55 90
No AC 5 5 10
Total 40 60 100
Of the 100 cars studied,
Marginal probability: 90% have air conditioning (AC)
and 40% have a GPS.
Joint probability:
35% of the cars have both.
GPS No GPS Total
AC 0.35 0.55 0.90
No AC 0.05 0.05 0.10
Total 0.40 0.60 1.00
Conditional probability:
P(GPS AC) 0.35
P(GPS | AC) 0.3889
P(AC) 0.90
Decision Trees
Decision Trees
.35
.90 P(AC ∩ GPS) = 0.35
Given AC or
no AC:
.55 P(AC ∩ GPS’) = 0.55
.90
All Conditional
Probabilities
Cars
.05
.10 P(AC’ ∩ GPS) = 0.05
.05 P(AC’ ∩ GPS’) = 0.05
.10
Decision Trees
.35
.40 P(GPS and AC) = 0.35
Given GPS
or no GPS:
.05 P(GPS and AC’) = 0.05
.40
All Conditional
Probabilities
Cars
.55
.60 P(GPS’ and AC) = 0.55
.05 P(GPS’ and AC’) = 0.05
.60
Example: Of grocery shoppers who have a shopping
cart, 70% pay by credit/debit card (event C1), 20% pay
cash (event C2), and 10% pay by check (event C3).
Of shoppers without a grocery cart, 50% pay by
credit/debit card (event C1), 40% pay cash (event C2),
and 10% pay by check (event C3).
On Saturday morning, 80% of the shoppers take a
shopping cart (event S1) and 20% do not (event S2).
Sketch a tree based on these data.
Calculate the probability of all joint probabilities.
Bayes’ Theorem
Bayes’ Theorem is derived from the definition of
conditional probability and the law of total
probability. It is used to update previously
calculated probabilities in light of new information.
Developed by
Thomas
Bayes in the
18th Century.
Example. Based on historical data, three
hospital trauma centers handle 50%, 30%, and
20% of cases.
The probability of a malpractice suit at each
hospital is 0.001, 0.005, and 0.008,
respectively.
Given that a malpractice suit occurs, what is the
probability that it originated from Hospital 1?
Bayes’ theorem says that
Basic procedure of Bayesian methodology
but strong evidence
(e.g., a precise test)
increases the
posterior probability.
The prior
reflects initial
knowledge with
low probability,
Example. Machines A, B, and C produce two
parts X and Y. Of all the parts produced,
machine A produces 60%, machine B produces
30% and machine C produces10%. In addition,
• 40% of parts made by machine A are part X.
• 50% of parts made by machine B are part X.
• 70% of parts made by machine C are part X.
Part X has been selected. What is the revised
probability that it came from machine A?
Event (E) Prior Conditional Joint Posterior
probability probability probability probability
𝑷(𝑬𝒊 ) 𝑷(𝑿|𝑬𝒊 ) 𝑷(𝑿 ∩ 𝑬𝒊 ) 𝑷(𝑬𝒊 |𝑿)
Machine A 0.6 0.4 0.24 0.24
=
0.46
Machine B 0.3 0.5 0.15 0.15
=
0.46
Machine C 0.1 0.7 0.07 0.07
=
0.46
𝑷 𝑿 = 𝟎. 𝟒𝟔
Exercise
A drug test for athletes has a 5 percent false
positive rate and a 10 percent false negative
rate. Of the athletes tested, 4 percent have
actually been using the prohibited drug.
If an athlete tests positive, what is the probability
that the athlete has actually been using the
prohibited drug?
Exercise
Suppose that
Half of a set of the parts are manufactured by
machine A and half by machine B.
Four percent of all the parts are defective.
Six percent of the parts manufactured on
machine A are defective.
Find the probability that a part was manufactured
on machine A, given that the part is defective.
Exercise
Suppose that
An airport gamma ray luggage scanner coupled with
a neural net artificial intelligence program can detect
a weapon in suitcases with a false positive rate of 2
percent and a false negative rate of 2 percent.
There is a 0.001 probability that a suitcase contains
a weapon.
If a suitcase triggers the alarm, what is the probability
that the suitcase contains a weapon?
-- The End of Topic --
Thank You!