Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Introduction to Discrete Probability Rosen, section 5.1 CS/APMA 202 Aaron Bloomfield.

Similar presentations


Presentation on theme: "1 Introduction to Discrete Probability Rosen, section 5.1 CS/APMA 202 Aaron Bloomfield."— Presentation transcript:

1 1 Introduction to Discrete Probability Rosen, section 5.1 CS/APMA 202 Aaron Bloomfield

2 2 Terminology Experiment A repeatable procedure that yields one of a given set of outcomes A repeatable procedure that yields one of a given set of outcomes Rolling a die, for example Rolling a die, for example Sample space The range of outcomes possible The range of outcomes possible For a die, that would be values 1 to 6 For a die, that would be values 1 to 6Event One of the sample outcomes that occurred One of the sample outcomes that occurred If you rolled a 4 on the die, the event is the 4 If you rolled a 4 on the die, the event is the 4

3 3 Probability definition The probability of an event occurring is: Where E is the set of desired events (outcomes) Where E is the set of desired events (outcomes) Where S is the set of all possible events (outcomes) Where S is the set of all possible events (outcomes) Note that 0 ≤ |E| ≤ |S| Note that 0 ≤ |E| ≤ |S| Thus, the probability will always between 0 and 1 An event that will never happen has probability 0 An event that will always happen has probability 1

4 4 Dice probability What is the probability of getting “snake-eyes” (two 1’s) on two six-sided dice? Probability of getting a 1 on a 6-sided die is 1/6 Probability of getting a 1 on a 6-sided die is 1/6 Via product rule, probability of getting two 1’s is the probability of getting a 1 AND the probability of getting a second 1 Via product rule, probability of getting two 1’s is the probability of getting a 1 AND the probability of getting a second 1 Thus, it’s 1/6 * 1/6 = 1/36 Thus, it’s 1/6 * 1/6 = 1/36 What is the probability of getting a 7 by rolling two dice? There are six combinations that can yield 7: (1,6), (2,5), (3,4), (4,3), (5,2), (6,1) There are six combinations that can yield 7: (1,6), (2,5), (3,4), (4,3), (5,2), (6,1) Thus, |E| = 6, |S| = 36, P(E) = 6/36 = 1/6 Thus, |E| = 6, |S| = 36, P(E) = 6/36 = 1/6

5 5 Poker

6 6 The game of poker You are given 5 cards (this is 5-card stud poker) The goal is to obtain the best hand you can The possible poker hands are (in increasing order): No pair No pair One pair (two cards of the same face) One pair (two cards of the same face) Two pair (two sets of two cards of the same face) Two pair (two sets of two cards of the same face) Three of a kind (three cards of the same face) Three of a kind (three cards of the same face) Straight (all five cards sequentially – ace is either high or low) Straight (all five cards sequentially – ace is either high or low) Flush (all five cards of the same suit) Flush (all five cards of the same suit) Full house (a three of a kind of one face and a pair of another face) Full house (a three of a kind of one face and a pair of another face) Four of a kind (four cards of the same face) Four of a kind (four cards of the same face) Straight flush (both a straight and a flush) Straight flush (both a straight and a flush) Royal flush (a straight flush that is 10, J, K, Q, A) Royal flush (a straight flush that is 10, J, K, Q, A)

7 7 Poker probability: royal flush What is the chance of getting a royal flush? That’s the cards 10, J, Q, K, and A of the same suit That’s the cards 10, J, Q, K, and A of the same suit There are only 4 possible royal flushes Possibilities for 5 cards: C(52,5) = 2,598,960 Probability = 4/2,598,960 = 0.0000015 Or about 1 in 650,000 Or about 1 in 650,000

8 8 Poker probability: four of a kind What is the chance of getting 4 of a kind when dealt 5 cards? Possibilities for 5 cards: C(52,5) = 2,598,960 Possibilities for 5 cards: C(52,5) = 2,598,960 Possible hands that have four of a kind: There are 13 possible four of a kind hands There are 13 possible four of a kind hands The fifth card can be any of the remaining 48 cards The fifth card can be any of the remaining 48 cards Thus, total possibilities is 13*48 = 624 Thus, total possibilities is 13*48 = 624 Probability = 624/2,598,960 = 0.00024 Or 1 in 4165 Or 1 in 4165

9 9 Poker probability: flush What is the chance of getting a flush? That’s all 5 cards of the same suit That’s all 5 cards of the same suit We must do ALL of the following: Pick the suit for the flush: C(4,1) Pick the suit for the flush: C(4,1) Pick the 5 cards in that suit: C(13,5) Pick the 5 cards in that suit: C(13,5) As we must do all of these, we multiply the values out (via the product rule) This yields Possibilities for 5 cards: C(52,5) = 2,598,960 Probability = 5148/2,598,960 = 0.00198 Or about 1 in 505 Or about 1 in 505

