next up previous contents
Next: 5.3.1 Multi-Player Considerations Up: 5. Hand Evaluation Previous: 5.2.1 Multi-Player Considerations   Contents

5.3 Hand Potential

In practice, hand strength alone is insufficient to assess the quality of a hand. Hand potential assesses the probability of the hand improving (or being overtaken) as additional community cards appear. Consider the hand 8$\diamondsuit $-7$\diamondsuit $ with a flop of 9$\diamondsuit $-6$\clubsuit $-2$\diamondsuit $. The probability of having the strongest hand is very low, even against one random opponent (11.5%). On the other hand, there is tremendous potential for improvement. With two cards yet to come, any $\diamondsuit $, 10, or 5 will give us a flush or a straight. Hence there is a high probability that this hand will improve substantially in strength, so the hand has a lot of value. We need to be aware of how the potential affects hand strength.

This example describes positive potential (PPOT): the probability of pulling ahead when we are behind. We can also compute the negative potential (NPOT): the probability of falling behind given we are ahead. Both of these can be computed by enumeration in real-time. We have 1,081 possible subcases (opposing hands for which we have weights) on the flop and 990 on the turn. For each subcase we can either do a two card look-ahead (consider the 990 combinations of the next two cards on the flop) or a one card look-ahead (45 cards on the flop and 44 on the turn). For each subcase we count how many combinations of upcoming cards result in us being ahead, behind or tied. The total number of cases to be considered is:

The potential for A$\diamondsuit $-Q$\clubsuit $/3$\heartsuit $-4$\clubsuit $-J$\heartsuit $ with uniform weighting is shown in Table 5.1. The table shows what the result would be after seven cards, for cases where we are ahead, tied or behind after five cards. For example, if we did not have the best hand after five cards, then there are 91,981 combinations of cards (pre-flop and two cards to come) for the opponents that will give us the best hand. Of the remaining hands, 1,036 will leave us tied with the best hand, and 346,543 will leave us behind. In other words, if we are behind we have roughly a PPOT2 = 21% chance of winning against one opponent in a showdown. Additionally, if we are currently ahead and that opponent plays to the showdown, we have roughly a NPOT2 = 27% chance of losing.

Table 5.1: Unweighted potential of A$\diamondsuit $-Q$\clubsuit $/3$\heartsuit $-4$\clubsuit $-J$\heartsuit $
5 cards 7 cards
  Ahead Tied Behind Sum
Ahead 449,005 3,211 169,504 621,720 = 628x990
Tied 0 8,370 540 8,910 = 9x990
Behind 91,981 1,036 346,543 439,560 = 444x990
Sum 540,986 12,617 516,587 1,070,190 = 1,081x990

If Trow,col refers to the values in the table (for brevity we use B, T, A, and S for Behind, Tied, Ahead, and Sum) then PPOT2 and NPOT2 are calculated by:

PPOT_2 = \frac{T_{B,A} + \frac{T_{B,T}}{2} + \frac{T_{T,A}}{2}}
{T_{B,S} + \frac{T_{T,S}}{2}}
\end{displaymath} (5.5)

NPOT_2 = \frac{T_{A,B} + \frac{T_{A,T}}{2} + \frac{T_{T,B}}{2}}
{T_{A,S} + \frac{T_{T,S}}{2}}.
\end{displaymath} (5.6)

Figure 5.2 describes the algorithm for two card look-ahead from the flop. The parameter w is, as for Figure 5.1, for the weight array of the opponent (opponent modeling is discussed later), and can simply be a uniform set of weights. The HandStrength calculation is easily embedded within this function, and the one card look-ahead function HandPotential1 is essentially the same as HandPotential2. In this function, the inner loop is executed ${{47\choose 2} * {45\choose 2} = 1,070,190}$ times and so the Rank function is called

\begin{displaymath}1 + {47\choose 2} + 2*{47\choose 2}*{45\choose 2} =
2,141,371 \end{displaymath}

times. However, there are many redundant calculations. There are only ${{47\choose 2} = 1,081}$ possible unique calls in the inner loop to Rank for ourcards and only ${{47\choose 4} = 178,365}$ for oppcards (this redundancy exists because there is no order constraint to the evaluation of poker hands). Therefore, with pre-calculation, HandPotential2 need only make

\begin{displaymath}1 + {47\choose 2} + {47\choose 2} +
{47\choose 4} = 180,528\end{displaymath}

calls to Rank (although the number of times the inner loop is executed is not reduced from 1,070,190). Similarly, HandPotential1 originally needs

\begin{displaymath}1 + {47\choose 2} + 2*{47\choose 2}*45 = 98,372 \end{displaymath}

calls to Rank on the flop (92,116 on the turn) but with pre-calculation only

\begin{displaymath}1 + {47\choose 2} + {47\choose 2} + {47\choose 3} = 18,378 \end{displaymath}

on the flop (17,251 on the turn).

Figure 5.2: HandPotential2 Calculation
% latex2html id marker 1531\footnotesize {\tt\begin{tabbing}
...HPtotal[tied]/2) \\
\end{tabbing}} %tt

In Table 5.1 we compute the potential based on two additional cards and it produces

PPOT_{2} = \frac{91,981 + \frac{1,036}{2} + \frac{0}{2} }
{439,560 + \frac{8,910}{2}} = 0.208,
\end{displaymath} (5.7)

NPOT_{2} = \frac{169,504 + \frac{3,211}{2} + \frac{540}{2} }
{621,720 + \frac{8,910}{2}} = 0.274.
\end{displaymath} (5.8)

The calculation for one card lookahead is exactly the same as the above calculation, except there are only 44 or 45 possible outcomes instead of 990. With only one card to come on the turn, we find PPOT1 = 0.108 and NPOT1 = 0.145. When combined with an array of weights from opponent modeling (each subcase is weighted according to the two card combination defining the subcase) the calculations provide accurate probabilities that take into account every possible scenario. Hence, the calculation gives smooth and robust results, regardless of the particular situation. PPOT1 is used in practice due to the greater complexity of using PPOT2 (calculating the effective odds, or how much it might cost to see a second card) as well as the calculation time. On a 150 MHz SGI Challenge, using pre-calculation but otherwise unoptimized, computing PPOT1 from the flop typically takes 130 ms of CPU time and PPOT2 takes 3200 ms on average.

next up previous contents
Next: 5.3.1 Multi-Player Considerations Up: 5. Hand Evaluation Previous: 5.2.1 Multi-Player Considerations   Contents
Denis Papp