Main      Site Guide    
Message Forum
Re: Poker Math
Posted By: gremlinn, on host 24.25.223.168
Date: Friday, September 19, 2003, at 14:24:47
In Reply To: Poker Math posted by Darien on Friday, September 19, 2003, at 01:37:04:

> I can't sleep, so I thought I'd come math at the forum for a while. This post may be of interest to gremlinn and probably nobody else. Stephen and Dave will read this far, then discover it's more about math than poker and probably hang up. Anyhow.
>
> Earlier tonight, I was playing poker. More earlier, I was discussing with Stephen, Dave, and gremlinn why a flush beats a straight, given that four to a flush is easier than four to a straight. This all got me to thinking about various probabilities of various hands in Hold 'Em, and how to figure them out.
>
> The obvious first step is to figure out how many possible hands there are, which is a simple enough operation. Assuming that you're playing by yourself (in which case you're being killed to death by the rake), the total number of possible spreads is (52 * 51 ... 46), or 674274182400. (Note to gremlinn: Is there a more convenient notation for (52 * 51 ... 46)? Like maybe 52!46? If there isn't, I'm going to write to the Federal Bureau of Math Notation and demand one.)
>

Yeah, it's like Myrth said. nCr = n!/(r! (n-r)!) (combinations) and nPr = n!/(n-r)! (permutations). Your example above is 52P7. The difference between "P" and "C" is that the order of the cards is important for permutations but immaterial for combinations.

> Now we'll go with a pair. The total number of two-card combinations that will yield a pair is 78 (six per rank, thirteen ranks). I incorrectly assumed that the total number of possible pairs was therefore (78 * 50 ... 46), because I forgot that any hand that forms better than a pair no longer is a pair. So it gets sticky.
>
> Let's say we have pocket deuces, and decide to stay in on that (hey, we're getting killed by the rake no matter what). There's our 78. Then comes the flop. If we flop 268, we have trips and that's not a pair. So the first card of the flop cannot be a 2, which means our first number is 48 rather than 50. The second card of the flop also can't be a 2, but it also can't be the same as the first flop card, or we have two pair. So this is where it starts to get tricky. Looking at it, there are five cards remaining in the deck that this card cannot be if we are to retain our pair. So instead of 49, our number here must be 44. The third card plays out almost the same: it can't be a 2, and it can't be the same as either other card, which means we have (48 - 2 - 3 - 3) = 40 possible card at this point.
>
> So now the flop's down, and we have a total number of combinations of (78 * 48 * 44 * 40) = 6589440. Next comes the turn. Of the 47 cards left in the deck, the turn cannot be the same as any card already down on the table, so (47 - 2 - 3 - 3 - 3) = 36. At this point, straights and flushes become an issue, but I'm not going to worry about them yet (you'll see why in a minute). So 36 is the number we need on the turn, and, likewise, (46 - 2 - 3 - 3 - 3 - 3) = 32 on the river. That gives us a running total of (78 * 48 * 44 * 40 * 36 * 32) = 7591034880.
>

Careful here. 78 is the number of combinations for a pair, but when you factor in the other five cards above, you're implicitly making the order important. What you need to do is take (48 * 44 * 40 * 36 * 32) and divide by 5! (120) to get the number of *combinations* for the remaining 5 cards, not permutations. So the number of 7 card combinations with only one pair and no triples is 78 * 48 * 44 * 40 * 36 * 32 / 120 which is 63258624. [The reason that you don't divide by 7! is that the two cards making up the pair are distinctively different from the five non-paired cards. The number of combinations of a hand made up of two distinct groups is the number of combinations for one (the 78) times the number of combinations for the other (the (48*...*32)/120)]