10 10 Poker probability: full house What is the chance of getting a full house? That’s three cards of one face and two of another face That’s three cards of one face and two of another face We must do ALL of the following: Pick the face for the three of a kind: C(13,1) Pick the face for the three of a kind: C(13,1) Pick the 3 of the 4 cards to be used: C(4,3) Pick the 3 of the 4 cards to be used: C(4,3) Pick the face for the pair: C(12,1) Pick the face for the pair: C(12,1) Pick the 2 of the 4 cards of the pair: C(4,2) Pick the 2 of the 4 cards of the pair: C(4,2) As we must do all of these, we multiply the values out (via the product rule) This yields Possibilities for 5 cards: C(52,5) = 2,598,960 Probability = 3744/2,598,960 = 0.00144 Or about 1 in 694 Or about 1 in 694

11 11 Inclusion-exclusion principle The possible poker hands are (in increasing order): Nothing Nothing One paircannot include two pair, three of a kind, four of a kind, or full house One paircannot include two pair, three of a kind, four of a kind, or full house Two paircannot include three of a kind, four of a kind, or full house Two paircannot include three of a kind, four of a kind, or full house Three of a kindcannot include four of a kind or full house Three of a kindcannot include four of a kind or full house Straightcannot include straight flush or royal flush Straightcannot include straight flush or royal flush Flushcannot include straight flush or royal flush Flushcannot include straight flush or royal flush Full house Full house Four of a kind Four of a kind Straight flushcannot include royal flush Straight flushcannot include royal flush Royal flush Royal flush

12 12 Poker probability: three of a kind What is the chance of getting a three of a kind? That’s three cards of one face That’s three cards of one face Can’t include a full house or four of a kind Can’t include a full house or four of a kind We must do ALL of the following: Pick the face for the three of a kind: C(13,1) Pick the face for the three of a kind: C(13,1) Pick the 3 of the 4 cards to be used: C(4,3) Pick the 3 of the 4 cards to be used: C(4,3) Pick the two other cards’ face values: C(12,2) Pick the two other cards’ face values: C(12,2) We can’t pick two cards of the same face! Pick the suits for the two other cards: C(4,1)*C(4,1) Pick the suits for the two other cards: C(4,1)*C(4,1) As we must do all of these, we multiply the values out (via the product rule) This yields Possibilities for 5 cards: C(52,5) = 2,598,960 Probability = 54,912/2,598,960 = 0.0211 Or about 1 in 47 Or about 1 in 47

13 13 Poker hand odds The possible poker hands are (in increasing order): Nothing1,302,5400.5012 Nothing1,302,5400.5012 One pair1,098,2400.4226 One pair1,098,2400.4226 Two pair123,5520.0475 Two pair123,5520.0475 Three of a kind54,9120.0211 Three of a kind54,9120.0211 Straight10,2000.00392 Straight10,2000.00392 Flush5,1400.00197 Flush5,1400.00197 Full house3,7440.00144 Full house3,7440.00144 Four of a kind6240.000240 Four of a kind6240.000240 Straight flush360.0000139 Straight flush360.0000139 Royal flush40.00000154 Royal flush40.00000154

14 14 A solution to commenting your code The commentator: http://www.cenqua.com/commentator/ The commentator: http://www.cenqua.com/commentator/ http://www.cenqua.com/commentator/

15 15 End of lecture on 12 April 2005

16 16 Back to theory again

17 17 More on probabilities Let E be an event in a sample space S. The probability of the complement of E is: The book calls this Theorem 1 The book calls this Theorem 1 Recall the probability for getting a royal flush is 0.0000015 The probability of not getting a royal flush is 1-0.0000015 or 0.9999985 The probability of not getting a royal flush is 1-0.0000015 or 0.9999985 Recall the probability for getting a four of a kind is 0.00024 The probability of not getting a four of a kind is 1-0.00024 or 0.99976 The probability of not getting a four of a kind is 1-0.00024 or 0.99976

18 18 Probability of the union of two events Let E 1 and E 2 be events in sample space S Then p(E 1 U E 2 ) = p(E 1 ) + p(E 2 ) – p(E 1 ∩ E 2 ) Consider a Venn diagram dart-board

19 19 Probability of the union of two events S E1E1 E2E2 p(E1 U E2)

20 20 Probability of the union of two events If you choose a number between 1 and 100, what is the probability that it is divisible by 2 or 5 or both? Let n be the number chosen p(2|n) = 50/100 (all the even numbers) p(2|n) = 50/100 (all the even numbers) p(5|n) = 20/100 p(5|n) = 20/100 p(2|n) and p(5|n) = p(10|n) = 10/100 p(2|n) and p(5|n) = p(10|n) = 10/100 p(2|n) or p(5|n) = p(2|n) + p(5|n) - p(10|n) p(2|n) or p(5|n) = p(2|n) + p(5|n) - p(10|n) = 50/100 + 20/100 – 10/100 = 50/100 + 20/100 – 10/100 = 3/5 = 3/5

