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
Section 5.1 Discrete Probability 1 LaPlace’s definition of probability • Number of successful outcomes divided by the number of possible outcomes • This definition works when all outcomes are equally likely, and are finite in number 2 Finite Probability • Experiment: a procedure that yields one of a given set of possible outcomes • Sample space: set of possible outcomes • Event: a subset of the sample space • LaPlace’s definition, stated formally, is: The probability p of an event E, which is a subset of a finite sample space S of equally likely outcomes is p(E) = |E|/|S| 3 Example 1 • What is the probability that you will draw an ace at random from a shuffled deck of cards? • There are 4 aces, so |E| = 4 • There are 52 cards, so |S| = 52 • So p(E) = |4|/|52|, or 1/13 4 Example 2 • What is the probability that at randomlyselected integer chosen from the first hundred positive integers is odd? • S = 100, E = 50 • So p(E) = 1/2 5 Example 3 • What is the probability of winning the grand prize in the lottery, if to win you must pick 6 correct numbers, each of which is between 1 and 40? • There is one winning combination • The total number of ways to choose 6 numbers out of 40 is C(40,6) = 40!/(34!6!) • So your chances of winning are 1/3,838,380 6 Example 4 • What is the probability that a 5-card poker hand does not contain the ace of hearts? • If all hands are equally likely, the probability of a hand NOT containing a particular card is the quotient of: – probability of picking 5 cards from the 51 remaining: C(51,5) and – probability of picking any 5 cards from entire deck: C(52,5) 7 Example 4 • • • • C(51,5) = 51!/5!46! C(52,5) = 52!/5!47! So C(51,5)/C(52,5) = (51!/5!46!)(5!47!/52!) Through cancellation, we get: 47/52 or ~.9 8 Example 5 • There are C(52,5) = 52!/(47!5!) = 2,598,960 possible hands of 5 cards in a deck of 52 • What is the probability of getting 4 of a kind in a hand of 5? 9 Example 5 • Using the product rule, the number of ways to get 4 of a kind in a hand of 5 is the product of: – the number of ways to pick one kind: C(13,1) – the number of ways to pick 4 of this kind from the total number in the deck of this kind: C(4,4) – the number of ways to pick the 5th card: C(48,1) • So the probability of being dealt 4 of a kind is: (C(13,1)C(4,4)C(48,1))/C(52,5) = 13*1*48/2,598,960 or .00024 10 Example 6 • What is the probability of a 5-card poker hand containing a full house (3 of one kind, 2 of another)? • By the product rule, the number of hands containing a full house is the product of: – ways to pick 2 kinds in order: P(13,2): order matters because 3 aces, 2 tens 3 tens, 2 aces – ways to pick 3 out of 4 of first kind: C(4,3) – ways to pick 2 out of 4 of second kind: C(4,2) 11 Example 6 • P(13,2) * C(4,3) * C(4,2): – P(n,r) = n(n-1) * … * (n-r+1); since 13-2 = 11, P(n,r) = 13 * 12 – C(4,3) = 4!/3!1! & C(4,2) = 4!/2!2! = 24/6 & 24/4 – So result is 156 * 4 * 6 = 3744 • Because there are 2,598,960 possible poker hands, the probability of a full house is 3744/2598960 = ~.0014 12 Example 7 • What is the probability that a 5-card poker hand contains a straight (5 consecutive cards, any suit)? • Assuming ace is always high, the 5 cards could start with any of: {2,3,4,5,6,7,8,9,10} • So there are C(9,1) or 9 ways to start • There are 4 suits, so there are 4 cards of each kind, so there are C(4,1) or 4 ways to make each of the 5 choices 13 Example 7 • Putting this information together with the product rule, there are 9 * 45 = 9,216 different possible hands containing a straight • Since there are 2,598,960 hands possible, the probability of a hand containing a straight is: 9,216/2,598,960 = ~.0035 14 Complement of an event • Let E be an event in sample space S. The probability of E, the complementary event of E is: p(E) = 1 - p(E) • Note that |E| = |S| - |E| • So p(E) = (|S| - |E|)/|S| = 1-|E|/|S| = 1- p(E) • Sometimes it’s easier to find the probability of a complement than the probability of the event itself 15 Example 8 • A sequence of 10 bits is randomly generated. What is the probability that at least one bit is 0? – E: at least 1 of 10 bits is 0 – E: all bits are 1s – S: all strings of 10 bits 16 Example 8 • Since p(E) = 1-p(E) and there are 210 possible bit combinations, but only 1 containing all 1s: • p(E) = 1/210 = 1-1/1024 = 1023/1024, or 99.9% probability that at least one bit is 0 in a random 10-bit string 17 Probability of Union of 2 Events • The probability of the union of 2 events is the sum of the probabilities of each of the events, less the probability of the intersection of the 2 events: • p(E1 E2) = p(E1) + p(E2) - p(E1 E2) 18 Probability of Union of 2 Events: proof of theorem • Recall the formula for the number of elements in the union of 2 sets: • |E1 E2| = |E1| + |E2| - |E1 E2| • So, p |E1 E2| = |E1 E2|/|S| =(|E1| + |E2| - |E1E2|)/|S| = |E1|/|S| + |E2|/|S| - |E1E2|/|S| = p(E1)+p(E2)-p(E1E2) 19 Example 9 • What is the probability that a positive integer selected at random from the set of positive integers not exceeding 100 is divisible by either 2 or 5? • E1 = selected integer divisible by 2; |E1|=50 • E2 = selected integer divisible by 5; |E2|=20 20 Example 9 • So E1 E2 is the event that the number is divisible by either 2 or 5 and • E1 E2 is the event that the number is divisible by both (divisible by 10): |E1E2|=10 • So p(E1 E2) = p(E1) + p(E2) - p(E1 E2) = 50/100 + 20/100 - 10/100 = 60/100 = 3/5 21 Probabilistic reasoning • … is determining which of 2 events is more likely • The Monty Hall 3-door puzzle is an example of such reasoning: – select one of 3 doors, one of which has the GRAND PRIZE!!!!! behind it – once selection is made, Monty opens one of the other doors (knowing it is a loser) – then he gives you the option to switch doors -should you? 22 Solution to Monty Hall 3-door puzzle • Initial probability of selecting the grand prize door is 1/3 • Monty always opens a door the prize is NOT behind • The probability you selected incorrectly is 2/3 (since you only had a 1/3 chance of a correct selection) 23 Solution to Monty Hall 3-door puzzle • If you selected incorrectly, when Monty selects another door (without prize), the prize must be behind the remaining door • You will always win if you chose wrong the first time, then switch • So by changing doors, you probability of winning is 2/3 • Always change doors! 24 Section 4.4 Discrete Probability - ends - 25