Flop Analysis Part 4 – Calculated values and code check

Before we get to the real data, we first need to check our code and our calculations. The input for the run shown below is the set of all possible flops enumerated, rather than real hand data. There are 132,600 possible flops (permutations, not combinations, of which there are 132,600/3! or 22,100), and so we have one of every possible flop in the run. We create these with a simple set of 3 nested FOR loops that runs through each of the 52 cards in each position, giving us 52*51*50 flops, or 132600.

If the calculated values match our enumerated counts, then we know that the calculation is correct, and that the filter to count that particular flop type is also correct (or at least that we are counting the same flop type we are calculating).

I’m showing the offsets measured two ways, both in +/- count per hundred-thousand flops (+-/100K), and in standard deviations between the means (+/- SDs). The +/-100K is useful when looking at millions of flops, since the number of SDs is not very intuitive by itself unless you have spent some time looking at them for different sample sizes. Even though the /100K isn’t balanced for different probability flops, it helps us immediately see the absolute scale of the offsets. It measures the effect size. The SD on the other hand, measures the significance of the effect, or how likely the result could have occurred by chance (assuming that we are comparing to the mean of a random variable).

Notice that I’ve chosen to divide them into 40 specific types (the last two sections) that are relevant to poker hands. Also, the calculations in the right hand column will make sense to anyone who works through the problem of counting the combinations, but the more complex ones may not be intuitive at first glance.

We’ll also be checking the rank distribution for each flop type. The enumerated values are below, and the explanations for the red values are below the chart. For space here I’ve combined the middle ranks that have identical probabilities, but we count all ranks individually in all of the actual data.

Again, these are enumerated values, or what would be expected from a perfectly distributed flop. The rank distributions are the same for rainbow, monotone, or two-suited so the combinations section isn’t shown.

Notice the types that are not symetrical between high and low card frequencies. Those will be affected by the known rank bias that we discussed in part 2. These include 3-straights, which use an A or K 33% less often than they do a 3 or 4. And “Connector & 2-gap” flops, which include an Ace 50% more often than they include a Two, and include a King 33% more often than a Three. And “Pair & 2-gap” flops which include an Ace twice as often as a Two. These imbalances are simply the result of which ranks can naturally form these relevant card patterns. But because of the known rank bias for seen flops, these patterns will not show up at the expected rates.

The calculations for the the red values are below, and these confirm that our code is counting ranks properly.

Pair & 1-gap : Expected to have half as many 2s and Ks as all other ranks, since 22 and KK can only have a gap on one end (inside). Expect 4.167% for Two and K, 8.333% all others, so (2 * 4.167%) + (11 * 8.333%) = 100%.

Pair & 2-gap : Expected to have half as many 2s, 3s, Qs, and Ks as all other ranks, since they can only have a 2-gap on one side. Expect 4.545% for 2s, 3s, Qs, and Ks, 9.091% for all others, so (4 * 4.545%) + (9 * 9.091%) = 100%

Pair & 3-gap+ : Expected to have one-third more 2s and Ks since they can be paired in this pattern with 8 other ranks instead of 6. Expected to have one-sixth more 3s and Qs since they can be paired in this pattern with 7 other ranks instead of 6 . Expect 8.333% for 3s and Qs, and 9.524% for 2s and Ks, 7.143% for all others, so (2 * 8.333%) + (2 * 9.524%) + (9 * 7.143%) = 100%

3-straight : Expected to have one-third fewer 2s, Ks and Aces than other ranks, since those can only be in two different 3-straights, and other ranks can be in three different 3-straights. Expect 5.556% for 2, K and Ace, 8.333% all others, so (3 * 5.556%) + (10 * 8.333%) = 100%.

Cnctr & 1-gap : Expected to have one-third fewer 2s and Ks than other ranks, since 2 and K can only be in this pattern four ways, and all other ranks (except 3 or Q) can be in this pattern six ways. 3s and Qs are expected to have 5/6 as many as other ranks since they can only be in this pattern five ways. Expect 5.556% for 2 and K, 6.944% for 3 and Q, 8.333% others, so (2 * 5.556%) + (2 * 6.944) + (9 * 8.333%) = 100%.

Cnctr & 2-gap : 5s thru Ts, and Aces, can be in this pattern 6 ways. 4s and Js should have only 5/6 as many since they can only be in this pattern 5 ways. 2s and Ks should only have 4/6 as many since they can only be in this pattern 4 ways. 3s and Qs should only have 3/6 as many since they can only be in this pattern 3 ways. Expect 6.061% for 2s and Ks, 4.545% for 3s and Qs, 7.576% for 4s and Js, and 9.091% for all others, so (6.061% * 2) + (4.545% * 2) + (7.576% * 2) + (9.091% * 7+ = 100%.

Cnctr & 3gap+ : There are 71 unique rank combinations that can form this pattern, with 3 cards each so 213 card occurrences (disregarding suits). 5s thru Ts, and Aces, each appear in 15 of them. 2s, 3s, Qs, and Ks each appear in 19 of them, so 4/15ths more often. 4s and Js each appear in 16 of them, so 1/15 more often. (7*15)+(4*19)+(2*16)=213. We expect 5s thru Ts and aces to appear 7.042%, {2s 3s Qs Ks} to appear 8.920%, and 4s and Js to appear 7.512%. So (7 * 7.042%) + (4 * 8.920%) + (2 * 7.512%) = 100%.

KA2 dbl cnctr : Obviously 33.3% each with all other ranks zero. This pattern is going to be heavily skewed by high card removal since it requires twice as many high cards as low, so we expect to flop less of this pattern than the calculated amount. However, the ratio of the ranks will always be 1/3 each.

Double gutshot : Expected to have one-third as many 2s and Ks as other ranks since they can only be in this pattern 1 of 3 ways. Expect to have 2/3 as many 4s and Js as other ranks since they can only be in this pattern 2 of 3 ways. Expect 3.030% for 2 and K, 6.061% for 4 and J, 9.091% others, so (2 * 3.030%) + (2 * 6.061) + (9 * 9.091%) = 100%.

Other 1-gaps : These are flops with a 1-gap present but no pair, no connector, and no double gut. Expect 6.306% for 2s and Ks, 8.108% for 3s, Qs, and Aces, 8.559% for 4s and Js, and 7.658% for others. These are enumerated counts since the patterns are complex to describe. (2 * 6.306%) + (3 * 8.108) + (2 * 8.559) + (6 * 7.658%) = 100%.

No cnct/1gp/pr : These are flops with no 1-gaps, no pair, and no connectors. Expect 9.859% for 2s and Ks, 7.042% for 3,4,J,Q and A, and 7.512% for others. These are enumerated counts since the patterns are complex to describe. (2 * 9.859%) + (5 * 7.042) + (6 * 7.512%) = 100%.

In the combination types the rank distribution is not affected by their suitedness, and so they should come out the same whether rainbow, monotone, or two-suited.