21 21 When is gambling worth it? This is a statistical analysis, not a moral/ethical discussion What if you gamble $1, and have a ½ probability to win $10? If you play 100 times, you will win (on average) 50 of those times If you play 100 times, you will win (on average) 50 of those times Each play costs $1, each win yields $10 For $100 spent, you win (on average) $500 Average win is $5 (or $10 * ½) per play for every $1 spent Average win is $5 (or $10 * ½) per play for every $1 spent What if you gamble $1 and have a 1/100 probability to win $10? If you play 100 times, you will win (on average) 1 of those times If you play 100 times, you will win (on average) 1 of those times Each play costs $1, each win yields $10 For $100 spent, you win (on average) $10 Average win is $0.10 (or $10 * 1/100) for every $1 spent Average win is $0.10 (or $10 * 1/100) for every $1 spent One way to determine if gambling is worth it: probability of winning * payout ≥ amount spent probability of winning * payout ≥ amount spent Or p(winning) * payout ≥ investment Or p(winning) * payout ≥ investment Of course, this is a statistical measure Of course, this is a statistical measure

22 22 When is lotto worth it? Many lotto games you have to choose 6 numbers from 1 to 48 Total possible choices is C(48,6) = 12,271,512 Total possible choices is C(48,6) = 12,271,512 Total possible winning numbers is C(6,6) = 1 Total possible winning numbers is C(6,6) = 1 Probability of winning is 0.0000000814 Probability of winning is 0.0000000814 Or 1 in 12.3 million If you invest $1 per ticket, it is only statistically worth it if the payout is > $12.3 million As, on the “average” you will only make money that way As, on the “average” you will only make money that way Of course, “average” will require trillions of lotto plays… Of course, “average” will require trillions of lotto plays…

23 23 This may be a bit disturbing… Lots of piercings…

24 24 Blackjack

25 25 Blackjack You are initially dealt two cards 10, J, Q and K all count as 10 10, J, Q and K all count as 10 Ace is EITHER 1 or 11 (player’s choice) Ace is EITHER 1 or 11 (player’s choice) You can opt to receive more cards (a “hit”) You want to get as close to 21 as you can If you go over, you lose (a “bust”) If you go over, you lose (a “bust”) You play against the house If the house has a higher score than you, then you lose If the house has a higher score than you, then you lose

26 26 Blackjack table

27 27 Blackjack probabilities Getting 21 on the first two cards is called a blackjack Or a “natural 21” Or a “natural 21” Assume there is only 1 deck of cards Possible blackjack blackjack hands: First card is an A, second card is a 10, J, Q, or K First card is an A, second card is a 10, J, Q, or K 4/52 for Ace, 16/51 for the ten card = (4*16)/(52*51) = 0.0241 (or about 1 in 41) First card is a 10, J, Q, or K; second card is an A First card is a 10, J, Q, or K; second card is an A 16/52 for the ten card, 4/51 for Ace = (16*4)/(52*51) = 0.0241 (or about 1 in 41) Total chance of getting a blackjack is the sum of the two: p = 0.0483, or about 1 in 21 p = 0.0483, or about 1 in 21 How appropriate! How appropriate! More specifically, it’s 1 in 20.72 More specifically, it’s 1 in 20.72

28 28 Blackjack probabilities Another way to get 20.72 There are C(52,2) = 1,326 possible initial blackjack hands Possible blackjack blackjack hands: Pick your Ace: C(4,1) Pick your Ace: C(4,1) Pick your 10 card: C(16,1) Pick your 10 card: C(16,1) Total possibilities is the product of the two (64) Total possibilities is the product of the two (64) Probability is 64/1,326 = 20.72

29 29 Blackjack probabilities Getting 21 on the first two cards is called a blackjack Assume there is an infinite deck of cards So many that the probably of getting a given card is not affected by any cards on the table So many that the probably of getting a given card is not affected by any cards on the table Possible blackjack blackjack hands: First card is an A, second card is a 10, J, Q, or K First card is an A, second card is a 10, J, Q, or K 4/52 for Ace, 16/52 for second part = (4*16)/(52*52) = 0.0236 (or about 1 in 42) First card is a 10, J, Q, or K; second card is an A First card is a 10, J, Q, or K; second card is an A 16/52 for first part, 4/52 for Ace = (16*4)/(52*52) = 0.0236 (or about 1 in 42) Total chance of getting a blackjack is the sum: p = 0.0473, or about 1 in 21 p = 0.0473, or about 1 in 21 More specifically, it’s 1 in 21.13 (vs. 20.72) More specifically, it’s 1 in 21.13 (vs. 20.72) In reality, most casinos use “shoes” of 6-8 decks for this reason It slightly lowers the player’s chances of getting a blackjack It slightly lowers the player’s chances of getting a blackjack And prevents people from counting the cards… And prevents people from counting the cards…

30 30 So always use a single deck, right? Most people think that a single-deck blackjack table is better, as the player’s odds increase And you can try to count the cards And you can try to count the cards But it’s usually not the case! Normal rules have a 3:2 payout for a blackjack If you bet $100, you get your $100 back plus 3/2 * $100, or $150 additional If you bet $100, you get your $100 back plus 3/2 * $100, or $150 additional Most single-deck tables have a 6:5 payout You get your $100 back plus 6/5 * $100 or $120 additional You get your $100 back plus 6/5 * $100 or $120 additional This lowered benefit of being able to count the cards OUTWEIGHS the benefit of the single deck! This lowered benefit of being able to count the cards OUTWEIGHS the benefit of the single deck! And thus the benefit of counting the cards You cannot win money on a 6:5 blackjack table that uses 1 deck You cannot win money on a 6:5 blackjack table that uses 1 deck Remember, the house always wins Remember, the house always wins

