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
History of randomness wikipedia , lookup
Indeterminism wikipedia , lookup
Probabilistic context-free grammar wikipedia , lookup
Dempster–Shafer theory wikipedia , lookup
Probability box wikipedia , lookup
Infinite monkey theorem wikipedia , lookup
Inductive probability wikipedia , lookup
Ars Conjectandi wikipedia , lookup
Birthday problem wikipedia , lookup
Announcements: • If you haven’t taken the survey yet, I encourage you to do it by Sunday! • Chapter 7 practice problems on website. • Discussion this week and next for credit. Homework (due Mon, Feb 11th): Chapter 7: #44, 64 (counts double) HOW TO DETERMINE IF TWO EVENTS ARE INDEPENDENT Review: Independent and Dependent Events • Two events are independent of each other if knowing that one will occur (or has occurred) does not change the probability that the other occurs. • Two events are dependent if knowing that one will occur (or has occurred) changes the probability that the other occurs. The definitions can apply either … to events within the same random circumstance or to events from two separate random circumstances. Testing independence of myopia and lighting 1. Physical assumption Example: Lottery draws on different days don’t affect each other. 2. See if P(B|A) = P(B). If so, A and B are independent events, otherwise they are not. Example: Suppose data showed that smokers and nonsmokers are equally likely to get the flu. P(flu | smoker) = P(flu) so they are independent. 3. Events A and B are independent if and only if P(A and B) = P(A)P(B). If you know these probabilities, you can check to see if this holds. 7.4 Basic Rules for Finding Probabilities Probability an Event Does Not Occur Rule 1 (for “not the event”): P(AC) = 1 – P(A) Example: In the US, blood type percents* are: O: 46%, A: 39%, B: 11%, AB: 4% Suppose we randomly select someone. P(Blood type O) = 0.46 so P(Blood type A, B, or AB) = 1 – 0.46 = 0.54. A = child slept in darkness as infant P(A) = 172/479 = .36 B = child did not develop myopia P(B) = 342/479 = .71 Does P(A and B) = P(A)P(B) = (.36)(.71) = .2556? P(A and B) = P(darkness and no myopia) = 155/479 = .3236 NO, P(A and B) ≠ P(A)P(B), so A and B are not independent. Infant sleeptime lighting and myopia are not independent. Probability That Either One or Both of Two Events Happen Rule 2 (addition rule for “either/or/both”): Rule 2a (general): P(A or B) = P(A) + P(B) – P(A and B) Rule 2b (for mutually exclusive events): If A and B are mutually exclusive events, P(A or B) = P(A) + P(B) Illustrate with Venn diagram in class. *Source: www.bloodbook.com 1 Example 7.14 Roommate Compatibility Brett will be assigned a roommate from 1000 other males. Will he get one who snores? Parties? Both? Likes to Yes Party? No Snores? Yes No 150 100 200 550 350 650 Probability That Two or More Events Occur Together Rule 3 (multiplication rule for “and”): Total 250 750 1000 A = likes to party P(A) = 250/1000 = 0.25 B = snores P(B) = 350/1000 = 0.35 Rule 3a (general): P(A and B) = P(A)P(B|A) P(A and B) = 150/1000 = .15 Probability that Brett will be assigned a roommate who either likes to party or snores, or both is: P(A or B) = P(A) + P(B) – P(A and B) = 0.25 + 0.35 – 0.15 = 0.45 So probability that his roommate is acceptable is 1 – 0.45 = 0.55 Rule 3b (for independent events): If A and B are independent events, P(A and B) = P(A)P(B) Extension of Rule 3b (> 2 independent events): For several independent events, P(A1 and A2 and … and An) = P(A1)P(A2)…P(An) Example with independent events (Rule 3b) Example with dependent events (Rule 3a) The probability of a birth being a boy is .512. Suppose a woman has 2 children (not twins). A = first child is a boy B = second child is a boy We assume these are independent events. P(A and B) = P(A)P(B) = (.512)(.512) = .2621 Probability of 2 girls is (.488)(.488) = .2381 From Rule 2b, probability of same sex = .5002 From Rule 1, probability of different sex = .4998 Randomly select a student who takes Stat 7 with me. (Similar to Exercise 7.95 and homework.) A = student comes to class regularly; P(A) = 0.7 AC = student doesn’t come regularly; P(AC) = 0.3 B = student gets at least a B in the course P(B|A) = 0.8 P(B|AC) = 0.4 What is the probability that the student comes to class regularly and gets at least a B? P(A and B) = P(A)P(B|A) = (.7)(.8) = .56 Extension of Rule 3b: Blood Types Again A blood bank needs Type O blood. What is the probability that the next 3 donors (not related) all have Type O blood? We can assume independent. Event A = 1st donor has Type O blood, P(A) = .46 Event B = 2nd donor has Type O blood, P(B) = .46 Event C = 3rd donor has Type O blood, P(C) = .46 P(Next 3 donors all have Type O blood) = P(A and B and C) = (.46)(.46)(.46) = (.46)3 = .097336 Determining a Conditional Probability Rule 4 (conditional probability): P(B|A) = P( A and B) P( A) P(A|B) = P( A and B ) P( B) 2 EXAMPLE OF CONDITIONAL PROBABILITY - Revisited Mutually exclusive versus Independent Students sometimes confuse the definitions of independent and mutually exclusive events. A = child slept in darkness as infant P(A) = 172/479 = .36 B = child did not develop myopia P(B) = 342/479 = .71 P(B|A) = P(no myopia | slept in dark) = 155/172 = .90 But this is P( A and B) 155 / 479 155 P( A) 172 / 479 • When two events are mutually exclusive and one happens, it turns the probability of the other one to 0. • When two events are independent and one happens, it leaves the probability of the other one alone. 172 In Summary (see page 236) … 7.5 Finding Complicated Probabilities: There are multiple ways to solve a problem Example 7.21 Winning the Daily 3 Lottery Event A = winning number is 956. What is P(A)? Method 1: With physical assumption that all 1000 possibilities are equally likely, P(A) = 1/1000. The most important parts to remember, because they are based on the definitions: Mutually exclusive: P(A|B) = 0 Independent: P(A|B) = P(A) Some Hints for Finding Probabilities • P(A and B): Sometimes you can define the event in physical terms and know the probability or find it from a two-way table. Example: I could classify the class into male, female and also year in school. Then, for example, probability that a randomly selected student in the class is Male and sophomore is the proportion of the class in that cell of the table. Don’t need separate P(A) and P(B). • Check if probability of the complement is easier to find, then subtract it from 1 (applying Rule 1). Example: Probability of at least 1 boy in family of 3 kids = 1 – Probability of all girls = 1 – (.488)3 = 1 – .116 = .884 Method 2: Define three events, B1 = 1st digit is 9, B2 = 2nd digit is 5, B3 = 3rd digit is 6 Event A occurs if and only if all 3 of these events occur. Note: P(B1) = P(B2) = P(B3) = 1/10. Since these events are all independent, we have P(A) = (1/10)3 = 1/1000. Finding Conditional Probability in Opposite Direction: Bayes Rule Know P(B|A) but want P(A|B): Use Rule 3a to find P(B) = P(A and B) + P(AC and B), then use Rule 4. P( A | B) P ( A and B ) P ( B | A) P ( A) P( B | AC ) P ( AC ) Two useful tools that are much easier than using this formula! 1. Hypothetical hundred thousand table 2. Tree diagram 3 Solve these probability questions Example 1: Medical testing for a rare disease D = person has the disease, suppose: P(D) = 1/1000 = .001, P(DC) = .999 T = test for the disease is positive, suppose: P(T | D) = .95, so P(TC | D) = .05 P(T | DC) = .05, so P(TC | DC) = .95 So the test is 95% accurate whether person has the disease or not Find P(D | T) = Probability of disease, given the test is positive Table of hypothetical 100,000 people who get tested 1/1000 of them have disease = 100 people Of those, 95% = 95 people test positive, so 5 test negative 999/1000 of them don’t have the disease = 99,900 people Of those, 95% = 94,905 people test negative, so 4995 positive Disease No disease Total 95 5 4995 5090 94,905 94,910 Return to example of Statistics 7 grades A = student comes to class regularly; P(A) = 0.7 B = student gets at least a B in the course P(B|A) = 0.8 P(B|AC) = 0.4 Question: What is the overall probability of getting at least a B? Some definitions from Section 7.7 Probability of accurate medical test Useful Tool 1: Hypothetical Hundred Thousand Table Test positive Test negative Example 2: Probability of getting a B or better Total 100 99,900 100,000 Define the events: D = person has the disease DC = person does not have the disease T = test is positive TC = test is negative Sensitivity of a test = P(T | D), i.e., correct outcome if person has the disease. Specificity of a test = P(TC | DC) , i.e. correct outcome if person does not have the disease. Read from Table: P(Disease | Test positive ) = 95/5090 = .019 Useful Tool 2: Tree Diagrams Show disease example in class Step 1: Determine first random circumstance in time sequence, and create first set of branches for possible outcomes. Create one branch for each outcome, write probability on branch. EX: P(D) = .001, P(no D) = .999 Step 2: Determine next random circumstance and append branches for possible outcomes to each branch in step 1. Write associated conditional probabilities on branches. EX: P(T | D) = .95, P(T | no D) = .05 Tree Diagrams, continued Step 3: Continue this process for as many steps as necessary. (Not needed in this 2-step example) Step 4: To determine the probability of following any particular sequence of branches, multiply the probabilities on those branches. This is an application of Rule 3a. Step 5: To determine the probability of any collection of sequences of branches, add the individual probabilities for those sequences, as found in step 4. This is an application of Rule 2b. 4 Disease probability Example 2: Return to example of Stat 7 grades A = student comes to class regularly; P(A) = 0.7, P(AC) = 0.3 B = student gets at least a B in the course P(B|A) = 0.8 P(B|AC) = 0.4 Question: What is the overall probability of getting at least a B? Class? .7 Sensitivity = specificity = 0.95 P(D and positive test) = (.001)(.95) = .00095. P(test is positive) = .00095 + .04995 = .0509. P(D | positive test) = .00095/.0509 = .019 .8 .4 No .56 C or less .14 B or better .12 C or less .18 .2 Yes .3 B or better .6 So, probability of B or better = .56 + .12 = .68 overall More examples in class, if time. Otherwise, try on your own. 1. You drive on a certain freeway daily. Speed limit is 65. You drive over 65 all the time, but over 75 about 30% of the time. P(ticket | over 75) = 1/50 = .02 P(ticket | 65 to 75) = 1/200 = .005. What is the probability you get a ticket on a randomly selected day? 2. Suppose there is no relationship between two variables, e.g. listening to Mozart and increased IQ. Suppose 3 independent experiments are done, each using the 0.05 criterion for statistical significance. What is the probability that at least one finds statistical significance just by chance? Problem 1 Suppose you drive on a certain freeway daily. Speed limit is 65. You drive over 65 all the time, but over 75 about 30% of the time. P(ticket | over 75) = 1/50 = .02 P(ticket | 65 to 75) = 1/200 = .005. What is the probability you get a ticket on a randomly selected day? 28 Problem 2 Problem 2 Solution Suppose there is no relationship between two variables, e.g. listening to Mozart and increased IQ. Suppose 3 independent experiments are done, each using the 0.05 criterion for statistical significance. Suppose there is no relationship between two variables, e.g. listening to Mozart and increased IQ. Suppose 3 independent experiments are done, each using the 0.05 criterion for statistical significance. What is the probability that at least one experiment results in a statistically significant relationship just by chance? 1 – P(no significant relationships) = 1 – (.95)(.95)(.95) = 1 – .857 = .143 What is the probability that at least one experiment results in a statistically significant relationship just by chance? 29 30 5 Homework (due Mon, Feb 11th): Chapter 7: #44, 64 (counts double) 6