Math 3680 Lecture #3 Probability We hear about chance in several different contexts: 1. A certain horse is given 5:1 odds to win a race. 2. A banker recommends a certain stock for investment. 3. Josh Hamilton is batting 0.361 for the season. 4. In a recent poll, 48% of Americans approve of the president’s performance. 5. The chance of being dealt the queen of spades is 1 in 52. 6. The chance of winning a Pick 4 lottery game is 1 in 10,000. We have three different types of probabilities: 1) Expert opinion (subjective) 2) Relative frequency (empirical) 3) Equally likely outcomes (theoretical) Definition: The probability of event A is denoted P(A). 1) Chances are between 0% and 100%. That is: 0 ≤ P(A) ≤ 1. We denote an impossible event (the empty set) by Ø: P(Ø) = 0. There is a technical difference between the phrases impossible and probability zero. Example: I pick a real number in the interval [0,1] and you try to guess my number. It’s not impossible, but the probability that you pick my number is zero. Question: Would the same be true if I told you that I rounded my number to six decimal places? 2) The chance of something not happening is 100% minus the chance of it happening. That is, P(not E) = P(E’ ) = 1 - P(E). This event, “not E,” is referred to as the complement of E. 3) When you draw at random, we assume that all the possible outcomes are equally likely, so that number of favorable outcomes P(E) = number of possible outcomes The word “draw” is used to suggest “select”, or “pick”, or “choose.” There are two ways that draws can be made: 1. Draws with replacement, such as rolling a die repeatedly or tossing a coin repeatedly. 2. Draws without replacement, such as dealing cards from a deck or 5 CD random shuffle. 4) If E implies F, then F is more likely than E. If E F , then P(E) ≤ P(F). Example: Let E = “a dealt card is a heart” Let F = “a dealt card is red” Definition: Conditional probability. The conditional probability that A happens given that B happens is denoted by P(A | B) Formula: P( A | B) P( A B) P( B) Here, A ∩ B denotes the intersection of A and B; that is, the event that A and B both happen. Ex: Two tickets are drawn without replacement from the box 1 2 3 4 2 A) What is the chance that the second ticket is , given the first is ? (Conditional probability) 4 B) What is the chance that the first ticket is (Unconditional probability) 2 ? 2 C) What is the chance that the second ticket is (Again unconditional probability!) D) Repeat if the draws are made with replacement. ? Example: Five cards are dealt off the top of a well-shuffled deck. A) Find the chance that the fifth card is the queen of spades. B) Find the chance that the fifth card is the queen of spades, given that the first four cards are hearts. Example: A penny is tossed five times. A) Find the chance that the fifth toss is a head. B) Find the chance that the fifth toss is a head, given that the first four tosses are tails. Example: A box has three tickets – red, white and blue. Two tickets are drawn at random without replacement. What is the chance that the red ticket is drawn first, and the white ticket second? Solution #1: Counting the possibilities. RW RB So the chance is 1 6 WR WB BR BW Solution #2: Multiplication Rule. Imagine a large group of people attempting this experiment. Roughly one-third will get the first draw correct. Of these people, about half will get the second draw correct. Thus, from the original population, 1 1 1 3 2 6 will get both draws correct. Definition: Multiplication Rule. The chance that events A and B both happen is found by multiplying the chance that event A happens by the chance that B happens, given that A has happened: P(A ∩ B) = P(A) P(B | A) Example: A deck of cards is shuffled and two cards are dealt. What is the probability that both are hearts? Method #1: List the possible outcomes. Example: A deck of cards is shuffled and two cards are dealt. What is the probability that both are hearts? Method #2: Use the multiplication rule. Example: Five cards are dealt from a well-shuffled deck. What is the probability that all 5 are hearts? Example: In poker, what is the probability of being dealt a flush? Example: A die is rolled four times. What is the probability that all four rolls are different? Definition: Independent. We say that two events A and B are independent if the outcome of event A does not influence the outcome of event B. In mathematical notation, P(B | A) = P(B) Example: A coin is tossed twice. Let A = “the first flip lands heads” B = “the second flip lands heads” Are events A and B independent? Example: A die is rolled once. Let A = “the die lands on four” B = “the die lands on six” Are events A and B independent? Example: Two cards are dealt. Let A = “the first card is an ace” B = “the second card is an ace” Are events A and B independent? Example: One card is dealt. Let A = “the card is a jack” B = “the card is a heart” Are events A and B independent? Rule of thumb: When drawing with replacement, the draws are independent. When drawing without replacement, the draws are dependent. Example: A die is rolled 10 times. Find the chance of ... A) getting 10 sixes B) not getting 10 sixes C) all the rolls showing 5 or fewer dots D) getting at least one six Are B) and C) the same? Definition: Mutually Exclusive. Two events are called mutually exclusive (or disjoint) if they cannot occur simultaneously. WARNING: Disjoint is a different concept than independent. If E and F are disjoint, then P(F | E) = 0. If E and F are independent, then P(F | E) = P(F). Example: A coin is flipped twice. Let A = “the first flip lands heads” B = “the second flip lands heads” Are events A and B disjoint? Example: A die is rolled once. Let A = “the die lands on four” B = “the die lands on six” Are events A and B disjoint? Example: Two cards are dealt. Let A = “the first card is an ace” B = “the second card is an ace” Are events A and B disjoint? Example: One card is dealt. Let A = “the card is a jack” B = “the card is a heart” Are events A and B disjoint? Property: If A and B are disjoint, then P(A or B) P(A) + P(B) Note: The word “or” has a different meaning in probability than in ordinary English usage. It does not mean “exclusive or”. That is, “A or B” means “A, or B, or both A and B.” Example: A card is dealt from a shuffled deck. What is the probability that the card is a face card? Solution: P(jack or queen or king) = P(jack) + P(queen) + P(king) 4 4 4 + + 52 52 52 3 13 Example: A card is dealt from a well-shuffled deck. What is the probability that it is a red? Solution: P(heart or diamond) = P(heart) + P(diamond) (mutually exclusive) Example: Two dice are rolled. What’s the probability that an ace (one dot) appears? Common Mistake: P(ace on first or ace on second) = P(ace on first ) + P(ace on second) 1 1 = + 6 6 1 = 3 Correct Answer #1: Look at a chart of the 36 possible outcomes for the roll of two dice. There are 11 pairs in which an ace appears. So the answer is 11 . 36 11 12 13 14 15 16 21 22 23 24 25 26 31 32 33 34 35 36 41 42 43 44 45 46 51 52 53 54 55 56 61 62 63 64 65 66 Because these two events are not mutually exclusive, the first (incorrect) method produced an answer that was too big K 12 36 11 instead of 36 . Subtracting something makes sense. After all, the probability of an ace appearing on 7 7 dice cannot be . 6 Correct Answer #2: Use the general formula for events which are not mutually exclusive: P(A or B) P(A) + P ( B) - P(A ∩ B ) Notice that the Rule of Addition saves a lot of time. Example: A card is dealt. What is the probability it is either a queen or a spade? Example: True or false? In a shuffled deck of cards: A) The chance that the top card is the jack of clubs is 1/52. B) The chance that the bottom card is eight of hearts is 1/52. C) The chance that the top card is the jack of clubs or the bottom card is the eight of hearts is 2/52. D) The chance that the top card is the jack of clubs or the bottom card is the jack of clubs is 2/52. E) The chance that the top card is the jack of clubs and the bottom card is the eight of hearts is 1 1 52 52 F) The chance that the top card is the jack of clubs and the bottom card is the jack of clubs is 1 1 x 52 52 Example: Four tickets are drawn from a box that contains 5 tickets each numbered from “1” to “5”. Find P(at least one 2) if the draws are made A) with replacement B) without replacement Example: Suppose that P(A) = 0.2, P(B) = 0.3 and P(A or B) = 0.4. Use a Venn diagram to find the following quantities: 1. 2. 3. 4. P(A ∩ B ) P(A ∩ B’ ) P(A’ ∩ B’ ) P(A | B) Multiplication Trees and Bayes’ Rule Example: Suppose there are two electrical components. The chance that the first component fails is 20%. If the first fails, the chance that the second fails is 30%. However, if the first works, the chance that the second fails is 10%. Find the probability that: 1. At least one component works. 2. Exactly one component works. 3. The second component works. Solution: A multi-stage problem like this can be visualized with a tree diagram: 0.9 Works 0.72 Fails 0.08 Works 0.14 Fails 0.06 Works 0.8 0.1 0.2 0.7 Fails 0.3 0.9 Works 0.72 Fails 0.08 Works 0.14 Fails 0.06 Works 0.8 0.1 0.2 0.7 Fails 0.3 P(at least one component works) = P(exactly one component works) = P(second component works) = Example: In a class of 50 students, what is the probability that at least two share a birthday? Example: In Barcelona, the local men tend not to be overweight due to genetic and dietary reasons. However, the tourists from around the world who visit Barcelona tend to be as overweight as the rest of Europe and America. Suppose: • 2% of Barcelona men are overweight • 35% of Barcelona’s male tourists are overweight • 10% of the men in Barcelona are tourists If a man is selected at random, what is the probability that he’s overweight? Example: Suppose 2% of Barcelona men are overweight, while 35% of Barcelona’s male tourists are overweight. Also, suppose 10% of the men in Barcelona are tourists. If you see an overweight man at a distance in Barcelona, what is the probability that he’s a tourist? Solution: Let A = “man is overweight”, B = “man is a tourist.” Then we are given P(A | B) = 0.35 P(A | B’ ) = 0.02 P(B) = 0.1 But we want P(B | A)… the reverse conditional probability. P(tourist | overweight ) P(tourist overweight ) P(overweight ) (0.1)(0.35) (0.1)(0.35) + (0.9)(0.02) 0.66. Example: In a study of 101 patients, 37 do not have coronary artery disease (CAD) and 64 have CAD. All 101 patients were given a certain test for CAD. Of the 37 patients without CAD, 34 had a negative test while 3 had a positive test. Of the 64 patients with CAD, 54 had a positive test and 10 had a negative test. A man in his 50s with a family history of CAD sees a doctor, complaining of chest pain. Because of his age and family history, the doctor estimates the probability that the patient has CAD as 0.6. The patient is then given the above test, and it comes back positive. Find the posterior probability that the patient has CAD. Solution: We begin with the tree diagram: Test positive 0.506 10/64 Test negative 0.094 3/37 Test positive 0.032 34/37 Test negative 0.368 54/64 0.6 Disease positive 0.4 Disease negative P(disease positive | test positive) P(disease positive test positive) P(test positive) (0.6)(54 / 64) (0.6)(54 / 64) + (0.4)(3 / 37) 0.94. Definition: Sensitivity = P(test positive | disease positive) Specificity = P(test negative | disease negative) In a perfect world, both of these conditional probabilities would be 100%, but that’s unrealistic. Bayes’ rule allows us to take the information from a clinical trial and use it in a diagnostic setting. Measuring these two quantities is absolutely essential in a clinical medical trial. Let’s look up how many articles have been published which contain these words in the abstract. Example: The receptor interleukin-8 is measured as a test for ectopic (tubal) pregnancy. For 17 women with ectopic pregnancy, 14 tested positive and 3 tested negative. For 55 women without an ectopic pregnancy, 10 tested positive and 45 tested negative. (a) Find the sensitivity and specificity of the test. (b) An obstetrician treats a woman with mild pelvic pain. Based on her professional experience, the doctor believes the probability of an ectopic pregnancy to be 0.2. The patient is tested, and the test returns negative. Find the posterior probability of an ectopic pregnancy.