31 31 Blackjack probabilities: when to hold House usually holds on a 17 What is the chance of a bust if you draw on a 17? 16? 15? What is the chance of a bust if you draw on a 17? 16? 15? Assume all cards have equal probability Bust on a draw on a 18 4 or above will bust: that’s 10 (of 13) cards that will bust 4 or above will bust: that’s 10 (of 13) cards that will bust 10/13 = 0.769 probability to bust 10/13 = 0.769 probability to bust Bust on a draw on a 17 5 or above will bust: 9/13 = 0.692 probability to bust 5 or above will bust: 9/13 = 0.692 probability to bust Bust on a draw on a 16 6 or above will bust: 8/13 = 0.615 probability to bust 6 or above will bust: 8/13 = 0.615 probability to bust Bust on a draw on a 15 7 or above will bust: 7/13 = 0.538 probability to bust 7 or above will bust: 7/13 = 0.538 probability to bust Bust on a draw on a 14 8 or above will bust: 6/13 = 0.462 probability to bust 8 or above will bust: 6/13 = 0.462 probability to bust

32 32 Buying (blackjack) insurance If the dealer’s visible card is an Ace, the player can buy insurance against the dealer having a blackjack There are then two bets going: the original bet and the insurance bet There are then two bets going: the original bet and the insurance bet If the dealer has blackjack, you lose your original bet, but your insurance bet pays 2-to-1 If the dealer has blackjack, you lose your original bet, but your insurance bet pays 2-to-1 So you get twice what you paid in insurance back Note that if the player also has a blackjack, it’s a “push” If the dealer does not have blackjack, you lose your insurance bet, but your original bet proceeds normal If the dealer does not have blackjack, you lose your insurance bet, but your original bet proceeds normal Is this insurance worth it?

33 33 Buying (blackjack) insurance If the dealer shows an Ace, there is a 4/13 = 0.308 probability that they have a blackjack Assuming an infinite deck of cards Assuming an infinite deck of cards Any one of the “10” cards will cause a blackjack Any one of the “10” cards will cause a blackjack If you bought insurance 1,000 times, it would be used 308 (on average) of those times Let’s say you paid $1 each time for the insurance Let’s say you paid $1 each time for the insurance The payout on each is 2-to-1, thus you get $2 back when you use your insurance Thus, you get 2*308 = $616 back for your $1,000 spent Thus, you get 2*308 = $616 back for your $1,000 spent Or, using the formula p(winning) * payout ≥ investment 0.308 * $2 ≥ $1 0.308 * $2 ≥ $1 0.616 ≥ $1 0.616 ≥ $1 Thus, it’s not worth it Thus, it’s not worth it Buying insurance is considered a very poor option for the player Hence, almost every casino offers it Hence, almost every casino offers it

34 34 Blackjack strategy These tables tell you the best move to do on each hand The odds are still (slightly) in the house’s favor The house always wins…

35 35 Why counting cards doesn’t work well… If you make two or three mistakes an hour, you lose any advantage And, in fact, cause a disadvantage! And, in fact, cause a disadvantage! You lose lots of money learning to count cards Then, once you can do so, you are banned from the casinos

36 36 This wheel is spun if: You get a natural blackjack You get a natural blackjack You place $1 on the “spin the wheel” square You place $1 on the “spin the wheel” square You lose the dollar either way You lose the dollar either way You win the amount shown on the wheel As seen in a casino

37 37 Is it worth it to place $1 on the square? The amounts on the wheel are: 30, 1000, 11, 20, 16, 40, 15, 10, 50, 12, 25, 14 30, 1000, 11, 20, 16, 40, 15, 10, 50, 12, 25, 14 Average is $103.58 Average is $103.58 Chance of a natural blackjack: p = 0.0473, or 1 in 21.13 p = 0.0473, or 1 in 21.13 So use the formula: p(winning) * payout ≥ investment p(winning) * payout ≥ investment 0.0473 * $103.58 ≥ $1 0.0473 * $103.58 ≥ $1 $4.90 ≥ $1 $4.90 ≥ $1 But the house always wins! So what happened? But the house always wins! So what happened?

38 38 Note that not all amounts have an equal chance of winning There are 2 spots to win $15 There are 2 spots to win $15 There is ONE spot to win $1,000 There is ONE spot to win $1,000 Etc. Etc. As seen in a casino

39 39 Back to the drawing board If you weight each “spot” by the amount it can win, you get $1609 for 30 “spots” That’s an average of $53.63 per spot That’s an average of $53.63 per spot So use the formula: p(winning) * payout ≥ investment p(winning) * payout ≥ investment 0.0473 * $53.63 ≥ $1 0.0473 * $53.63 ≥ $1 $2.54 ≥ $1 $2.54 ≥ $1 Still not there yet… Still not there yet…

