1 Using a Deck of Playing Cards to Teach Basic Concepts Related to Statistical Probability and Discrete Distributions Anyone who has ever taught an introductory statistics course knows the challenges in keeping students interested in the subject matter. One area students typically have trouble with is the use of the statistical probability concepts which provide the necessary foundations for the development of the various distributions used in inferential statistics. Many students are turned off by the math involved. Others have difficulty putting probability into a context that they understand. Fortunately there are now a number of tools available that minimize the math. This leaves time for students to focus on understanding the underlying concepts of probability theory and how they are related to the development of statistical distributions. The increased popularity of poker on television and online has created an interest in many students in basic probability theory. Informal polls in my classes suggest that most students have watched some poker on television, and many have played poker online. Additionally, almost all students are familiar with the make-up of a standard deck of playing cards. A deck of cards thus provides a readily available prop that can be used to introduce statistical concepts of probability and to develop basic discrete distributions. Combined with the tools available on a computer, you have what I believe is a fun way to introduce to students what many feel are challenging concepts. This paper discusses a number of exercises that can be used to teach probability concepts and discrete probability distributions. Some of the exercises are related to the standard characteristics of a deck of cards, while others relate to games that can be played with cards. The use of Excel and/or statistical add-ins to Excel to simplify calculations is also discussed. The exercises range from developing the basic rules of probability to the development of discrete probability distributions. It should be noted that there are entire books written on advanced probability theory related to card playing and poker. The goal here is to introduce students to some basic concepts in an entertaining way. All of the exercises below assume the students have been introduced to the characteristics of a standard deck of playing cards: (i.e., 52 cards, 2 through Ace, four suits: clubs, diamonds, hearts, and spades). Exercise 1: Calculating Marginal Probabilities using a “Fair” Deck of Cards What is the probability of drawing the Queen of Hearts? Obviously in a “fair” deck it is 1/52 or 1.9%. Questions such this can be posed to introduce how probabilities are formed. The concepts of marginal probabilities, sample spaces, simple events and experiments are easily introduced at this point. Do probabilities change as you remove cards? Discuss what this means. 2 Exercise 2: It’s not Random A simple random sample is when each item in a sample space has an equally likely chance (same probability) of being selected. Have a student “randomly” select a card. Once they have looked at the card, have them replace the card in the deck. Do not shuffle the deck. Have another student select a card, look at it and replace it in the deck. Do this a number of times. Are the cards being randomly selected? Explain why this process is not random (a random shuffle is necessary after each draw to insure randomness). If random sampling has not been discussed previously in class, methods for selecting random samples can be introduced at this time. I also like to show the students some of the methods online poker websites use to insure a random shuffle. This provides students a better understanding of the importance randomness. Exercise 3: How Fair is Fair? In introducing probability to students, three methods of developing probability are typically discussed: 1) the classical method; 2) relative frequency; and 3) subjective probabilities. The classical method is based on the characteristics or a logical belief about something. For example, if you flip a “fair” coin it has a 50% probability of being Heads. If you roll a “fair” die, there is 1/6 or 16.67% probability of rolling a six. Relative frequency develops probabilities based on repeated outcomes. If you flip a coin 100 times you would expect to get around 50 Heads. Subjective probabilities are based on one’s subjective or “gut” feel about a possible outcome. After introducing these concepts I take out a deck of cards. Based on the classical method, in a “fair” deck of cards there is a 50% chance of getting a red card (13 hearts, 13 diamonds out of 52 cards). Random students are asked to draw a card from the deck. If they get a red card I give them a prize (typically a cookie). The card is then replaced in the deck and the deck is shuffled. What the students don’t know is the deck consists entirely of black cards, so no one can win. (I find it best to pass out the cookies later to the participants). The goal is to see how long it takes for the students to cry foul. It usually takes about five students drawing black cards before someone complains. I point out that statistically it is possible to draw a “long run” of all black cards from a “fair” deck but it is not likely. At this point the concept of joint probability and independence can be introduced and the probability of five black cards in a row, with replacement, can be calculated (.55 = 3.13%). Exercise 4: “Black Jack” A black jack consists of being dealt two cards that sum to 21. These cards consist of an Ace and a card with a value of ten (10, jack, queen, or king). What is the probability of being dealt a black jack from a standard deck of 52 cards, given any hand dealt to other players are face down? 3 This simple exercise is used to illustrate probability rules related to conditional probabilities. The probability of the second card is changed or conditioned upon your first card. The calculation is as follows: P( A | B) Given B = P( A B) P( B) A= ? or P(AB) = P(A | B) x P(B) Conditional Probability where the Jack represents any card with a value of 10: P(AB) = P(A | B) x P(B) = 16/52 x 4/51 = .024 or a 2.4% chance You can now introduce some more challenging questions. What is the probability of drawing three consecutive spades? What is the probability of drawing three Kings. These questions give the students additional practice in calculating conditional probabilities. Exercise 5: It All Adds Up When selecting one card randomly from the deck of cards, what is the probability that it is an Ace or a Black card? Have the students guess to what the probability is. Few get the correct answer intuitively, but by applying the addition law of probability the answer is easily found. P(AB) = P(A) + P(B) – P(AB) King: Black: King and Black: P(K) = 4/52 P(R) = 26/52 P(KB) = 2/52 Addition Law (there are 4 Kings in a deck) (there are 26 black cards in a deck) (there are 2 black Kings in a deck) Therefore: King and Black: P(KB) = P(K) + P(B) – P(KB) = 4/52 + 26/52 - 2/52 = 28/52 = 0.5385 or a 53.85% chance Exercise 6: Independence Two events are independent when the outcome of one doesn’t affect the probability of the other. Illustration of independence with cards requires sampling (drawing from) the deck with replacement. For example, what is the probability of selecting a King and Queen from a complete deck of cards when the first card selected is replaced and the deck is shuffled prior to the second card being selected? Explain why the two selections are independent. The special case of the multipication rule when events are independent can be applied: P(AB) = P(A) P(B) Multiplication Law with Independent Events P(KQ) = P(K) P(Q) = 4/52 x 4/52 = .0059 or a .59% chance 4 Exercise 7: So Many Combinations Understanding combinations is important for the development of many probability distributions. A combination is an arrangement of r items chosen at random from n items where the order of the selected items is not important. The number of possible combinations of r items chosen from n items is: nCr n! r !(n r )! Take all the Kings, Queens and Jacks out of the deck. How many total combinations of two cards can be formed from these twelve cards? This can be determined manually by sorting out and counting the combinations. Now questions such as how many of those combinations have no Queens in them, have one Queen, or have two Queens can be asked. From this a discrete probability distribution of a random variable can be developed. The answers below can be verified by calculating the combinations using the formula above or by using the Excel combination function (=COMBIN(n,r)). Total Combinations Combinations with no Queens Combinations with one Queen Combinations with two Queens 12C2 = 66 C 8 2 = 28 4 x 8 = 32 4C2 = 6 (12 cards in combinations of 2) (Kings, and Jacks in combinations of 2) (Each Queen matched 8 cards) (Four Queens in combinations of 2) The Random Variable X = the number of Queens in a sample of two X 0 1 2 P(X) 28/66 32/66 6/66 I use this to exercise to explain combinations and to introduce discrete random variable distributions. A knowledgeable student may comment that this is an application of the hypergeometic distribution. (Yes I have had this happen). Below is the discrete hypergeometric distribution for the random variable X. Hypergeometric Distribution Output Using Megastat Add-in to Excel 12 4 2 X 0 1 2 P(X) 0.42424 0.48485 0.09091 1.00000 N, population size S, number of possible occurrences n, sample size cumulative probability 0.42424 0.90909 1.00000 5 Exercise 8: Shuffle Up and Deal The hypergemoetric distribution is invaluable in the calculation of many probabilities that are useful in the play of Texas Hold’em. In this game, two cards are dealt down to each player followed by three up cards (the flop) then two additional up cards (the river and turn). A player thus sees and plays with seven cards. I find that most students are familiar with Texas Hold’em and enjoy examples using it. For those who are not a quick explanation of hole cards, the flop, river and turn cards is sufficient for them to understand the probability concepts involved. This basic knowledge is assumed in the following discussion. It is also important to point out the legality issues related to gambling and that Texas Hold’em is only being used to demonstrate various statistical concepts. The cards are randomly drawn from a finite population, without replacement, with definitive probabilities (e.g., the probability of getting an ace without seeing any cards is 4/52, other probabilities are conditioned on cards you know). Under these conditions, a deck of cards is a model of a hypergeometirc distribution. The general characteristics of the hypergemoetric distribution are in Table 1. Samples are drawn from a finite population without replacement. Table 1: Hypergeometric Distribution Parameters N = number of items in the population n = sample size s = number of “successes” in population PDF s N s x nx P( x) N n Range X = max(0, n-N+s) x min(s, n) Mean n St. Dev. where = s/N n(1 ) N n N 1 The use of Excel or other computer programs simplifies the calculations so that students can focus on the use of the distribution rather than its computational difficulties. In the examples that follow I used Megastat, a statistical an add-in for Excel. 6 Example 1. Given you have a pair of Queens (your hole cards), what is the probability of flopping a set (getting another Queen in the first three up cards and the value of no other cards is known)? What is the probability of getting quads (4 Queens)? Flop You Kid Poker Using the hypergeometric distribution, N is the population size (52 cards in the deck), S is the number of successes in the population (4 Queens) and the random variable X is the number of successes in the sample of n (n = 3). The random variable X can take on the values {1,2,3}. Hypergeometric distribution 50 2 3 X 0 1 2 P(X) 0.88245 0.11510 0.00245 1.00000 0.120 0.110 0.332 N, population size S, number of possible occurrences n, sample size cumulative probability 0.88245 0.99755 1.00000 set quads expected value variance standard deviation The probability of flopping a set is thus11.5% whereas the probability of getting four Queens is only .245%. This example is one of many that provide useful information in playing Texas Hold’em. Example 2. The students are asked to find the probability of getting a Royal Flush (10 through Ace of the same suit). This can easily be found using the hypergeometric distribution. With seven cards known (2 hole cards, five community cards), the probability of getting a Royal flush is: 7 Hypergeometric distribution 52 N, population size 5 S, number of possible occurrences 7 n, sample size X 0 1 2 3 4 5 cumulative probability 0.47010 0.87140 0.98605 0.99939 0.99999 1.00000 P(X) 0.47010 0.40130 0.11466 0.01333 0.00061 0.00001 1.00000 3.23E-05 4 suits The solution is found by taking P(X = 5) and multiplying it by four because there are four suits. This isn’t too useful for improving your Hold’em game, but it is an interesting application of the hypergeometric function. (Here is a place to take out and show all the screen shots you have of your Royal Flushes). Exercise 9: The Binomial Distribution The binomial random variable X is the number of successes in n independent Bernulli trials where the probability of success is constant for all trials. The binomial distribution is shown in table 2. Table 2: Binomial Distribution Parameters n = number of trials = probability of success PDF P( x) Range X = 0, 1, 2, ..., n Mean n St. Dev. n! x (1 )n x x !(n x)! n(1 ) A deck of cards can be treated as a binomial distribution if sampling is done with replacement and the deck is shuffled after each trial. 8 Example . If you randomly select 10 cards from a deck, with replacement, what is the probability of getting at least two Kings? Fewer than five Kings? At most three Kings? No Kings? To answer these questions requires the use of a binomial distribution with n = 10 and = .0769 (Probability of getting an King on each selection). Using Excel with Megastat the following solution is obtained Binomial distribution 10 n 0.076923 p X = the Number of Kings in 10 Draws cumulative X P(X) probability 0 0.44914 0.44914 1 0.37428 0.82342 2 0.14036 0.96377 3 0.03119 0.99496 4 0.00455 0.99951 5 0.00045 0.99997 6 0.00003 1.00000 7 0.00000 1.00000 8 0.00000 1.00000 9 0.00000 1.00000 10 0.00000 1.00000 1.00000 At least two Kings 1 - .82342 = .17658 Fewer than Five King .99951 At Most three Kings .99496 No Kings .44914 9 Exercise 8: What Do You Expect? Mathematically the expected value or mean of a discrete probability distribution can be found by using the formula: n E ( X ) xi P( xi ) i 1 After showing a number of tradition examples, I then introduce some samples related to Texas Hold’em. Expectations are an important concept in determining when and how much to bet. For example: You $208,600 Pot Isildur1 After going all-in and being called by Isildur1, there is $208,600 in the pot of which you put in $97,500, the rest resulting from Isidur1’s bet, the blinds and an initial bet by another player (ignore any rake). In this “Heads-Up” situation you clearly have better chance of winning. Can you determine how much better? And, what is your expected winnings? The expected winnings is the average amount that you would win if you played this same hand repeatedly over time with the same bet structure. In other words it is the long run average winnings. Because you are really only playing the hand once, you either win $111,100, lose $97,500 or split the pot. Given these outcomes the expected value can be found by applying the formula above, or using a computer, to the following discrete distribution for the random variable X. X Win Lose Split Payout $111,100 -$97,500 $6,800 P(X) .8175 .1781 .0044 E(X) = $73489.42 The probabilities can be found using a poker odds calculator on the computer. There are many free ones available online. The one I show in class is Poker Stove (www.pokerstove.com). Free Apps are also available for many smart phones. These programs are based on simulation modeling of various poker hands. It is important to point out to the students that they may lose $97,500 on the hand. If they can’t afford to lose this, they should not be making the bet. In fact, they probably should not be in the game. 10 Based on the above scenario, I find the students are also interested in the following guidelines: Approximate Probability of Winning: Higher Pair vs. Lower Pair Pair vs. Two Higher Cards Pair vs. Two Lower Cards Pair vs. Higher and Lower Card Two Higher Cards vs. Two Lower Cards 82% 55% 83% 71% 63% Exercise 9: Against All Odds In sporting events and gambling probabilities are changed to odds and typically expressed as the odds against winning. For example, if there is a 20% chance of winning, the odds against winning are 4 to 1. This suggests for every time we face the same situation we will only win one in five times. The following formula is used to calculate odds against winning: Event A = Win Odds Against Win = (1- P(A))/P(A) .8/.2 = 4 to 1 If we are given the odds against winning, say 4 to 1, the probability can be calculated: Odds against expressed as b to a P(win) = a/(a+b) = 1/5 = 20% Applying this concept to poker games is very important in estimating expectations of winning. A reasonable goal is to only bet when you have a positive expectation of winning. For example if the odds against winning a hand in Texas Hold’em is estimated to be 4 to 1, a positive expectation would occur when the pot odds (ratio of pot size to your bet) is greater than 4 to 1. Example. In Texas Hold’em you hold two diamonds as your hole cards. Given two diamonds show up after the flop and turn, what is the probability of getting a flush on the river? What are the odds against a flush? After the flop and turn cards are shown, there are 46 unknown cards. Nine of these are diamonds. Thus you have a 9/46 or 19.6% chance of getting the flush on the river. The odds against a flush are then (1 - .196)/.196 = 4.1 to 1. You would only bet if the pot odds are greater than 4.1. I only introduce odds and examples such as this if I have some additional time and the students seem interested in earlier exercises using Texas Hold’em examples. Conclusion There are many ways to demonstrate probability theory and discrete distributions using a deck of playing cards and some of the more popular card games. This paper has outlined nine exercises that I have successfully used in class to stimulate student interest and increase their understanding. I find that it is important not to use too many examples in any given class, but to spread them over many classes. The response to these exercises by students is very positive. The only downside is having to listen to their bad beat stories during my office hours.