You are on page 1of 3

12/22/2018 Poker Effective Hand Strength (EHS) algorithm - Wikipedia

Poker Effective Hand Strength (EHS)


algorithm
Effective Hand Strength (EHS) is a poker algorithm conceived by computer scientists Darse Billings, Denis Papp,
Jonathan Schaeffer and Duane Szafron that has been published for the first time in a research paper (1998). "Opponent
Modeling in Poker" (http://www.cs.virginia.edu/~evans/poker/wp-content/uploads/2011/02/opponent_modeling_in_p
oker_billings.pdf) (PDF). AAAI-98 Proceedings.

It has since then been considered as a reference in the realm of poker artificial intelligence and has been the basis of
further research such as:

"Computer poker: a review" (http://www.cs.auckland.ac.nz/~ian/papers/AIJournal.pdf) (PDF). Artificial Intelligence,


Department of Computer Science, University of Auckland, New Zealand: 962–963. 2010.
"Application of AI in poker" (http://www.few.vu.nl/en/Images/werkstuk-schuijtvlot_tcm39-225501.pdf) (PDF). VU
University Amsterdam Faculty of Sciences: 12–13. 2011.
"Advances in artificial intelligence – SBIA 2008 : 19th Brazilian Symposium on Artificial Intelligence, Salvador, Brazil,
October 26–30, 2008 ; proceedings". 2008: 85–86.

Algorithm
The algorithm is a numerical approach to quantify the strength of a poker hand where its result expresses the strength of a
particular hand in percentile (i.e. ranging from 0 to 1), compared to all other possible hands. The underlying assumption is
that an Effective Hand Strength (EHS) is composed of the current Hand Strength (HS) and its potential to improve or
deteriorate (PPOT and NPOT):

where:

is the Effective Hand Strength


is the current Hand Strength (i.e. not taking into account potential to improve or deteriorate, depending on
upcoming table cards
is the Negative POTential (i.e. the probability that our current hand, if the strongest, deteriorates and
becomes a losing hand)
is the Positive POTential (i.e. the probability that our current hand, if losing, improves and becomes the
winning hand)

Pseudocode
Hand Strength (HS) will enumerate all possible opponent hand cards and count the occurrences where our hand is
strongest (+50% of the cases where we are tied):

HandStrength(ourcards, boardcards) {

ahead = tied = behind = 0


ourrank = Rank(ourcards, boardcards)
for each case(oppcards) {

https://en.wikipedia.org/wiki/Poker_Effective_Hand_Strength_(EHS)_algorithm 1/3
12/22/2018 Poker Effective Hand Strength (EHS) algorithm - Wikipedia

opprank = Rank(oppcards, boardcards)


if (ourrank>opprank) ahead += 1
else if (ourrank==opprank) tied += 1
else behind += 1

}
handstrength=(ahead+tied/2)/(ahead+tied+behind)
return(handstrength)

In addition, EHS will consider the hand potential (i.e. its probabilities to improve or deteriorate):

HandPotential(ourcards,boardcards){ // Hand potential array, each index represents ahead, tied,


and behind.

integer array HP[3][3] //initialize to 0


integer array HPTotal[3] //initialize to 0
ourrank = Rank(ourcards,boardcards)
//Consider all two card combinations of the remaining cards for the opponent.
for each case(oppcards){

opprank = Rank(oppcards,boardcards)
if(ourrank>opprank) index = ahead
else if(ourrank=opprank) index = tied
else index = behind
HPTotal[index] += 1
// All possible board cards to come.
for each case(turn,river){ //Final 5-card board

board = [boardcards,turn,river]
ourbest = Rank(ourcards,board)
oppbest = Rank(oppcards,board)
if(ourbest>oppbest) HP[index][ahead]+=1
else if(ourbest=oppbest) HP[index][tied]+=1
else HP[index][behind]+=1

}
//Ppot: were behind but moved ahead.
Ppot = (HP[behind][ahead]+HP[behind][tied]/2+HP[tied]
[ahead]/2)/(HPTotal[behind]+HPTotal[tied])
//Npot: were ahead but fell behind.
Npot = (HP[ahead][behind]+HP[tied][behind]/2+HP[ahead]
[tied]/2)/(HPTotal[ahead]+HPTotal[tied])
return(Ppot,Npot)

Applicability
EHS is applicable to a wide variety of poker games such as Texas hold 'em poker, Omaha hold 'em poker, ...

https://en.wikipedia.org/wiki/Poker_Effective_Hand_Strength_(EHS)_algorithm 2/3
12/22/2018 Poker Effective Hand Strength (EHS) algorithm - Wikipedia

Given the complexity of the algorithm, it can not be computed manually and has to be used in an Artificial Intelligence
context.

Retrieved from "https://en.wikipedia.org/w/index.php?


title=Poker_Effective_Hand_Strength_(EHS)_algorithm&oldid=602252063"

This page was last edited on 1 April 2014, at 11:32 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this
site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia
Foundation, Inc., a non-profit organization.

https://en.wikipedia.org/wiki/Poker_Effective_Hand_Strength_(EHS)_algorithm 3/3

You might also like