40 40 My theory I think the wheel is weighted so the $1,000 side of the wheel is heavy and thus won’t be chosen As the “chooser” is at the top As the “chooser” is at the top But I never saw it spin, so I can’t say for sure But I never saw it spin, so I can’t say for sure Take the $1,000 out of the 30 spot discussion of the last slide That leaves $609 for 29 spots That leaves $609 for 29 spots Or $21.00 per spot Or $21.00 per spot So use the formula: p(winning) * payout ≥ investment p(winning) * payout ≥ investment 0.0473 * $21 ≥ $1 0.0473 * $21 ≥ $1 $0.9933 ≥ $1 $0.9933 ≥ $1 And I’m probably still missing something here… Remember that the house always wins!

41 41 Quick survey I felt I understood Blackjack probability… I felt I understood Blackjack probability… a) Very well b) With some review, I’ll be good c) Not really d) Not at all

42 42 Quick survey If I was going to spend money gambling, would I choose Blackjack? If I was going to spend money gambling, would I choose Blackjack? a) Definitely – a way to make money b) Perhaps c) Probably not d) Definitely not – it’s a way to lose money

43 43 Today’s dose of demotivators

44 44 Roulette

45 45 Roulette A wheel with 38 spots is spun Spots are numbered 1-36, 0, and 00 Spots are numbered 1-36, 0, and 00 European casinos don’t have the 00 European casinos don’t have the 00 A ball drops into one of the 38 spots A bet is placed as to which spot or spots the ball will fall into Money is then paid out if the ball lands in the spot(s) you bet upon Money is then paid out if the ball lands in the spot(s) you bet upon

46 46 The Roulette table

47 47 The Roulette table Bets can be placed on: A single number A single number Two numbers Two numbers Four numbers Four numbers All even numbers All even numbers All odd numbers All odd numbers The first 18 nums The first 18 nums Red numbers Red numbersProbability:1/382/384/3818/3818/3818/3818/38

48 48 The Roulette table Bets can be placed on: A single number A single number Two numbers Two numbers Four numbers Four numbers All even numbers All even numbers All odd numbers All odd numbers The first 18 nums The first 18 nums Red numbers Red numbersProbability:1/382/384/3818/3818/3818/3818/38Payout: 36x 18x 9x 2x

49 49 Roulette It has been proven that proven that no advantageous strategies exist Including: Learning the wheel’s biases Learning the wheel’s biases Casino’s regularly balance their Roulette wheels Martingale betting strategy Martingale betting strategy Where you double your bet each time (thus making up for all previous losses) It still won’t work! You can’t double your money forever It could easily take 50 times to achieve finally win It could easily take 50 times to achieve finally win If you start with $1, then you must put in $1*2 50 = $1,125,899,906,842,624 to win this way! If you start with $1, then you must put in $1*2 50 = $1,125,899,906,842,624 to win this way! That’s 1 quadrillion That’s 1 quadrillion See http://en.wikipedia.org/wiki/Martingale_(roulette_system) for more info

50 50 Quick survey I felt I understood Roulette probability… I felt I understood Roulette probability… a) Very well b) With some review, I’ll be good c) Not really d) Not at all

51 51 Quick survey If I was going to spend money gambling, would I choose Roulette? If I was going to spend money gambling, would I choose Roulette? a) Definitely – a way to make money b) Perhaps c) Probably not d) Definitely not – it’s a way to lose money

52 52 Monty Hall Paradox

53 53 What’s behind door number three? The Monty Hall problem paradox Consider a game show where a prize (a car) is behind one of three doors Consider a game show where a prize (a car) is behind one of three doors The other two doors do not have prizes (goats instead) The other two doors do not have prizes (goats instead) After picking one of the doors, the host (Monty Hall) opens a different door to show you that the door he opened is not the prize After picking one of the doors, the host (Monty Hall) opens a different door to show you that the door he opened is not the prize Do you change your decision? Do you change your decision? Your initial probability to win (i.e. pick the right door) is 1/3 What is your chance of winning if you change your choice after Monty opens a wrong door? After Monty opens a wrong door, if you change your choice, your chance of winning is 2/3 Thus, your chance of winning doubles if you change Thus, your chance of winning doubles if you change Huh? Huh?

54 54 End of lecture on 14 April 2005  Although I want to start 1 slide back

55 55 Dealing cards Consider a dealt hand of cards Assume they have not been seen yet Assume they have not been seen yet What is the chance of drawing a flush? What is the chance of drawing a flush? Does that chance change if I speak words after the experiment has completed? Does that chance change if I speak words after the experiment has completed? Does that chance change if I tell you more info about what’s in the deck? Does that chance change if I tell you more info about what’s in the deck?No! Words spoken after an experiment has completed do not change the chance of an event happening by that experiment Words spoken after an experiment has completed do not change the chance of an event happening by that experiment No matter what is said