> Now we worry about straights and flushes. Given any five cards, there are 10240 possible straights and 8580 possible flushes, for a total of 18820. From this we subtract 40 (there are 40 possible straight flushes, and they're obviously invluded in each set), which leaves 18780.

Shouldn't it be 5148 for the flush count? It's (13*12*11*10*9)/5! (the number of ways to pick the five ranks) times 4 (number of suits) which is 5148. So the number of straight and flushes (or both) is 10240 + 5148 - 40 = 15348.

> Now, of our seven cards, how many different five-card combinations do we have? The answer is made slightly tricky by the fact that no valid combination can include both pocket cards - they're a pair, remember, so they can't be serial or suited. So there are eleven possible combinations of the available cards that could yield a straight or a flush. (11 * 18780) = 35268840 possible straights or flushes. Therefore, (7591034880 - 35268840) = 7555766040 possible pair hands exist, which gives a 7555766040 / 674274182400 chance of having a pair (roughly 1.12%).
>

I'm not too sure about this step. You have to worry about things like double counting hands with six-card flushes and such, not to mention counting combinations for picking cards not making up the flush/straight. The trickiest thing, to me, is that you can have hands with straights *and* flushes but no straight flushes (as the 5-card subsets making up the straight and the flush might not be the same. For example: {2H 3S 4C 5H 6H 10H QH} ). Let me try starting this step from scratch with the following accounting:

Of 7-card hands with exactly one pair and no triples:

1. # of 7-card flushes: 0 (since you already know the suits are different for the pair cards)

2. # of 6-card flushes: 78 (ways to pick the lone pair) * 2 (ways to pick which of the two card's suits is to be used for the flush) * (12*11*10*9*8)/5! (ways to pick the remaining five cards, which are non-distinct, so that's why we divide by 5!). That's 78 * 2 * 792 = 123552 6-card flushes. [Note that you don't have to worry about picking up new pairs/triples because when you're taking *all* remaining five cards from the same suit, you can't pick up a duplicate rank.]

3. # of 5-card (and not 6) flushes: again, 78 ways to pick the pair cards * 2 ways to pick which suit will be the flush suit. Multiply this by (12 * 11 * 10 * 9)/4! ways to pick the 4-card combination which completes the flush. Now the remaining card can be anything in the 39 cards making up the 3 other suits *except* the 5 ranks that are in use. So we have 8 ranks * 3 suits = 24 ways to pick the last card. So the subtotal here is 78 * 495 * 24 = 926640.

[So far, these three counts don't overlap.]

4. # of 7-card straights: 0 (as before, it's ruled out already by the starting pair).

5. # of 6-card straights: it seems to be easier this time to figure out where the straight is, *then* figure out which rank is duplicated into a pair. There are 9 ways to pick the ranks forming the 6-card straight. Then there are 6 ways to pick which rank is duplicated. Then multiply by 4^5 ways to pick the suits of the 5 non-paired cards. Then there are 6 ways to pick the suits of the pair. So it's 9 * 6 * 4^5 * 6 = 331776.

6. # of 5-card (and no higher) straights: a little trickier here, two subcases:
A. straights where the top or bottom card is an ace: there are 2 ways to pick the ranks (A-5 or 10-A). Two more subcases:
A1. If the pair is distinct from the straight's ranks, there are 7 ways to pick the pair's rank (it can't be one of the ranks in the straight *or* the adjacent rank, since that would make a 6-card straight) * 6 ways to pick their suits. Then, for the straight, 4^5 ways to pick the suits. A subtotal of 2 * 7 * 6 * 1024 = 86016.
A2. If the pair is in one of the ranks used by the straight: there are 5 ways to pick which rank is duplicated, 4^4 ways to pick suits for the other straight's ranks, 6 ways to pick the suits of the pair, 7 ways to pick the rank of the 7th card, and 4 suits for it. A subtotal of 2 * 5 * 256 * 6 * 7 * 4 = 430080
B. straights where the top/bottom cards are not aces: there are 8 ways to pick the ranks (2-6, 3-7, ..., 9-K). Two subcases, as before:
B1. If the pair is distinct from the straight's ranks, there are only *6* ways to pick the pair's ranks (since now there are 7 different ranks used up by the straight or used to buffer it from becoming a 6-card straight). Everything else is the same as A1, so the subtotal's 8 * 6 * 6 * 1024 = 294912
B2. If the pair is in one of the ranks used by the straight: same as A2, but again 7 is replaced by 6 for the same reason as in B1. A subtotal of 8 * 5 * 256 * 6 * 6 * 4 = 1474560

The total for 6 is : 2285568.

So far we have 63258624 (hands with exactly one pair, no triples), and we've subracted off (123552 + 926640 + 331776 + 2285568), giving 59591088 hands. This isn't quite right, since we've double counted hands with both flushes and straights (and it's not as easy as adding back the number of straight flushes), but as a *first approximation*, the chance of getting one pair and nothing better is:

59591088/133784560 ~= 44.54%

So the actual probability is a little bit higher (by maybe a percentage point or two). If it's worth the time, I'll finish off the count of hands with straights and flushes, but for now I'm wildly guessing the answer will be somewhere around 45-46%.

> Those odds seem very low to me, and I'm not so full of myself as to think that I can do that much math at this hour of the morning and not make any mistakes. So can anybody (read: gremlinn) find something wrong in my calculations or in my logic? I'm reasonably sure I miscalculated the possible number of flushes, to start. And am I correct in assuming that, since the numbers I'm using preclude two pair or trips, I don't have to consider boats or quads, since the former are prerequisite?

Yeah, that's correct.

Post a Reply

RinkChat Username:
Password:
Email: (optional)
Subject:
Message:
Link URL: (optional)
Link Title: (optional)

Make sure you read our message forum policy before posting.