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

5.2 Hand Strength

Hand strength assesses how strong your hand is in relation to what other players may hold. Critical to the program's performance, it is computed on the flop, turn and river by a weighted enumeration which provides an accurate estimate of the probability of currently holding the strongest hand. This calculation is feasible in real-time: on the flop there are 47 remaining unknown cards so ${47\choose2} = 1,081$ possible hands an opponent might hold. Similarly there are ${46\choose2} = 1,035$ on the turn and ${45\choose2} = 990$ on the river.

Figure 5.1 contains the algorithm for computing hand strength. The bulk of the work is in the call to the hand identification function Rank which, when given a hand containing at least 5 cards, determines the strongest 5-card hand and maps it to a unique value such that stronger poker hands are given larger values and hands of equal strength are given the same value. Rank must be called ${{n\choose 2} + 1}$ times where n is the number of unknown cards.

The parameter w is an array of weights, indexed by two card combinations, so the function determines a weighted sum. It is the weight array for the opponent under consideration (each possible two-card holding is assigned a weight). When the array is normalized so the sum is 1, the weights are conditional probabilities meaning ``for each possible two-card holding what is the probability that it is the hand held by this opponent" (given the observed betting). Without normalization, the values in the weight table are conditional probabilities meaning ``what is the probability that this opponent would have played in the observed manner" (given they held this hand). Without opponent modeling, it can simply be filled with a default set of values, either a uniform or `typical' distribution. Under uniform weighting each entry in the array is equal (an appropriate representation if the opponent has a random hand). A more typical distribution would be a set of values based on the IR tables. This is the only model information used directly by the hand strength enumeration.

Figure 5.1: HandStrength Calculation
\begin{figure}
\footnotesize {\tt\begin{tabbing}
mm\=mm\=mm\=mm\=mm\= \kill
Hand...
...+tied+behind) \\
\>return (handstrength) \\
\}
\end{tabbing}} %tt
\end{figure}

Suppose our starting hand is A$\diamondsuit $-Q$\clubsuit $ and the flop is 3$\heartsuit $-4$\clubsuit $-J$\heartsuit $ (1,081 possible opponent hands). To estimate hand strength using uniform weighting, the enumeration technique gives a percentile ranking of our hand (our hand rank). We simply count the number of possible hands that are better than ours (any pair, two pair, A-K, or three of a kind: 444 hands), how many hands are equal to ours (9 possible remaining A-Q combinations), and how many hands are worse than ours (628). Counting ties as half, this corresponds to a hand rank (HR) of 0.585. In other words there is a 58.5% chance that our hand is better than a random hand (against non-uniform weights we call it hand strength, or HS).

This measure is with respect to one opponent, but when all opponents have the same weight array it can be roughly extrapolated to multiple opponents by raising it to the power of the number of active opponents (HRn is the hand rank against n opponents, $HR \equiv HR_1$).

HRn = (HR1)n. (5.2)

It is not an exact value because it does not take into account interdependencies arising from the fact that two players cannot hold the same card. However, this is a secondary consideration.

Continuing the example, against five opponents with random hands the adjusted hand rank is HS5 = .5855 = .069. Hence, the presence of additional opponents has reduced the likelihood of our having the best hand to only 6.9%.

This example uses a uniform weighting: it assumes that all opponent hands are equally likely. In reality this is not the case. Many weak hands like 4$\heartsuit $-J$\clubsuit $ (IR < 0) would have been folded before the flop. However, with the example flop of 3$\heartsuit $-4$\clubsuit $-J$\heartsuit $, these hidden cards make a strong hand that skews the hand evaluations. Specifically, accuracy of the estimates depend strongly on models of our opponents (the array of weights w). Therefore, we compute weighted sums to obtain hand strength (HS). As with HR, HSn is the hand strength against n opponents and $HS \equiv HS_1$.


HSn = (HS1)n. (5.3)




next up previous contents
Next: 5.2.1 Multi-Player Considerations Up: 5. Hand Evaluation Previous: 5.1 Pre-Flop Evaluation   Contents
Denis Papp
1998-11-30