56 56 What’s behind door number one hundred? Consider 100 doors You choose one You choose one Monty opens 98 wrong doors Monty opens 98 wrong doors Do you switch? Do you switch? Your initial chance of being right is 1/100 Right before your switch, your chance of being right is still 1/100 Just because you know more info about the other doors doesn’t change your chances Just because you know more info about the other doors doesn’t change your chances You didn’t know this info beforehand! Your final chance of being right is 99/100 if you switch You have two choices: your original door and the new door You have two choices: your original door and the new door The original door still has 1/100 chance of being right The original door still has 1/100 chance of being right Thus, the new door has 99/100 chance of being right Thus, the new door has 99/100 chance of being right The 98 doors that were opened were not chosen at random! The 98 doors that were opened were not chosen at random! Monty Hall knows which door the car is behind Reference: http://en.wikipedia.org/wiki/Monty_Hall_problem

57 57 A bit more theory

58 58 An aside: probability of multiple events Assume you have a 5/6 chance for an event to happen Rolling a 1-5 on a die, for example Rolling a 1-5 on a die, for example What’s the chance of that event happening twice in a row? Cases: Event happening neither time: 1/6 * 1/6 = 1/36 Event happening neither time: 1/6 * 1/6 = 1/36 Event happening first time: 1/6 * 5/6 = 5/36 Event happening first time: 1/6 * 5/6 = 5/36 Event happening second time: 5/6 * 1/6 = 5/36 Event happening second time: 5/6 * 1/6 = 5/36 Event happening both times: 5/6 * 5/6 = 25/36 Event happening both times: 5/6 * 5/6 = 25/36 For an event to happen twice, the probability is the product of the individual probabilities

59 59 An aside: probability of multiple events Assume you have a 5/6 chance for an event to happen Rolling a 1-5 on a die, for example Rolling a 1-5 on a die, for example What’s the chance of that event happening at least once? Cases: Event happening neither time: 1/6 * 1/6 = 1/36 Event happening neither time: 1/6 * 1/6 = 1/36 Event happening first time: 1/6 * 5/6 = 5/36 Event happening first time: 1/6 * 5/6 = 5/36 Event happening second time: 5/6 * 1/6 = 5/36 Event happening second time: 5/6 * 1/6 = 5/36 Event happening both times: 5/6 * 5/6 = 25/36 Event happening both times: 5/6 * 5/6 = 25/36 It’s 35/36! For an event to happen at least once, it’s 1 minus the probability of it never happening Or 1 minus the compliment of it never happening

60 60 Probability vs. odds Consider an event that has a 1 in 3 chance of happening Probability is 0.333 Which is a 1 in 3 chance Or 2:1 odds Meaning if you play it 3 (2+1) times, you will lose 2 times for every 1 time you win Meaning if you play it 3 (2+1) times, you will lose 2 times for every 1 time you win This, if you have x:y odds, you probability is y/(x+y) The y is usually 1, and the x is scaled appropriately The y is usually 1, and the x is scaled appropriately For example 2.2:1 For example 2.2:1 That probability is 1/(1+2.2) = 1/3.2 = 0.313 1:1 odds means that you will lose as many times as you win I think I presented this wrong last time… I think I presented this wrong last time…

61 61 More demotivators

62 62 Texas Hold’em Reference:http://teamfu.freeshell.org/poker_odds.html

63 63 Texas Hold’em The most popular poker variant today Every player starts with two face down cards Called “hole” or “pocket” cards Called “hole” or “pocket” cards Hence the term “ace in the hole” Hence the term “ace in the hole” Five cards are placed in the center of the table These are common cards, shared by every player These are common cards, shared by every player Initially they are placed face down Initially they are placed face down The first 3 cards are then turned face up, then the fourth card, then the fifth card The first 3 cards are then turned face up, then the fourth card, then the fifth card You can bet between the card turns You can bet between the card turns You try to make the best 5-card hand of the seven cards available to you Your two hole cards and the 5 common cards Your two hole cards and the 5 common cards

64 64 Texas Hold’em Hand progression Note that anybody can fold at any time Note that anybody can fold at any time Cards are dealt: 2 “hole” cards per player Cards are dealt: 2 “hole” cards per player 5 community cards are dealt face down (how this is done varies) 5 community cards are dealt face down (how this is done varies) Bets are placed based on your pocket cards Bets are placed based on your pocket cards The first three community cards are turned over (or dealt) The first three community cards are turned over (or dealt) Called the “flop” Bets are placed Bets are placed The next community card is turned over (or dealt) The next community card is turned over (or dealt) Called the “turn” Bets are placed Bets are placed The last community card is turned over (or dealt) The last community card is turned over (or dealt) Called the “river” Bets are placed Bets are placed Hands are then shown to determine who wins the pot Hands are then shown to determine who wins the pot

65 65 Texas Hold’em terminology Pocket: your two face-down cards Pocket pair: when you have a pair in your pocket Flop: when the initial 3 community cards are shown Turn: when the 4 th community card is shown River: when the 5 th community card is shown Nuts (or nut hand): the best possible hand that you can hope for with the cards you have and the not-yet-shown cards Outs: the number of cards you need to achieve your nut hand Pot: the money in the center that is being bet upon Fold: when you stop betting on the current hand Call: when you match the current bet

