Monday, March 28, 2011

Counting Part 2: Poker

Poker (The Small Group)

The first question: How many possible poker hands are there?

After playing around with 2- and 3- card hands, which are easier to think about, they arrived at their first answer:
52*51*50*49*48.

This is a good start, but it's assuming order matters, and thus is counting each hand more than once. Order doesn't matter in poker, because whether you have 2-3-4-5-5 or 2-5-5-4-3, it's the same poker hand. Each 5-card hand gets counted 5*4*3*2*1 times, so the real answer is
(52*51*50*49*48)/(5*4*3*2*1)=2,598,960
possible poker hands.

Then we figured out how many ways there were to get various hands. There are only 4 ways to get a a royal flush, which means the probability of getting a royal flush is
(4)/(2598960) ~=~ .0000015
A straight flush that isn't also a royal flush can start on A, 2, 3, 4, 5, 6, 7, 8, or 9, so there are 9 ways per suit for a total of 36 ways to get a royal flush. The probability of getting a straight flush is
(36)/(2598960) ~=~ .000014
These hands are not very likely!

It's harder to figure out how many ways there are to get one pair. There are 13 choices of what the pair will be (A through K). Suppose we have a pair of aces. There are 6 different ways to choose a pair of aces from the 4 aces in the deck. Then we have to fill in the other 3 cards in the hand.
A-A-_-_-_

Since the third card can't be an ace (or we wouldn't have one pair), there are 48 choices for the third card. The fourth card can't be an ace, and also can't be whatever we picked for the third card, so there are 44 choices. The fifth card can't be an ace, the same as the third card, or the same as the fourth card, so there are 40 choices for the fifth card.

To make sure we aren't over-counting those last three cards, we need to divide by 6 (the number of ways to order those cards). This gives us
(13*6*48*44*40)/6 = 1,098,240
ways to get a single pair. The probability of getting a single pair in a five-card poker hand is
1,098,240 / 2,598,960 ~=~ .42

After figuring all this out, we spent a couple of days playing poker and tallying up the hands we got to see if they looked like we expected they would. There were lots of single pairs, as expected, with a scattering of two pair and three of a kind. I got lots of junk hands, which the kids found very amusing.

We played with buttons, starting with 20 buttons each. I pointed out to the loser of the first game that if we had been using real money, he would have just lost $20 in half an hour. He replied that he wasn't going to gamble with real money. :)

Here's a site that explains how to calculate odds for various poker hands.

No comments:

Post a Comment