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
Lecture Slides Elementary Statistics Eleventh Edition and the Triola Statistics Series by Mario F. Triola Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 1 Chapter 4 Probability 4-1 Review and Preview 4-2 Basic Concepts of Probability 4-3 Addition Rule 4-4 Multiplication Rule: Basics 4-5 Multiplication Rule: Complements and Conditional Probability 4-6 Probabilities Through Simulations 4-7 Counting Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 2 Section 4-1 Review and Preview Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 3 Preview Rare Event Rule for Inferential Statistics: If, under a given assumption, the probability of a particular observed event is extremely small, we conclude that the assumption is probably not correct. Statisticians use the rare event rule for inferential statistics. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 4 Example of rare event: A company claims that it developed a gender selection technique to ensure that you get a baby girl. In a clinical study they got 13 girls out of 14 babies on which they applied the technique. If the technique were not effective, there would be approximately equal chance of boy or girl. If so, 13 girls out of 14 babies are very unlikely – rare event => Even though there is a chance of getting 13 out of 14 cases by chance, that chance (probability) is so low, that it would be rejected as a reasonable explanation – rare event!!! Instead, the technique would be considered effective. Statisticians reject explanations based on very low probabilities. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 5 Section 4-2 Basic Concepts of Probability Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 6 Part 1 Basics of Probability Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 7 My example Consider coin tosses. Single coin toss: Heads (H) or Tails (T). This is a simple event (cannot be broken down) – got H or got T Sample space = {H,T} Consider 2 coin tosses. Simple events are HH, HT etc… Sample space = { HH, HT, TH, TT } Note that event 1 H and 1 T is NOT simple, because it can be further broken into 2 events HT and TH. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 8 Sample spaces It’s the question that determines the sample space. A. A basketball player shoots three free throws. What are the possible sequences of hits (H) and misses (M)? H H - HHH M - HHM H M M… H - HMH M - HMM S= { HHH, HHM, HMH, HMM, MHH, MHM, MMH, MMM} … B. A basketball player shoots three free throws. What is the number of baskets made? Note: 8 elements, 23 S = { 0, 1, 2, 3 } C. A nutrition researcher feeds a new diet to a young male white rat. What are the possible outcomes of weight gain (in grams)? S = (all numbers ≥ 0) Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 9 Notation for Probabilities P - denotes a probability. A, B, and C - denote specific events. P(A) - denotes the probability of event A occurring. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 10 Basic Rules for Computing Probability Rule 1: Relative Frequency Approximation of Probability Conduct (or observe) a procedure, and count the number of times event A actually occurs. Based on these actual results, P(A) is approximated as follows: P(A) = # of times A occurred # of times procedure was repeated Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 11 Examples of relative frequency approach: 1) Out of 400 new accounts opened by an investment firm last year, 300 were profitable => P(particular account is profitable) = 300/400 = 0.75 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 12 Basic Rules for Computing Probability - continued Rule 2: Classical Approach to Probability (Requires Equally Likely Outcomes) Assume that a given procedure has n different simple events and that each of those simple events has an equal chance of occurring. If event A can occur in s of these n ways, then s P(A) = n = number of ways A can occur number of different simple events Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 13 Example: Probability Model for a Coin Toss: S = {Head, Tail} – sample space (assume equal chance of occurring) Probability of heads = 0.5 Probability of tails = 0.5 Example: If you flip two coins, and the first flip does not affect the second flip: S = {HH, HT, TH, TT} – sample space. The probability of each of these events is 1/4, or 0.25. Example: Probability of winning grand prize in lottery by selecting 6 numbers between 1 and 60. Each combination is assumed to have equal probability of occurring. P = 2e-8 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 14 Law of Large Numbers When finding probabilities with relative frequency approach, we obtain an approximation, not an exact value. As a procedure is repeated again and again, the relative frequency probability of an event tends to approach the actual probability. With only a few trials, we can get a very different result. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 15 Coin toss The result of any single coin toss is random. But the result over many tosses is predictable, as long as the trials are independent (i.e., the outcome of a new coin flip is not influenced by the result of the previous flip). The probability of heads is 0.5 = the proportion of times you get heads in many repeated trials – low of large numbers at work First series of tosses Second series Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 16 Excel Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 17 Example – 2 coin tosses (classical approach). If you flip two coins, H and T are equally likely, and 1st flip does not affect 2nd : S = {HH, HT, TH, TT} – sample space. H and T are equally likely => probability of each of these events is 1/4, or 0.25 – equally likely outcomes. What is the probability we get 2 different coins? Among 4 total outcomes, there are 2 where coins are different HT and TH. P = 2/4 = 0.5. Example – Genotypes. When studying effects of heredity on height, the genotypes are {AA, Aa, aA, aa} = S – sample space. -- Assume all 4 are equally likely. Then, it is the same as coin tosses above Probability to get two different genotypes is P = 0.5 (Aa and aA) Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 18 Example – 3 coin tosses (classical approach). Assume you flip three coins, H and T are equally likely, and one flip does not affect another: S = {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT} – sample space, 8 elements In this case the total number of outcomes is not obvious – have to enumerate! H and T are equally likely => probability of each of these events is 1/8 – equally likely outcomes. What is the probability we get exactly 2 Heads? Among 8 total outcomes, there are 3 with exactly two heads. => P = 3/8 = 0.375. Example – Gender of children. A couple has 3 children. What is probability of having exactly 2 girls? Assume boys and girls are equally likely and gender of one child is not influenced by the gender of another. S = {GGG, GGB, GBG, GBB, BGG, BGB, BBG, BBB} – sample space, 8 elements Then, it is the same as coin tosses above Probability to get two girls is P = 0.375 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 19 Example – survey (relative frequency approach). A polling firm conducted a survey of party affiliations. They obtained 340 Dem, 300 Rep, and 360 Indep out of 1000 subjects. What is the probability that a randomly selected individual is Democrat? P = # Dem / total = 340/1000 = 0.34 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 20 Example: Polygraph test Subject Did NOT Lie Subject Lied Positive test result (test indicates subject lied) 10 (false positive) 45 (true positive) Negative test result (test indicates subject did not lie) 40 ( true negative) 5 (false negative) Sample space consists of 100 tests. Assume they are all randomly selected. Probability of negative test result is (40+5)/100 = 0.45 ------||------------ positive (10+45)/100 = 0.55 false positive (10)/100 = 0.1 false negative (5) / 100 = 0.05 polygraph being wrong (10+5)/100 = 0.15 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 21 NOTE on Simulations: It may seem that we should always use classical approach when a procedure has equally likely outcomes. In reality, many procedures are so complicated that classical approach is impractical and relative frequency is employed. Some card game hands may all be equally likely, but there are so many possibilities, that it is too hard to find it classically. A computer simulation is usually employed where the same game rules are coded into a program and it is run, say, 1 million times. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 22 Probability Limits Always express a probability as a fraction or decimal number between 0 and 1. The probability of an impossible event is 0. The probability of an event that is certain to occur is 1. For any event A, the probability of A is between 0 and 1 inclusive. That is, 0 P(A) 1. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 23 Complementary Events The complement of event A, denoted by A, consists of all outcomes in which the event A does not occur. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 24 Part 2 skip Beyond the Basics of Probability: Odds Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 25 Odds (optional) skip The actual odds against event A occurring are the ratio P(A)/P(A), usually expressed in the form of a:b (or “a to b”), where a and b are integers having no common factors. The actual odds in favor of event A occurring are the ratio P(A)/P(A), which is the reciprocal of the actual odds against the event. If the odds against A are a:b, then the odds in favor of A are b:a. The payoff odds against event A occurring are the ratio of the net profit (if you win) to the amount bet. payoff odds against event A = (net profit) : (amount bet) Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 26 Example: skip casino roulette Assume you bet on one particular number (say 10) out of 38 possible. P(10) = 1/38 P(not 10) = 37/38 Actual odds against 10 = P(not A)/P(A) = 37/1 <=> 37:1 Casino gives payoff odds 35:1. 35:1 = (net profit):(amount bet) => If bet $100, win $3500 If casino was not operated for profit, it should have been 37:1 and you would win $3700 NOTE: odds against event A = a:b correspond to probability P(A) = b/(a+b) Odds against 10 are 37:1 => P(10) = 1/(37+1) = 1/38 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 27 Section 4-3 Addition Rule Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 28 Key Concept This section presents the addition rule to find probabilities that can be expressed as P(A or B), the probability that either event A occurs or event B occurs (or they both occur) as the single outcome of the procedure. The key words in this section are “or” and “single outcome” It is the inclusive or, which means either one or the other or both. Compound Event: any event combining 2 or more simple events Formal Addition Rule P(A or B) = P(A) + P(B) – P(A and B) where P(A and B) denotes the probability that A and B both occur at the same time as an outcome in a trial of a procedure. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 29 Examples: Addition rule 1) Suppose a high school consists of 25% juniors, 15% seniors, and the remaining 60% is students of other grades. The relative frequency of students who are either juniors and seniors is 40%. We can add the relative frequencies of juniors (P(J)=0.25) and seniors (P(S)=0.15) because no student can be both junior and senior P(J and S) = 0. P(J or S) = 0.25 + 0.15 = 0.40 2) Suppose that we draw one card from a deck of 52 playing cards. What is the probability that the card will be either a king or a heart? The probability of drawing a king is P(K) = 4/52. The probability of drawing a heart is P(H) = 13/52 The probability of drawing the king of hearts is P(K and H) = 1/52. Therefore: P(K or H) = 4/52 + 13/52 - 1/52 = 16/52 = 4/13 Or informally there are 4 kings and 13 heats, adding King of Hearts only once: 3 + 13 16 P = --------- = ----52 52 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 30 Subject Did NOT Lie Subject Lied Positive test result (test indicates subject lied) 10 (false positive) 45 (true positive) Negative test result (test indicates subject did not lie) 40 ( true negative) 5 (false negative) Examples: Back to polygraph example. P( get positive test result or subject lied ) = P(get positive) + P(lied) – P(both) = 0.55 + 0.5 - 0.45 = 0.6 Or more directly counting only once: (10+45+5)/100 = 0.6 -- be careful to avoid double counting!!! Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 31 Disjoint or Mutually Exclusive Events A and B are disjoint (or mutually exclusive) if they can NOT occur at the same time. That is, disjoint events do not overlap. Venn Diagram for Events That Are Not Disjoint – A and B not empty P(A and B) not 0 P (A or B) = P(A) + P(B) - P(A and B) Venn Diagram for Disjoint Events A and B empty, P(A and B) = 0 P (A or B) = P(A) + P(B) -- have to remove double counting Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 32 Back to same examples: Addition rule 1) Suppose a high school consists of 25% juniors, 15% seniors, and the remaining 60% is students of other grades. The relative frequency of students who are either juniors and seniors is 40%. We can add the relative frequencies of juniors (P(J)=0.25) and seniors (P(S)=0.15) because no student can be both junior and senior P(J and S) = 0. Disjoint events P(J or S) = 0.25 + 0.15 = 0.40 2) Suppose that we draw one card from a deck of 52 playing cards. What is the probability that the card will be either a king or a heart? The probability of drawing a king is P(K) = 4/52. The probability of drawing a heart is P(H) = 13/52 The probability of drawing the king of hearts is P(K and H) = 1/52. Therefore: P(K or H) = 4/52 + 13/52 - 1/52 = 16/52 = 4/13 Not disjoint (overlapping) events Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 33 Subject Did NOT Lie Subject Lied Positive test result (test indicates subject lied) 10 (false positive) 45 (true positive) Negative test result (test indicates subject did not lie) 40 ( true negative) 5 (false negative) Examples: Back to polygraph example. 1) Consider a procedure of selecting randomly 1 of 100 test subjects. Let Event A = Get a subject with negative test results Event B = Get a subject who lied -- NOT disjoint, there is overlap of 5 subjects (false positive) – it is hard, but not impossible to beat a polygraph Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 34 Return to Complementary Events Remember that the complement of event A, denoted by A, consists of all outcomes in which the event A does not occur. A and A are disjoint => (A and A) is empty. It is impossible for an event and its complement to occur at the same time. Also, we are certain that either A or A does occur => P(A) + P(A) = 1 P(A) = 1 – P(A) P(A) = 1 – P(A) Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 35 Examples: 1) A coin is flipped, it can either land on "heads" or on "tails" Because these two events are complementary, we have P(H) + P(T) = 1 2) Three marbles are in a bag. One is blue and two are red. Assuming that each has an equal chance of being pulled out of the bag, we get P(B) = 1/3 P(R) = 2/3 3) A single card is chosen at random from a standard deck of 52 playing cards. What is the probability of choosing a card that is not a king? Probability: P(not king) = 1 - P(king) = 1 - 4 /52 = 48/52 = 12/13 4) A single 6-sided die is rolled. What is the probability of rolling a number that is not 4? Probability: P(not 4) = 1 - P(4) = 1 - 1/6 = 5/6 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 36 Section 4-4 Multiplication Rule: Basics Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 37 Key Concept The basic multiplication rule is used for finding P(A and B), the probability that event A occurs in a first trial and event B occurs in a second trial (NOT same trial). If the outcome of the first event A somehow affects the probability of the second event B, it is important to adjust the probability of B to reflect the occurrence of event A. P(A and B) = P(event A occurs in a first trial and event B occurs in a second trial) Compare to the “or” before: P(A or B) = P (in a single trial, event A occurs or event B occurs or they both occur) Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 38 Tree Diagrams A tree diagram is a picture of the possible outcomes of a procedure, shown as line segments emanating from one starting point. These diagrams are sometimes helpful in determining the number of possible outcomes in a sample space, if the number of possibilities is not too large. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 39 Tree Diagrams This figure summarizes the possible outcomes for a true/false question followed by a multiple choice question. Note that there are 10 possible combinations. What is the probability that if somebody makes random guesses for both answers, the 1st answer will be correct and 2nd will be correct. If answers are random guesses, then all 10 possible outcomes are equally likely => P(both correct) = P(T and c) = 1/10 Correct answers are T and c Note that P(T) = ½ and P(c) = 1/5 => P(T and c) = P(T)*P(c) This suggests that in general P(A and B) = P(A) * P(B) – NOT True Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 40 Examples: A card is chosen at random from a standard deck of 52 playing cards. Without replacing it, a second card is chosen. What is the probability that the first card chosen is a queen and the second card chosen is a jack? P(queen on first pick) = 4/52 P(jack on 2nd pick given queen on 1st pick) = 4/51 P(queen and jack) = 4/52 · 4/51 = 0.006033183 --- not 4/52 · 4/52 P(jack on 2nd pick given queen on 1st pick) --- Conditional Probability We must adjust the probability of the second event to reflect the outcome of the first event. I.e. the probability for the second event B should take into account the fact that the first event A has already occurred. P(B|A) represents the probability of event B occurring after it is assumed that event A has already occurred (read B|A as “B given A.”) Note that: P(jack on 2nd pick | jack on 1st pick) = 4/52 · 3/51 =0.0045 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 41 Subject Did NOT Lie Subject Lied Positive test result (test indicates subject lied) 10 (false positive) 45 (true positive) Negative test result (test indicates subject did not lie) 40 ( true negative) 5 (false negative) Example: Two subjects are randomly selected without replacement. Find probability that 1st person had a positive test and 2nd negative. P(1st positive) = 55/100 = 0.55 After the 1st selection, there are 99 subjects left, 45 of whom had negative test. P(2nd negative adjusted) = 45/99 = 0.4545455 Then P(1st positive and 2nd negative) = P(1st positive) * P(2nd negative adjusted) = 0.55* 0.4545455 = 0.25 NOTE that P(1st positive)*P(2nd negative not adjusted) = 0.55*0.45 = 0.2475 -- NOT same => In general P(A and B) is not P(A)*P(B) Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 42 Dependent and Independent Two events A and B are independent if the occurrence of one does NOT affect the probability of the occurrence of the other. If A and B are not independent, they are said to be dependent. (NOT one causing another just affecting probability). Several events are similarly independent if the occurrence of any does not affect the probabilities of the occurrence of the others. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 43 Multiplication Rule P(A and B) = P(A) • P(B A) When finding the probability that event A occurs in one trial and event B occurs in the next trial, multiply the probability of event A by the probability of event B, but be sure that the probability of event B takes into account the previous occurrence of event A. Note that if A and B are independent events, P(B A) is really the same as P(B). Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 44 Applying the Multiplication Rule Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 45 Examples: 1) Answering correctly T/F in 1st test question and 2nd multiple choice questions were independent => P(A and B) = P(A)*P(B) 2) On polygraph test, picking 1st subject affects picking 2nd subject (less options) => dependent => P(A and B) = P(A)*P(B|A) --- NOT P(A)*P(B) 3) Choosing 2 cards without replacement, choosing 1st affects probability for 2nd => dependent => P(A and B) = P(A)*P(B|A) --- NOT P(A)*P(B) NOTE In examples 2 and 3, if the selection were done with replacement => Then for 2nd subject or for 2nd card, the selection would begin with exactly the same collection of items => The events A and B would be independent and P(A and B) = P(A)*P(B) Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 46 Multiplication Rule for Several Events In general, the probability of any sequence of independent events is simply the product of their corresponding probabilities. Example: Probability of tossing a fair coin 6 times and getting all Heads is : P = 0.5*0.5* … *0.5 = 0.5^6 = 0.015625 -- because tossing coin are independent events. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 47 Treating Dependent Events as Independent Some calculations are cumbersome, but they can be made manageable by using the common practice of treating events as independent when small samples are drawn from large populations. In such cases, it is rare to select the same item twice. If a sample size is no more than 5% of the size of the population, treat the selections as being independent (even if the selections are made without replacement, so they are technically dependent). Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 48 Example: Assume that out of 1000 computer chips produced 30 are defective. 1) If 3 are randomly selected without replacement, what is probability that they are all good? Exact probability = (1000-30)/1000 * (1000-30-1)/999 * (1000-30-2)/998 = 0.9125882 Approximate = ( (1000-30)/1000 ) ^ 3 = 0.912673 --- very close 30/1000 << 5%, so the rule is applicable and we can see that it works. 2) If 20 are randomly selected without replacement, what is probability that they are all good? >P=1 > N = 1000 > n = 20 > bad = 30 > for ( i in 1:n ) { + P = P*(N-i+1-bad)/(N-i+1) +} >P [1] 0.5405657 > > Papprox = ( (N-bad)/N )^n > Papprox [1] 0.5437943 The error is very small. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 49 Ex 4, p165 : optional The following example is designed to illustrate the importance of carefully identifying the event being considered. Note that parts (a) and (b) appear to be quite similar, but their solutions are very different. Birthdays problem Assume two people are randomly selected and their b-days occur on the days of the week with equal frequencies. a) What is the probability that they are born on the same day of the week? Because no particular day is specified, the 1st person can be born on any day. The probability that the 2nd is born on the same day is just 1/7 => The probability that two people are born on the same day of the week is 1/7. b) What is the probability that two people are born on Sat. The probability that 1st is born on Sat is 1/7, same for the 2nd. These events are independent => The probability that two people are born on Sat is (1/7)*(1/7) = 1/49. (b) illustrates independent events, while (a) shows how one must be careful with wording of the problem. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 50 Quality control example, faulty cell phones. Assume manufacturer claims that only about 1% of its cell phones are faulty. However, in a batch of 10 phones, all 10 turn out to be bad. What is the probability of such an event occurring by chance? One phone is independent of another => independent events. P(10 are faulty) = P(1st bad and 2nd bad ….) = independent = P(1st bad)*P(2nd bad) * … = 0.01^10 = 1e-20 - manufacturer’s claim is extremely unlikely. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 51 Principle of Redundancy One design feature contributing to reliability is the use of redundancy, whereby critical components are duplicated so that if one fails, the other will work. For example, single-engine aircraft now have two independent electrical systems so that if one electrical system fails, the other can continue to work so that the engine does not fail. Assume the probability for a system to fail is 1/1000 = 0.001 Since the systems are independent => P(both fail) = P(1st fails and 2nd fails ) = P(1st fails) * P(2nd fails) = 0.001^2 = 1e-6 – huge improvement. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 52 Section 4-5 Multiplication Rule: Complements and Conditional Probability Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 53 Complements: The Probability of “At Least One” “At least one” is equivalent to “one or more.” Example: In two coin flips get at least one heads. The complement of getting at least one item of a particular type is that you get no items of that type. In two coin flips there was no heads at all To find the probability of at least one of something, calculate the probability of none, then subtract that result from 1: P(at least one) = 1 – P(none). Ex: Two coin flips P( at least 1 H in two coin flips) = 1 – P(no heads) = 1 – P(TT) = [coin flips are assumed independent] = 1 – P(T)*P(T) = [assume fair coins] = 1 – 0.5^2 = 0.75 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 54 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 55 Example, faulty cell phones (again). Assume testing suggests that about 1% of iphones are faulty. => probability that a randomly selected phone is faulty = 0.01 Assume that a retailer buys 200 phones. What is the probability that at least one is defective? P(at least one faulty) = 1 – P(all 200 are good) Probability of a particular iphone is good is 1 – 0.01 = 0.99 Phones are independent => P(all 200 are good) = 0.99^200 => P(at least one faulty) = 1 – 0.99^200 = 0.8660203 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. - quite big 4.1 - 56 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 57 Subject Did NOT Lie Subject Lied Positive test result (test indicates subject lied) 10 (false positive) 45 (true positive) Negative test result (test indicates subject did not lie) 40 ( true negative) 5 (false negative) Example: P(positive test | subject lied) = P( positive test and lied)/P(lied) = 0.45/0.5 = 0.9 Or using intuitive approach: Assume subject lied => deal only with that column – 50 subjects. Among them 45 had positive test result => P = 45/50 =0.9 – same P(subject lied | positive test) = P(lied and positive test )/P(positive test) = 0.45/0.55 = 0.818 -- NOT SAME as P(positive test | subject lied) With intuitive approach: assume positive test – 55 subjects, of them 45 lied => P = 45/55 – same. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 58 Confusion of the Inverse To incorrectly believe that P(A|B) and P(B|A) are the same, or to incorrectly use one value for the other, is often called confusion of the inverse. Hard drug users tend to use marijuana; therefore, marijuana users tend to use hard drugs (the first probability is marijuana use given hard drug use, the second is hard drug use given marijuana use) Most accidents occur within 25 miles from home; therefore, you are safest when you are far from home (you usually drive most in that radius) Terrorists tend to have an engineering background; so, engineers have a tendency towards terrorism Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 59 Section 4-6 Probabilities Through Simulations - skip Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 60 Key Concept skip In this section we use simulations as an alternative approach to finding probabilities. The advantage to using simulations is that we can overcome much of the difficulty encountered when using the formal rules discussed in the preceding sections. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 61 Simulation skip A simulation of a procedure is a process that behaves the same way as the procedure, so that similar results are produced. The only real way to do simulations is to write computer code and run for millions of times. The book does not really give a lot of info. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 62 Simulation Example skip Gender Selection In a test of the MicroSort method of gender selection developed by the Genetics & IVF Institute, 127 boys were born among 152 babies born to parents who used the YSORT method for trying to have a baby boy. In order to properly evaluate these results, we need to know the probability of getting at least 127 boys among 152 births, assuming that boys and girls are equally likely. Assuming that male and female births are equally likely, describe a simulation that results in the genders of 152 newborn babies. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 63 Solution skip One approach is simply to flip a fair coin 152 times, with heads representing females and tails representing males. Another approach is to use a calculator or computer to randomly generate 152 numbers that are 0s and 1s, with 0 representing a male and 1 representing a female. The numbers must be generated in such a way that they are equally likely. Here are typical results: Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 64 Simulation Examples skip Solution 1: Flipping a fair coin 100 times where H H T female female male H T female male T male heads = female and tails = male H H H H male female female female Solution 2: Generating 0’s and 1’s with a computer or calculator where 0 = male 1 = female 0 0 male male 1 0 female male 1 1 1 0 female female female male Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 0 0 male male 4.1 - 65 Random Numbers skip In many experiments, random numbers are used in the simulation of naturally occurring events. Below are some ways to generate random numbers. A table of random of digits STATDISK Minitab Excel TI-83/84 Plus calculator Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 66 Random Numbers STATDISK Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. skip Minitab 4.1 - 67 Random Numbers Excel Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. skip TI-83/84 Plus calculator 4.1 - 68 Recap skip In this section we have discussed: The definition of a simulation. How to create a simulation. Ways to generate random numbers. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 69 Section 4-7 Counting Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 70 Key Concept In many probability problems, the big obstacle is finding the total number of outcomes, and this section presents several methods for finding such numbers without directly listing and counting the possibilities, which is impossible most of the time. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 71 Fundamental Counting Rule For a sequence of two events in which the first event can occur m ways and the second event can occur n ways, the events together can occur a total of m*n ways. Ex: A student brags to his friend that he got all questions right on exam by guessing. There are 20 multiple choice questions, each with 5 options. there are total of 100 possibilities. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 72 Notation The factorial symbol ! denotes the product of decreasing positive whole numbers. For example, 4! 4 3 2 1 24. By special definition, 0! = 1. Excel: =FACT(4) Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 73 Factorial Rule A collection of n different items can be arranged in order n! different ways. This factorial rule reflects the fact that the first item may be selected in n different ways, the second item may be selected in n – 1 ways, and so on. Ex: How many ways to arrange 5 people in police lineup? 5 – for 1st person, 4 for 2nd, etc… => 5! = 120 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 74 Select 2 items out of set of 3 items: {ABC} Order matters AB,AC,BC,BA,CA,CB =PERMUT(50,4) Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 75 Permutations Rule (when items are all different) Requirements: 1. There are n different items available. (This rule does not apply if some of the items are identical to others.) 2. We select r of the n items (without replacement). 3. We consider rearrangements of the same items to be different sequences. (The permutation of ABC is different from CBA and is counted separately.) If the preceding requirements are satisfied, the number of permutations (or sequences) of r items selected from n available items (without replacement) is nPr = n! (n - r)! Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 76 Permutations (continue) When we use terms permutations, arrangements, or sequence, we imply that order is taken into account – different orderings of the same items are counted separately. We will use combinations later, which do not distinguish between such arrangements. =PERMUT(20,2) Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 77 Permutations Rule when some items are identical to others Requirements: 1. There are n items available, and some items are identical to others. 2. We select all of the n items (without replacement). 3. We consider rearrangements of distinct items to be different sequences. If the preceding requirements are satisfied, and if there are n1 alike, n2 alike, . . . nk alike, the number of permutations (or sequences) of all items selected without replacement is n! n1! . n2! .. . . . . . . nk! Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 78 =COMBIN(14,3) Example: Assume we are selecting job candidates from 3 different groups. 1st group has 5, 2nd – 6, 3rd – 7. How many different ways to select? Here order within groups does NOT matter => use above formula Total is 18 18!/(5!*6!*7!) = 14,702,678 Consider a particular case of this situation, when there are only two groups. Let n = total # of items, r items are alike and (n-r) items are alike. Permutation formula simplifies to n! -----------r! * (n-r)! - number of combinations Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 79 Combinations Rule Requirements: 1. There are n different items available. 2. We select r of the n items (without replacement). 3. We consider rearrangements of the same items to be the same. (The combination of ABC is the same as CBA.) If the preceding requirements are satisfied, the number of combinations of r items selected from n different items is n! nCr = (n - r )! r! Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 80 Permutations versus Combinations When different orderings of the same items are to be counted separately, we have a permutation problem, but when different orderings are NOT to be counted separately, we have a combination problem. Example. Select 2 items out of set of 3 items: {ABC} 1) Order matters AB,AC,BC,BA,CA,CB 2) Order does not matter AB,AC,BC Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 3! 3! 6 3 P2 (3 2)! (1)! 3! 3! 6 C 3 3 2 2!(3 2)! 2!(1)! 2 1 4.1 - 81 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 82 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 83 skip Bayes' Theorem Conditional probability of an event is a probability obtained with the additional information that some other event has already occurred. P(B|A) = P(A and B)/P(A) Intuitively: The conditional probability of B given A can be found by assuming that event A has occurred and, working under that assumption, calculating the probability that event B will occur. Here, extend the discussion of conditional probability to include applications of Bayes' theorem (or Bayes' rule), which we use for revising a probability value based on additional information that is later obtained. One key to understanding the essence of Bayes' theorem is to recognize that we are dealing with sequential events, whereby new additional information is obtained for a subsequent event, and that new information is used to revise the probability of the initial event. In this context, the terms prior probability and posterior probability are commonly used. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 84 skip Definitions: A prior probability is an initial probability value originally obtained before any additional information is obtained. A posterior probability is a probability value that has been revised by using additional information that is later obtained. Example Select a student randomly from class of 12 girls and 10 boys. Then probability of getting a girl is 12/22 – prior probability. What if, in addition, we know that a student likes to watch Oprah. Then, the probability that it is a girl must be higher. Say, it is 0.8 – posterior probability. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 85 skip Bayes' Theorem The probability of event A, given that event B has subsequently occurred, is P(A|B) = P(A and B) / P(B) = (condition on A instead) = P(B|A)P(A)/ (P(B|A)P(A) + P(B| not A)P(not A) ) Example ( back to selecting a person) Here A – girl B – watches Oprah not A – boy From national study, 80% of women watch Oprah and only 30% of men. Than P(girl | wathes Oprah) = P(watches | girl ) P(girl) / (P(watches | girl ) P(girl) + P(watches | boy ) P(boy) = 0.8*0.54/ ( 0.8*0.54 + 0.3*0.46) = 0.76 OR there is an intuitive approach: Assume some convenient value for the total of all items involved, then construct a table of rows and columns with the individual cell frequencies based on the known probabilities. Say take 1000 as total: watches not girl 432 108 540 boy 138 322 460 P(girl | wathes Oprah) = 432/(432+138) = 0.76 – same intuitive conditional probability Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 86 Bayes’s rule skip •If a sample space is decomposed in k disjoint events, A1, A2, … , Ak — none with a null probability but P(A1) + P(A2) + … + P(Ak) = 1 -- exhaustive events – combine to include all possibilities * And if C is any other event such that P(C) is not 0 or 1, then: Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 87 Example skip An aircraft emergency locator transmitter (ELT) is a device designed to transmit a signal in the case of a crash. The Altigauge Manufacturing Company makes 80% of the ELTs, the Bryant Company makes 15% of them, and Chartair Company makes the other 5%. The ELTs made by Altigauge have a 4% rate of defects, the Bryant ELTs have a 6% rate of defects, and the Chartair ELTs have a 9% rate of defects. a. If an ELT is randomly selected from the general population of all ELTs, find the probability that it was made by Altigauge Manufacturing Company. b. If a randomly selected ELT is then tested and is found to be defective, find the probability that it was made by Altigauge Manufacturing Company. Solution We use the following notation: A = ELT manufactured by Altigauge B = ELT manufactured by Bryant C = ELT manufactured by Chartair D = ELT is defective Dbar = ELT is not defective (or it is good) a. If an ELT is randomly selected from the general population of all ELTs, the probability that it was made by Altigauge is 0.8. b. If we now have the additional information that the ELT was tested and was found to be defective, we want to revise the probability from part (a) so that the new information can be used. Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 88 We want to find the value of P(A|D), which is the probability that the ELT was made by the Altigauge company given that it is defective. Based on the given information, we know these probabilities: skip P(A) = 0.80 because Altigauge makes 80% of the ELTs P(B) = 0.15 because Bryant makes 15% of the ELTs P(C) = 0.05 because Chartair makes 5% of the ELTs P(D|A) = 0.04 because 4% of the Altigauge ELTs are defective P(D|B) = 0.06 because 6% of the Bryant ELTs are defective P(D|C) = 0.09 because 9% of the Chartair ELTs are defective Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 89 skip Intuitive Baye's Theorem: Now let's find P(A|D) by using a table. Let's arbitrarily assume that 10,000 ELTs were manufactured. Because 80% of the ELTs are made by Altigauge, we have 8000 ELTs made by Altigauge, and 4% of them (or 320) are defective. Also, if 320 of Altigauge ELTs are defective, then 7680 are not defective. See the values of 320 and 7680 in the table below. The other values are found using the same reasoning. We want to find the probability that an ELT was made by Altigauge, given that it is known to be defective. Because we know the condition that the ELT is defective, we can refer to the first column of values where we see that among the 455 total defective ELTs, 320 were made by Altigauge, so that the probability is 320/455 = 0.703 -- same Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. 4.1 - 90