66 66 Odds of a Texas Hold’em hand Pick any poker hand We’ll choose a royal flush We’ll choose a royal flush There are 4/2,598,960 possibilities There are 4/2,598,960 possibilities Chance of getting that in a Texas Hold’em game: Choose your royal flush: C(4,1) Choose your royal flush: C(4,1) Choose the remaining two cards: C(47,2) Choose the remaining two cards: C(47,2) Result is 4324 possibilities Or 1 in 601 Or 1 in 601 Or probability of 0.0017 Or probability of 0.0017 Well, not really, but close enough for this slide set… Well, not really, but close enough for this slide set… This is much more common than 1 in 649,740 for stud poker! This is much more common than 1 in 649,740 for stud poker! But nobody does Texas Hold’em probability that way, though…

67 67 An example of a hand using Texas Hold’em terminology Your pocket hand is J♥, 4♥ The flop shows 2♥, 7♥, K♣ There are two cards still to be revealed (the turn and the river) Your nut hand is going to be a flush As that’s the best hand you can (realistically) hope for with the cards you have As that’s the best hand you can (realistically) hope for with the cards you have There are 9 cards that will allow you to achieve your flush Any other heart Any other heart Thus, you have 9 outs Thus, you have 9 outs

68 68 Continuing with that example There are 47 unknown cards The two unturned cards, the other player’s cards, and the rest of the deck The two unturned cards, the other player’s cards, and the rest of the deck There are 9 outs (the other 9 hearts) What’s the chance you will get your flush? Rephrased: what’s the chance that you will get an out on at least one of the remaining cards? Rephrased: what’s the chance that you will get an out on at least one of the remaining cards? For an event to happen at least once, it’s 1 minus the probability of it never happening For an event to happen at least once, it’s 1 minus the probability of it never happening Chances: Chances: Out on neither turn nor river 38/47 * 37/46= 0.65 Out on turn only 9/47 * 38/46= 0.16 Out on river only 38/47 * 9/46= 0.16 Out on both turn and river 9/47 * 8/46= 0.03 All the chances add up to 1, as expected All the chances add up to 1, as expected Chance of getting at least 1 out is 1 minus the chance of not getting any outs Chance of getting at least 1 out is 1 minus the chance of not getting any outs Or 1-0.65 = 0.35 Or 1 in 2.9 Or 1.9:1

69 69 Continuing with that example What if you miss your out on the turn Then what is the chance you will hit the out on the river? There are 46 unknown cards The two unturned cards, the other player’s cards, and the rest of the deck The two unturned cards, the other player’s cards, and the rest of the deck There are still 9 outs (the other 9 hearts) What’s the chance you will get your flush? 9/46 = 0.20 9/46 = 0.20 Or 1 in 5.1 Or 1 in 5.1 Or 4.1:1 Or 4.1:1 The odds have significantly decreased! The odds have significantly decreased! These odds are called the hand odds I.e. the chance that you will get your nut hand I.e. the chance that you will get your nut hand

70 70 Hand odds vs. pot odds So far we’ve seen the odds of getting a given hand Assume that you are playing with only one other person If you win the pot, you get a payout of two times what you invested As you each put in half the pot As you each put in half the pot This is called the pot odds This is called the pot odds Well, almost – we’ll see more about pot odds in a bit After the flop, assume that the pot has $20, the bet is $10, and thus the call is $10 Payout (if you match the bet and then win) is $40 Payout (if you match the bet and then win) is $40 Your investment is $10 Your investment is $10 Your pot odds are 30:10 (not 40:10, as your call is not considered as part of the odds) Your pot odds are 30:10 (not 40:10, as your call is not considered as part of the odds) Or 3:1 When is it worth it to continue? What if you have 3:1 hand odds (0.25 probability)? What if you have 3:1 hand odds (0.25 probability)? What if you have 2:1 hand odds (0.33 probability)? What if you have 2:1 hand odds (0.33 probability)? What if you have 1:1 hand odds (0.50 probability)? What if you have 1:1 hand odds (0.50 probability)? Note that we did not consider the probabilities before the flop

71 71 Hand odds vs. pot odds Pot payout is $40, investment is $10 Use the formula: p(winning) * payout ≥ investment When is it worth it to continue? We are assuming that your nut hand will win We are assuming that your nut hand will win A safe assumption for a flush, but not a tautology! What if you have 3:1 hand odds (0.25 probability)? What if you have 3:1 hand odds (0.25 probability)? 0.25 * $40 ≥ $10 $10 = $10 If you pursue this hand, you will make as much as you lose What if you have 2:1 hand odds (0.33 probability)? What if you have 2:1 hand odds (0.33 probability)? 0.33 * $40 ≥ $10 $13.33 > $10 Definitely worth it to continue! What if you have 1:1 hand odds (0.50 probability)? What if you have 1:1 hand odds (0.50 probability)? 0.5 * $40 ≥ $10 $20 > $10 Definitely worth it to continue!

