Copyright © 2014, 2011 Pearson Education, Inc. 1
Chapter 8Conditional Probability
Copyright © 2014, 2011 Pearson Education, Inc. 2
8.1 From Tables to Probabilities
How does education affect income?
Percentages computed within rows or columns of a contingency table correspond to conditional probabilities
Conditional probabilities allow us to answer questions like how education affects income
Copyright © 2014, 2011 Pearson Education, Inc. 3
8.1 From Tables to Probabilities
Contingency Table (Counts) for Amazon.com
Copyright © 2014, 2011 Pearson Education, Inc. 4
8.1 From Tables to Probabilities
Converting Counts to Probabilities
Assume the next visitor to Amazon.com behaves like a random choice from the 28,975 cases in the contingency table
Divide each count by 28,975 to get fractions (probabilities)
Copyright © 2014, 2011 Pearson Education, Inc. 5
8.1 From Tables to Probabilities
Probabilities for Amazon.com
Copyright © 2014, 2011 Pearson Education, Inc. 6
8.1 From Tables to Probabilities
Joint Probability
Displayed in cells of a contingency table
Represent the probability of an intersection of two or more events (combination of attributes)
For Amazon.com there are six joint probabilities; e.g., P(Yes and Comcast) = 0.001
Copyright © 2014, 2011 Pearson Education, Inc. 7
8.1 From Tables to Probabilities
Marginal Probability
Displayed in the margins of a contingency table
Is the probability of observing an outcome with a single attribute, regardless of its other attributes
For Amazon.com there are five marginal probabilities, e.g., P(Comcast) = 0.009 + 0.001 = 0.010
Copyright © 2014, 2011 Pearson Education, Inc. 8
8.1 From Tables to Probabilities
Conditional Probability
P(A І B), the conditional probability of A given B, is P(A and B) / P(B)
To obtain a conditional probability, we restrict the sample space to a particular row or column
Copyright © 2014, 2011 Pearson Education, Inc. 9
8.1 From Tables to Probabilities
Conditional Probability
Of interest to Amazon.com is the question “which host will deliver the best visitors, those who are more likely to make a purchase?”
Find conditional probabilities to answer questions like “among visitors from Comcast, what is the chance a purchase is made?”
Copyright © 2014, 2011 Pearson Education, Inc. 10
8.1 From Tables to Probabilities
Conditional Probability – Restrict Sample Space to Comcast
Copyright © 2014, 2011 Pearson Education, Inc. 11
8.1 From Tables to Probabilities
Conditional Probability – Compute Percentages in Comcast Column
Copyright © 2014, 2011 Pearson Education, Inc. 12
8.1 From Tables to Probabilities
Conditional Probabilities –Purchases more likely from Comcast
P(Yes І Comcast) = P(Yes and Comcast)P(Comcast)
= 0.001 / 0.010 = 0.100
P(Yes І Google) = 0.033P(Yes І Nextag) = 0.042
Copyright © 2014, 2011 Pearson Education, Inc. 13
8.2 Dependent Events
Definition
Events that are not independent; for dependent events P(A and B) ≠ P(A)×P(B)
or P(A) ≠ P(A І B)
Copyright © 2014, 2011 Pearson Education, Inc. 14
8.2 Dependent Events
The Multiplication Rule
Events in business tend to be dependent (e.g., probability of purchasing a service given an ad for the service is seen)
Order matters: Generally, P(A І B) ≠ P(B І A)
Copyright © 2014, 2011 Pearson Education, Inc. 15
8.2 Dependent Events
The Multiplication Rule
The joint probability of two events A and B is the product of the marginal probability of one times the conditional probability of the other
P(A and B) = P(A) × P(B І A)P(A and B) = P(B) × P(A І B)
Copyright © 2014, 2011 Pearson Education, Inc. 16
8.2 Dependent Events
The Multiplication Rule
Disjoint events are never independent
If A and B are disjoint, then P(A І B) = P(A and B) / P(B)
= 0 / P(B) = 0≠ P(A)
Copyright © 2014, 2011 Pearson Education, Inc. 17
8.3 Organizing Probabilities
Probability Trees (Tree Diagrams)
Graphical depiction of conditional probabilities (helpful for large problems)
Shows sequence of events as paths that suggest branches of a tree
Copyright © 2014, 2011 Pearson Education, Inc. 18
8.3 Organizing Probabilities
Success of Advertising on TVPrograms Viewed on Sunday Evening
Copyright © 2014, 2011 Pearson Education, Inc. 19
8.3 Organizing Probabilities
Success of Advertising on TVWhether or Not Viewer Sees Ad
Copyright © 2014, 2011 Pearson Education, Inc. 20
8.3 Organizing Probabilities
Use Tree Diagram to Find Probabilities
P(Watch game and See Ads) = 0.50 0.50= 0.25
P(See Ads) = 0.15 0.90 + 0.35 0.20 + 0.50 0.50
= 0.455
Copyright © 2014, 2011 Pearson Education, Inc. 21
8.3 Organizing Probabilities
Derive Probability Table from Tree DiagramFill in Marginal Probabilities
Copyright © 2014, 2011 Pearson Education, Inc. 22
8.3 Organizing Probabilities
Derive Probability Table from Tree DiagramFill in First Row of Joint Probabilities
Copyright © 2014, 2011 Pearson Education, Inc. 23
8.3 Organizing Probabilities
Completed Probability Table
Copyright © 2014, 2011 Pearson Education, Inc. 24
8.4 Order in Conditional Probabilities
If a viewer sees the ads, what is the chance she is watching Desperate Housewives?
Find P(Desperate Housewives І See Ads)
= P(Desperate Housewives and See Ads)P(See Ads)
= 0.07 / 0.455 = 0.154
Copyright © 2014, 2011 Pearson Education, Inc. 25
4M Example 8.1: DIAGNOSTIC TESTING
Motivation
If a mammogram indicates that a 55 year old woman tests positive for breast cancer, what is the probability that she in fact has breast cancer?
Copyright © 2014, 2011 Pearson Education, Inc. 26
4M Example 8.1: DIAGNOSTIC TESTING
Method
Past data indicates the following probabilities:
P(Test negative І No cancer) = 0.925P(Test positive І Cancer) = 0.85P(Cancer) = 0.005
Copyright © 2014, 2011 Pearson Education, Inc. 27
4M Example 8.1: DIAGNOSTIC TESTING
Mechanics – Fill in the Probability Table
Copyright © 2014, 2011 Pearson Education, Inc. 28
4M Example 8.1: DIAGNOSTIC TESTING
Mechanics – Fill in the Probability Table
Use Multiplication Rule to obtain joint probabilities
For example, P (Cancer and Test positive) = P (Cancer) P(Test positive І Cancer)= 0.005 0.85 = 0.00425
Copyright © 2014, 2011 Pearson Education, Inc. 29
4M Example 8.1: DIAGNOSTIC TESTING
Mechanics – Completed Probability Table
Copyright © 2014, 2011 Pearson Education, Inc. 30
4M Example 8.1: DIAGNOSTIC TESTING
Message
The chance that a woman who tests positive actually has cancer is small, a bit more than 5%.
Copyright © 2014, 2011 Pearson Education, Inc. 31
8.4 Organizing Probabilities
Bayes’ Rule: Reversing a Conditional Probability Algebraically
P(A І B) = _____P(B І A) P(A)______P(B І A) P(A) + P(B І Ac) P(Ac)
Copyright © 2014, 2011 Pearson Education, Inc. 32
4M Example 8.2: FILTERING JUNK MAIL
Motivation
Is there a way to help workers filter out junk mail from important email messages?
Copyright © 2014, 2011 Pearson Education, Inc. 33
4M Example 8.2: FILTERING JUNK MAIL
Method
Past data indicates the following probabilities:
P(Nigerian general І Junk mail) = 0.20P(Nigerian general І Not Junk mail) = 0.001P(Junk mail) = 0.50
Copyright © 2014, 2011 Pearson Education, Inc. 34
4M Example 8.2: FILTERING JUNK MAIL
Mechanics – Fill in the Probability Table
Copyright © 2014, 2011 Pearson Education, Inc. 35
4M Example 8.2: FILTERING JUNK MAIL
Mechanics – Use Table to find Conditional Probability
P (Junk mail І Nigerian general) = 0.1 / 0.1005= 0.995
Copyright © 2014, 2011 Pearson Education, Inc. 36
4M Example 8.2: FILTERING JUNK MAIL
Message
Email messages to this employee with the phrase “Nigerian general” have a high probability (more than 99%) of being spam.
Copyright © 2014, 2011 Pearson Education, Inc. 37
Best Practices
Think conditionally.
Presume events are dependent and use the Multiplication Rule.
Use tables to organize probabilities.
Copyright © 2014, 2011 Pearson Education, Inc. 38
Best Practices (Continued)
Use probability trees for sequences of conditional probabilities.
Check that you have included all of the events.
Use Bayes’ Rule to reverse the order of conditioning.
Copyright © 2014, 2011 Pearson Education, Inc. 39
Pitfalls
Do not confuse P(A І B) for P(B І A).
Don’t think that “mutually exclusive” means the same thing as “independent.”
Do not confuse counts with probabilities.