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 5 Modeling Variation with Probability Copyright © 2017, 2014 Pearson Education, Inc. Slide 1 Chapter 5 Topics • Use empirical and theoretical probability models • Apply basic probability rules Copyright © 2017, 2014 Pearson Education, Inc. Slide 2 Section 5.1 ronstik. Shutterstock WHAT IS RANDOMNESS? • Use a Random Number Table or Technology to Simulate Randomness • Distinguish Between Empirical and Theoretical Probabilities Copyright © 2017, 2014 Pearson Education, Inc. Slide 3 What Is Randomness? • Having no predictable pattern • People are not good at identifying truly random samples or random experiments. • Usually a computer or some other randomizing device, such as a random number table, is used to simulate randomness. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 4 Example: Simulating Randomness Using a Random Number Table Use Row 30 from the random number table to simulate 10 coin tosses. Let odd numbers = H and even numbers = T. What is the longest streak of H or T in your data? Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 5 Example: Simulating Coin Tosses Using a Random Number Table HTHTH HHTHT THHHH TTTHT Longest streak: 4 heads in a row Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 6 Probability • Used to measure how often random events occur • When tossing a coin, the probability of a head is ½ or 50%. This means that the coin will land on heads about 50% of the time. • Two types: 1. Theoretical 2. Empirical Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 7 Theoretical Probabilities • Long-run relative frequencies • The relative frequency at which an event occurs after infinitely many repetitions Example: If we were to flip a coin infinitely many times, exactly 50% of the flips would be heads. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 8 Empirical Probabilities • Relative frequencies based on an experiment or on observation of a real-life process Example: I toss a coin 10 times and get 4 heads. The empirical probability of getting heads is 4/10 = 0.4, or 40%. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 9 Theoretical vs. Empirical Probabilities • Theoretical probabilities are always the same value. Example: The theoretical probability of getting a heads when tossing a coin is always 0.50 or 50%. • Empirical probabilities change with every experiment. Example: If I toss a coin 10 times and get 7 heads, the empirical probability of heads = 0.70 or 70%. If I toss a coin 10 times and get 3 heads, the empirical probability of heads = 0.30 or 30%. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 10 Why Two Probability Models? • Theoretical probabilities may be difficult to compute – empirical probabilities can help us estimate theoretical probabilities. • We may not trust the theoretical probability model (for example, the model may be based on faulty assumptions) – empirical probabilities can help us verify or refute a theoretical value. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 11 Simulations • Experiments used to produce empirical probabilities • In a previous example, we used a random number table to simulate tossing a coin 10 times. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 12 MNStudio. Shutterstock Section 5.2 FINDING THEORETICAL PROBABILITIES • Find Theoretical Probabilities of Equally Likely Events • Find the Probability of the Complement of an Event • Use Basic Probability Rules Copyright © 2017, 2014 Pearson Education, Inc. Slide 13 Probabilities • Always between 0 and 1 (including 0 and 1) Written in symbols: 0 ≤ P(A) ≤ 1 • Can be expressed as fractions, decimals, or percents • An event has a probability of 0 only if it can never happen. • An event has a probability of 1 only if it is certain to happen. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 14 Probability Notation Events are usually represented with uppercase letters: A, B, C, etc. The probability of event A occurring is written P(A). Example: Toss a coin. Let A represent the event “the coin lands on heads.” P(A) = ½ or 0.50 or 50% Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 15 The Complement of an Event: AC The complement refers to the event “not” occurring. The complement of event A is written Ac . Example: Toss a coin. A = coin lands on heads, Ac = coin does NOT land on heads. Example: Wait for a bus and note its arrival time. A = bus arrives on time, Ac = bus does NOT arrive on time. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 16 The Probability of an Event and Its Complement P(A does NOT occur) = 1 – P(A does occur) In symbols, P(Ac) = 1 – P(A) Examples: Let event A represent the event “the candidate wins an election.” Suppose P(A)=0.70. Then Ac represent the event “the candidate does NOT win the election” and P(Ac) = 1 – P(A) = 1 – 0.70 = 0.30 Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 17 Sample Space and Events for Equally Likely Outcomes Sample space The set of all possible equally likely outcomes of an experiment. Event Any collection of outcomes in the sample space. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 18 Example: Sample Space Experiment: Roll a fair die one time. Sample space: S = 1, 2, 3, 4, 5, 6 Example: Event = “roll an even number” Outcomes: 2, 4, 6 Example: Event = “roll a number less than 3” Outcomes: 1, 2 Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 19 Using a Sample Space to find a Theoretical Probability For equally likely events: P(A) = number of outcomes in A number of all possible outcomes Example: Roll a die. Let A represent the event “get a number less than 3.” Find P(A). Sample space: 1, 2, 3, 4, 5, 6 6 outcomes A: 1, 2 2 outcomes P(A) = 2 6 Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 20 Using a Sample Space to find a Theoretical Probability A family has 2 children. Find the probability that both children are girls. Let A represent the event that both are girls. Sample space: BB, BG, GB, GG 4 outcomes Event A: GG 1 outcome 1 P(A) = = .25 = 25% 4 Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 21 Combining Events with “And” An event belonging to “A and B” must belong to both A and B. Example: If event A represents “wearing a hat” and event B represents “raising a hand” then someone in A and B is wearing a hat and raising a hand. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 22 Combining Events Using “And” A person is selected at random from this group. Find the probability that he/she is wearing a hat AND raising his/her hand. Number in sample space = 6, number raising a hand and wearing a hat = 2 (Maria and David), P(A and B) = 2/6. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 23 Combining Events Using “Or” An event belonging to “A or B” must belong to A or B or both. Example: If event A represents “wearing a hat” and event B represents “raising a hand” then someone in A or B is wearing a hat or raising a hand or both. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 24 Combining Events Using “Or” A person is selected at random from this group. Find the probability that he/she is wearing a hat OR raising his/her hand. Number in sample space = 6, number raising a hand or wearing a hat or both (Rena, Maria, David) = 3, P(A or B) = 3/6 Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 25 Finding Probabilities from Two-Way Tables In the 2012 General Social Survey (GSS) people were asked about their happiness and were also asked whether they agreed with the following statement: “In a marriage, the husband should work and the wife should take care of the home.” The following table summarizes the data collected: Agree Happy 242 Don’t Know 65 Disagree Total 684 991 Unhappy 45 30 80 155 Total 287 95 764 1146 Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 26 Finding Probabilities from Two-Way Tables Agree Happy Unhappy Total 242 45 287 Don’t Know 65 30 95 Disagree Total 684 80 764 991 155 1146 Suppose a person is randomly selected from this group. Find: a. P(happy and agree) b. P(happy or agree) c. P(Agree or Don’t Know) Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 27 Finding Probabilities from Two-Way Tables Agree Happy Unhappy Total 242 45 287 Don’t Know 65 30 95 Disagree Total 684 80 764 991 155 1146 Suppose a person is randomly selected from this group. Find: a. P(happy and agree) = 242/1146 = 0.211 Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 28 Finding Probabilities from Two-Way Tables Happy Unhappy Total Agree Don’t Know Disagree Total 242 45 287 65 30 95 684 80 764 991 155 1146 Suppose a person is randomly selected from this group. Find: b. P(happy or agree) The total number of people who are happy or agree is: 242 + 65 + 684 + 45 = 1036 P(happy or agree) = 1036/1146 = 0.904 Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 29 Finding Probabilities from Two-Way Tables Agree Happy Unhappy 242 45 Don’t Know 65 30 Total 287 95 Disagree Total 684 80 991 155 764 1146 c. P(Agree or Don’t Know) The total number of people who Agree or Don’t Know is 242 + 45 + 65 + 30 = 382 P(Agree or Don’t Know) = 382/1146 = 0.333 or 33.3% Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 30 Mutually Exclusive Events Agree Happy Unhappy 242 45 Don’t Know 65 30 Total 287 95 Disagree Total 684 80 991 155 764 1146 When counting the number of people who Agree or Don’t Know, no person was in BOTH categories. We say the events “Agree” and “Don’t Know” are MUTUALLY EXCLUSIVE EVENTS. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 31 Mutually Exclusive Events Agree Happy Unhappy 242 45 Don’t Know 65 30 Total 287 95 Disagree Total 684 80 991 155 764 1146 When counting the number of people who are happy or agree, notice that there is a group of people (242) who appear in both categories at the same time – those who are happy AND agree. The events “Happy” and “Agree” are NOT mutually exclusive. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 32 Probability Rule: “OR” P(A or B) = P(A) + P(B) – P(A AND B) NOTE: If A and B are mutually exclusive, then they cannot happen at the same time, so P(A AND B) = 0. For MUTUALLY EXCLUSIVE EVENTS: P(A or B) = P(A) + P(B) Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 33 Example: Probabilities with “OR” Experiment: Roll a fair six-sided die. Find: a. P(rolling an odd number or a number greater than 3) b. P(rolling a number less than 3 or rolling a 6) Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 34 Example: Probabilities with “OR” Experiment: Roll a fair six-sided die. Find: a. P(rolling an odd number or a number greater than 3) The outcomes for event “rolling an odd number” are 1, 3, 5 and the probability of this event is 3/6. The outcomes for event “a number greater than 3” are 4, 5, 6 and the probability of this event is 3/6. Notice these are NOT mutually exclusive since both events contain the outcome “5”. P(rolling an odd number or a number greater than 3) = 3/6 + 3/6 – 1/6 = 5/6. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 35 Example: Probabilities with “OR” Experiment: Roll a fair six-sided die. Find: b. P(rolling a number less than 3 or rolling a 6) The outcomes for event “rolling a number less than 3” are 1 and 2, and the probability of this event is 2/6. The outcome for the event “rolling a 6” is simply 6, and the probability of this event is 1/6. Notice that these are mutually exclusive events. P(rolling a number less than 3 or rolling a 6) = 2/6 + 1/6 = 3/6 or ½. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 36 Section 5.3 Ruben Pinto. Shutterstock ASSOCIATIONS IN CATEGORICAL VARIABLES • Find Conditional Probabilities • Determine if Events are Dependent or Independent • Use Probabilities to Determine if an Association May Exist Between Categorical Variables Copyright © 2017, 2014 Pearson Education, Inc. Slide 37 Associations Between Categorical Variables This table shows marital status and educational level for a random sample. Question: Is there an association between marital status and educational level? In other words, are the proportions of married people different for various levels of education? For example, are college-educated more (or less) likely to be married than HS-educated? Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 38 Conditional Probabilities Probabilities where we focus on just one group and imagine taking a random sample from that group alone are called conditional probabilities. Example: P(a person is married given that the person is college-educated) Example: P(a person is single given that the person’s highest educational level is HS) Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 39 “Given That” vs. “And” P(married and college educated) would use the number in the intersection of married and college. P(married given that they are college educated) would focus solely on the number of college educated and count the number in that group who are married. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 40 Example: “And” Ed. Level Single Married Divorced Widow/er Total Less HS HS College or + 17 68 27 70 240 98 10 59 15 28 30 3 125 397 143 Total 112 408 84 61 665 P(Married and College-Educated) = 98/665 = .147 or 14.7% Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 41 Example: “Given that” Ed. Level Single Married Divorced Widow/er Total Less HS 17 70 10 28 125 HS 68 240 59 30 397 College or + 27 98 15 3 143 Total 112 408 84 61 665 To find P(Married, given that s/he is college-educated), we only focus on the college-educated group for our total and from this group, find the number who are married. P(Married, given that s/he is college-educated) = 98/143 = .685 or 68.5%. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 42 Conditional Probability: Notation To write P(married, given that s/he is collegeeducated) we write: P(married | college-educated) In general, P(A|B) means find the probability that event A occurs given that event B has occurred. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 43 Calculating Conditional Probabilities One can calculate conditional probabilities from tables by isolating the group from which you are sampling as we did in the previous example. Conditional probabilities can also be calculated by using this formula (helpful in cases where you do not have complete information): P(A and B) P(A| B)= P(B) Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 44 Example: Isolating the Sampling Group Ed. Level Single Married Divorced Widow/er Total Less HS 17 70 10 28 125 HS 68 240 59 30 397 College or + 27 98 15 3 143 Total 112 408 84 61 665 Find P(married|less HS). By isolating the sampling group, the total of less HS is 125. Of these, 70 are married, so P(married|less HS) = 70/125 = 0.56 Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 45 Example: Using the Formula Ed. Level Single Married Divorced Widow/er Total Less HS 17 70 10 28 125 HS 68 240 59 30 397 College or + 27 98 15 3 143 Total 112 408 84 61 665 Find P(married|less HS). Using the formula: P(married AND less HS) = 70/665, P(less HS)=125/665, so P(married|less HS) = (70/665)/(125/665) = 70/125 = 0.56. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 46 Independent Events Variables or events that are not associated are called INDEPENDENT EVENTS. Two events are independent if knowledge that one has happened tells you nothing about whether or not the other event has happened. In symbols: A and B are independent events means P(A|B) = P(A) Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 47 Example: Independent Events Suppose a card is drawn from a standard deck of playing cards. Are the events “the card is a club” and “the card is black” independent? P(card is a club) = 13/52 = 1/4 P(card is black) = 26/52 = ½ P(card is a club|card is black) = 13/26 = ½ (Note: There are 26 black cards, of which 13 are clubs.) P(card is club) ≠ P(card is club|card is black) so the events are NOT independent. The events are associated. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 48 Example Ed. Level Single Married Divorced Widow/er Total Less HS 17 70 10 28 125 HS 68 240 59 30 397 College or + 27 98 15 3 143 Total 112 408 84 61 665 Are the events “person selected has a HS education” and “person selected is divorced” independent? P(HS|divorced) = 59/84 = 0.702 P(HS)=397/665 = 0.597 The probabilities are not equal so the events are not independent. The events are associated. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 49 Probability and “AND” The Multiplication Rule: For INDEPENDENT events, P(A AND B) = P(A) P(B). Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 50 Example: Gender of Babies Suppose 49% of babies born in the US are girls. A couple has 2 children. Find P(both are girls). P(first is a girl and second is a girl) = P(first is a girl) P(second is a girl) = 0.49 x 0.49 = 0.24 Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 51 Example: Gender of Babies A couple has 2 children. Find P(the first is a boy and the second is a girl). P(first is a boy and second is a girl) = P(first is a boy) P(second is a girl) = 0.51 x 0.49 = 0.2499 Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 52 Example According to a Wall Street Journal survey, 70% of consumers prefer to shop online rather than in person at their favorite retailer. Suppose three consumers are randomly selected with replacement from the population of consumers. 1. What is the probability that all three prefer to shop online? 2. What is the probability that none prefer to shop online? 3. What is the probability that at least one prefers to shop online? Source: www.wsj.com Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 53 Example NOTE: These are independent events because one consumer’s answer will not affect the probability of the next consumer’s answer, so we can use the Multiplication Rule. 1. P(all three prefer to shop online) = P(first prefers online AND second prefers online AND third prefers online) = 0.70 x 0.70 x 0.70 = 0.343 2. P(none prefer online) = P(first does not prefer online AND second does not prefer online AND third does not prefer online) = 0.30 x 0.30 x 0.30 = 0.027 Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 54 Example 3. P(at least one prefers online) = P(one prefers online OR two prefer online OR three prefer online). We could calculate the probability of each of these events and add them together, but it is easier to note that “at least one is satisfied” is the complement of “none is satisfied” since is includes all categories except “none.” So P(at least one prefers online) = 1 – P(none prefer online) = 1 – 0.027 = 0.973 Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 55 Section 5.4 Ferran Recio. Shutterstock FINDING EMPIRICAL PROBABILITIES • Use Simulations to Find Empirical Probabilities Copyright © 2017, 2014 Pearson Education, Inc. Slide 56 Empirical Probabilities • Based on observations of real-life events • Examples: – Baseball player’s batting average – Percentage of times a bus arrives late Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 57 Empirical Probabilities When we can’t find data or when a situation is too complex for us to find the empirical probability of a random event, we can sometimes simulate the situation to generate data needed to find the empirical probability. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 58 Steps for a Simulation 1. Identify the random action and the probability of a successful outcome. 2. Determine how to simulate this random action (for example: technology, random number table). 3. Determine the event you’re interested in. 4. Explain how you will simulate one trial. 5. Carry out a trial, record whether or not the event of interest occurred. 6. Repeat the trial many times (at least 100) and count the number of times your event occurred. 7. Use the data to find the empirical probability. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 59 Example: Simulation for P(3 Heads) When Tossing a Coin 3 Times 1. Identify the random action and the probability of a successful outcome. Random action is the outcome of a single coin toss. P(head) = 0.50 2. Determine how to simulate this random action (for example: technology, random number table). Use a random number table. Let even digits = “tails” and odd digits = “heads.” 3. Determine the event you’re interested in. Interested in whether we get 3 Heads in 3 tosses. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 60 Example: Coin Toss Simulation 4. Explain how you will simulate one trial. Read off 3 digits from a row in the table; each digit represents a toss. Record T for even numbers and H for odd numbers. 5. Carry out a trial, record whether or not the event of interest occurred. If 3 heads occur in 3 tosses, record “yes”; otherwise record “no.” 6. Repeat the trial many times (at least 100) and count the number of times your event occurred. 7. Use the data to find the empirical probability. Empirical probability = #yes/total number of trials Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 61 Example: Coin Toss Simulation Starting with line 01: 210 = THT = NO (did not get 3 heads) 333 = HHH = YES (did get 3 heads) 252 = THT = NO (did not get 3 heads) Repeat at least 100 times Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 62 Law of Large Numbers If an experiment with a random outcome is repeated a large number of times, the empirical probability of an event is likely to be close to the true probability. The larger the number of repetitions, the closer together these probabilities are likely to be. Copyright Copyright©©2017, 2017,2014 2014Pearson PearsonEducation, Education,Inc. Inc. Slide 63