72 72 Pot odds Pot odds is the ratio of the amount in the pot to the amount you have to call In other words, we don’t consider any previously invested money Only the current amount in the pot and the current amount of the call Only the current amount in the pot and the current amount of the call The reason is that you are considering each bet as it is placed, not considering all of your (past and present) bets together The reason is that you are considering each bet as it is placed, not considering all of your (past and present) bets together If you considered all the amounts invested, you must then consider the probabilities at each point that you invested money If you considered all the amounts invested, you must then consider the probabilities at each point that you invested money Instead, we just take a look at each investment individually Instead, we just take a look at each investment individually Technically, these are mathematically equal, but the latter is much easier (and thus more realistic to do in a game) Technically, these are mathematically equal, but the latter is much easier (and thus more realistic to do in a game) In the last example, the pot odds were 3:1 As there was $30 in the pot, and the call was $10 As there was $30 in the pot, and the call was $10 Even though you invested some money previously

73 73 Another take on pot odds Assume the pot is $100, and the call is $10 Thus, the pot odds are 100:10 or 10:1 Thus, the pot odds are 100:10 or 10:1 You invest $10, and get $110 if you win You invest $10, and get $110 if you win Thus, you have to win 1 out of 11 times to break even Thus, you have to win 1 out of 11 times to break even Or have odds of 10:1 Or have odds of 10:1 If you have better odds, you’ll make money in the long run If you have better odds, you’ll make money in the long run If you have worse odds, you’ll lose money in the long run If you have worse odds, you’ll lose money in the long run

74 74 Hand odds vs. pot odds Pot is now $20, investment is $10 Pot odds are thus 2:1 Pot odds are thus 2:1 Use the formula: p(winning) * payout ≥ investment When is it worth it to continue? What if you have 3:1 hand odds (0.25 probability)? What if you have 3:1 hand odds (0.25 probability)? 0.25 * $30 ≥ $10 $7.50 < $10 What if you have 2:1 hand odds (0.33 probability)? What if you have 2:1 hand odds (0.33 probability)? 0.33 * $30 ≥ $10 $10 = $10 If you pursue this hand, you will make as much as you lose What if you have 1:1 hand odds (0.50 probability)? What if you have 1:1 hand odds (0.50 probability)? 0.5 * $30 ≥ $10 $15 > $10 The only time it is worth it to continue is when the pot odds outweigh the hand odds Meaning the first part of the pot odds is greater than the first part of the hand odds Meaning the first part of the pot odds is greater than the first part of the hand odds If you do not follow this rule, you will lose money in the long run If you do not follow this rule, you will lose money in the long run

75 75 Computing hand odds vs. pot odds Consider the following hand progression: Your hand: almost a flush (4 out of 5 cards of one suit) Called a “flush draw” Called a “flush draw” Perhaps because one more draw can make it a flush On the flop: $5 pot, $10 bet and a $10 call Your call: match the bet or fold? Your call: match the bet or fold? Pot odds: 1.5:1 Pot odds: 1.5:1 Hand odds: 1.9:1 (or 0.35) Hand odds: 1.9:1 (or 0.35) The pot odds do not outweigh the hand odds, so do not continue The pot odds do not outweigh the hand odds, so do not continue

76 76 Computing hand odds vs. pot odds Consider the following hand progression: Your hand: almost a flush (4 out of 5 cards of one suit) Called a flush draw Called a flush draw On the flop: now a $30 pot, $10 bet and a $10 call Your call: match the bet or fold? Your call: match the bet or fold? Pot odds: 4:1 Pot odds: 4:1 Hand odds: 1.9:1 (or 0.35) Hand odds: 1.9:1 (or 0.35) The pot odds do outweigh the hand odds, so do continue The pot odds do outweigh the hand odds, so do continue

77 77 Quick survey I felt I understood Texas Hold’em probability… I felt I understood Texas Hold’em probability… a) Very well b) With some review, I’ll be good c) Not really d) Not at all

78 78 Quick survey If I was going to spend money gambling, would I choose Texas Hold’em? If I was going to spend money gambling, would I choose Texas Hold’em? a) Definitely – a way to make money b) Perhaps c) Probably not d) Definitely not – it’s a way to lose money

79 79 For next semester… Other games I should go over?

80 80 Quick survey I felt I understood the material in this slide set… I felt I understood the material in this slide set… a) Very well b) With some review, I’ll be good c) Not really d) Not at all

81 81 Quick survey The pace of the lecture for this slide set was… The pace of the lecture for this slide set was… a) Fast b) About right c) A little slow d) Too slow

82 82 Quick survey How interesting was the material in this slide set? Be honest! How interesting was the material in this slide set? Be honest! a) Wow! That was SOOOOOO cool! b) Somewhat interesting c) Rather borting d) Zzzzzzzzzzz

83 83 Today’s demotivators

84 84 End of lecture on 19 April 2005


Download ppt "1 Introduction to Discrete Probability Rosen, section 5.1 CS/APMA 202 Aaron Bloomfield."

Similar presentations


Ads by Google