Chapter Conditional Probability Copyright © 2011 Pearson Education, Inc 8.1 From Tables to Probability 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 of 40 Copyright © 2011 Pearson Education, Inc 8.1 From Tables to Probability Contingency Table (Counts) for Amazon.com of 40 Copyright © 2011 Pearson Education, Inc 8.1 From Tables to Probability Converting Counts to Probabilities Assume the next visitor to Amazon.com behaves like a random choice from the 17,619 cases in the contingency table Divide each count by 17,619 to get fractions (probabilities) of 40 Copyright © 2011 Pearson Education, Inc 8.1 From Tables to Probability Probabilities for Amazon.com of 40 Copyright © 2011 Pearson Education, Inc 8.1 From Tables to Probability Joint Probability Displayed in cells of a contingency table Represent the probability of an intersection of two or more events For Amazon.com there are six joint probabilities; e.g., P(Yes and MSN) = 0.016 of 40 Copyright © 2011 Pearson Education, Inc 8.1 From Tables to Probability 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 four marginal probabilities, e.g., P(MSN) = 0.396 + 0.016 = 0.412 of 40 Copyright © 2011 Pearson Education, Inc 8.1 From Tables to Probability 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 of 40 Copyright © 2011 Pearson Education, Inc 8.1 From Tables to Probability 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 MSN, what is the chance a purchase is made?” 10 of 40 Copyright © 2011 Pearson Education, Inc 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? 26 of 40 Copyright © 2011 Pearson Education, Inc 4M Example 8.1: DIAGNOSTIC TESTING Method Past data indicates the following probabilities: P(Test negative І No cancer) = 0.925 P(Test positive І Cancer) = 0.85 P(Cancer) = 0.003 27 of 40 Copyright © 2011 Pearson Education, Inc 4M Example 8.1: DIAGNOSTIC TESTING Mechanics – Fill in the Probability Table 28 of 40 Copyright © 2011 Pearson Education, Inc 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.0030 × 0.85 = 0.00255 29 of 40 Copyright © 2011 Pearson Education, Inc 4M Example 8.1: DIAGNOSTIC TESTING Mechanics – Completed Probability Table 30 of 40 Copyright © 2011 Pearson Education, Inc 4M Example 8.1: DIAGNOSTIC TESTING Message The chance that a woman who tests positive actually has cancer is small, a bit more than 3% 31 of 40 Copyright © 2011 Pearson Education, Inc 8.3 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(A×c) × × 32 of 40 Copyright © 2011 Pearson Education, Inc 4M Example 8.2: FILTERING JUNK MAIL Motivation Is there a way to help workers filter out junk mail from important email messages? 33 of 40 Copyright © 2011 Pearson Education, Inc 4M Example 8.2: FILTERING JUNK MAIL Method Past data indicates the following probabilities: P(Nigerian general І Junk mail) = 0.20 P(Nigerian general І Not Junk mail) = 0.001 P(Junk mail) = 0.50 34 of 40 Copyright © 2011 Pearson Education, Inc 4M Example 8.2: FILTERING JUNK MAIL Mechanics – Fill in the Probability Table 35 of 40 Copyright © 2011 Pearson Education, Inc 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 36 of 40 Copyright © 2011 Pearson Education, Inc 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 37 of 40 Copyright © 2011 Pearson Education, Inc Best Practices Think conditionally Presume events are dependent and use the Multiplication Rule Use labels to organize probabilities 38 of 40 Copyright © 2011 Pearson Education, Inc 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 39 of 40 Copyright © 2011 Pearson Education, Inc 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 40 of 40 Copyright © 2011 Pearson Education, Inc ... 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) x P(B І A) P(A and B) = P(B) x P(A І B) B 16... Represent the probability of an intersection of two or more events For Amazon.com there are six joint probabilities; e.g., P(Yes and MSN) = 0.016 of 40 Copyright © 2011 Pearson Education, Inc 8.1... to Probability Conditional Probabilities Show Purchases are more likely from MSN and Yahoo P(Yes І MSN) = P(Yes and MSN) / P(MSN) = 0.016 / 0.412 = 0.039 P(Yes І RecipeSource) ≈ 0.000 P(Yes І