Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Chapter 1.3 – Conditional probability and independence • Consider the dart board below, where |A| = 1 (area of region A), |B| = 2, |C| = 3, |M | = 4. Define the sample space as S = A ∪ B ∪ C ∪ M and the board as D = A ∪ B ∪ C. M A B C • Assuming all points in S are equally likely, compute the probabilities of A, B, C, and D. • Now say you are allowed to throw the dart until you hit the board. What is the probability of A given that you hit the board? • This is the conditional probability P (A|D), read as “probability of A given D”. ST521 Chapter 1.3 Page 1 • If A and B are events in S with P (B) > 0, the conditional probability of A given B is P (A|B) = P (A ∩ B) . P (B) • Back to the dart board example, what is P (A|D)? ST521 Chapter 1.3 Page 2 • Prove that P (B|B) = 1. • Prove that P (A|B) = 0 if A and B are disjoint. • Prove that P (A|B) = 0 if A = ∅. ST521 Chapter 1.3 Page 3 • Prove that P (·|B) is a valid probability measure on sample space B. ST521 Chapter 1.3 Page 4 • Given that your hand has all face cards, what is the probability you have a full house? ST521 Chapter 1.3 Page 5 • Monte Hall problem: Suppose you are on a game show, and you are given the choice of 3 doors. There is a car behind one door and goats behind the others. You pick door #1 (but it is not opened). The host, who knows what’s behind the doors, then opens door #3 which has a goat. Then he says, ”Do you want to switch to door #2?” What should you do? ST521 Chapter 1.3 Page 6 • Bayes’ Rule offers a relationship between P (A|B) and P (B|A). • Example: Let A be the event that a patient has a disease and B be the event that the patient tests positive. We know: P (B|A) = probability of testing positive given you have the disease (1) = probability of a true positive = 0.99. P (B|AC ) = probability of testing positive given you do not have the disease = probability of a false positive = 0.03. P (A) = probability of a randomly selected person having the disease = prevalence = 0.05. • Now a patient tests positive. What is P (A|B), the probability they have the disease given a positive test? ST521 Chapter 1.3 Page 7 • In general, if P (B) > 0, then Bayes’ rule is P (A|B) = P (B|A)P (A) P (B|A)P (A) = . P (B) P (B|A)P (A) + P (B|AC )P (AC ) • Back to the patient, what is P (A|B)? 1. Does P (A|B) increase if the test is more accurate with P (B|A) = 0.999, P (B|AC ) = 0.001, and P (A) = 0.05? 2. Does P (A|B) increase if prevalence decreases P (B|A) = 0.99, P (B|AC ) = 0.03, and P (A) = 0.01? 3. Does P (A|B) increase if the test is a coin flip P (B|A) = 0.5, P (B|AC ) = 0.5, and P (A) = 0.05? 4. Is P (A|B) > P (A|B C )? ST521 Chapter 1.3 Page 8 • There is a more general expression if the events can have more than two outcomes. • If A1 , A2 , ... partition S and P (B) > 0, then P (Aj |B) = P (B|Aj )P (Aj ) P (B|Aj )P (Aj ) = ∑∞ . P (B) j=1 P (B|Aj )P (Aj ) • Example: A1 = a person lives in Raleigh; A2 = a person lives in Chapel Hill; A3 = a person lives in Durham; B = a person is a criminal. • We know the population distribution: P (A1 ) = 0.5, P (A2 ) = 0.2, and P (A3 ) = 0.3. • We know the crime rates: P (B|A1 ) = 0.01, P (B|A2 ) = 0.02, and P (B|A3 ) = 0.02. 1. What is the probability that a randomly selected person is a criminal? 2. Given we identify a criminal, what is the probability they are from Raleigh? 3. Given we identify a criminal, what is the probability they are from Chapel Hill? 4. Given we identify a criminal, what is the probability they are from Durham? ST521 Chapter 1.3 Page 9 • Two events are independent if they do not influence each other. • If two events are not independent, they are dependent. • Three equivalent definitions of independence: 1. A and B are independent if P (A) = P (A|B). 2. A and B are independent if P (B) = P (B|A). 3. A and B are independent if P (A ∩ B) = P (A)P (B). ST521 Chapter 1.3 Page 10 • In the testing example with P (A) = 0.05, P (B|A) = 0.99, and P (B|AC ) = 0.03, are testing and disease status independent? • Can you think of a situation where testing and disease status would be independent? • In the Monte Hall problem, are the events ”switch” and ”win” independent? ST521 Chapter 1.3 Page 11 • Example You are dealt two cards without replacement. A = you get at least one heart, B = you get two sevens. Are A and B independent? ST521 Chapter 1.3 Page 12 • A1 , A2 , ..., An are mutually independent if for any subset i1 , ..., ik ∈ {1, ..., n}, (k ) k ∏ ∩ P Ail = P (Ail ). l=1 l=1 • In particular, we must have 1. P (Ai ∩ Aj ) = P (Ai )P (Aj ) for all i and j. 2. P (Ai ∩ Aj ∩ Al ) = P (Ai )P (Aj )P (Al ) for all i, j, and l. 3. P (A1 ∩ ... ∩ An ) = P (A1 ) · ... · P (An ). • Example: We plant three mutually independent seeds. Each has survival probability 0.4. What is the probability of at least one surviving? • How many should we plant if we want the probability of at least one surviving to be 0.99? ST521 Chapter 1.3 Page 13 • If A and B are independent, then A and B C , AC and B, and AC and B C are all independent. • If A, B, and C are mutually independent, then AC , B , and C are mutually independent, etc. ST521 Chapter 1.3 Page 14