Hold'em Killer

Hold'em Killer is my poker bot blog and guide to writing your own pokerbot. It is associated with my free online texas hold'em bot at http://www.holdemkiller.com. These are chapters from a book I was writing last year. I don't know of any poker programming books out there, so maybe I'll get to finishing this someday and get it published.

Monday, April 18, 2005

Computing Actual Hand Odds

(continued from previous post)

So after getting raw hand odds, the bot needs to react to the table action if it’s going to be any good. This means adjusting the odds to opponent betting behavior. But how to do that? How do you adjust your hand odds at the turn based on the fact that one of the four opponents raised preflop?

For a first stab, let’s assume that all opponents are playing rationally and competently, with no deceptive play. If that’s true, then we can look at the opponents’ betting history for previous rounds and compute which sets of opponent hole cards were playable as played on those rounds, using some heuristic. The choice of that heuristic is a central piece of AI for the bot. For now, let’s just consider a boolean heuristic.


1. Revised 7-card hand spectrum

Going back to the 7-card hand spectrum, we can then X out the red dots which assume opponent hole cards which, according to the heuristic, were not bettable as played on those rounds, given the table cards present on that round.


[_._...xx.._...._..__xx_..._._..._.....x..._...._.xx_.._._.._...._.._.._..._..._..xx.._.._xxx_]
133million

Again, the spectrum represents all ~133million possible 7-card hands. Blue dots represent ones you can make; red dots represent ones the opponent can make, and which assume hole cards that are considered playable as played up to now. Red x’s represent hands the opponent can make, but which include hole cards that are not considered playable as played in some preceding round.


2. Revised 5-card hand spectrum

As before, the 7-card possibilities map to a sorted spectrum of 5-card hands, which are the “best hands” taken from the 7-card hands. This time we filter out the red x’s above, so we only consider opponent hands that are reasonable according to the betting. Recall that the dots are weighted according to the number of 7-card hands that map to them. So, depending on what happened the heuristic returned for the corresponding 7-card hands, some red dots are eliminated, some are unaffected, and some have their weights reduced.


[__..._..__.._..__....__._..__...___.__..__.___._...___..__..__] 2.7 million

The spectrum above represents all possible 5-card hands (ordered worst to best). Blue dots represent "best hands" taken from the revised spectrum of 7-card user hands; red dots represent best hands taken from the possible 7-card opponent hands, which were bettable in the past, i.e. the red dots above only, not the x’s. Multiple 7-card hands can map to the same best 5-card hand.


3. Reflective Hand Odds

We can now compute new hand odds against 1 or n opponents exactly as before, but using the revised 5-card hand spectrum. These new odds take into account opponent play, reflecting on past rounds and which opponent hole cards were bettable up until now; I call these the Reflective Hand Odds.

A player may not have the nuts, but have the “reflective nuts”. This means that, assuming reasonable play by the opponents, they cannot be playing hole cards that have a chance of winning at this point. In this case, all red dots to the right of a blue dot in the unrevised 5-card hand spectrum were referenced by red dots in the 7-card hand spectrum which were x’d out by the heuristic in the revised 7-card hand spectrum.

“Having the reflective nuts” looks like this:
[_...__.___._..__.__...__.___._..___....._.._..._] ; 5-card hand spectrum (unrevised)
[_...__.___._..__.__...__.___._..___._..___.._] ; Revised 5-card hand spectrum

Applying the heuristic is the computational equivalent of “putting the opponent on a hand”. This is where a bot, with perfect memory and consistency, can have a significant advantage over a human player, especially in a multiway situation.

But to be effective, the heuristic needs to be fuzzy, and take opponent modeling and possible deceptive play into account. A too-rigid heuristic will make the bot easily susceptible to deceptive play.


---------------
Ervin Peretz is a software engineer at a major web search company.
He is author of HoldemKiller, a free online poker bot.

1 Comments:

At 10:06 PM, Blogger Unknown said...

Probability is a huge factor in texas hold em. And knowing about this is an edge in your part. In online games especially with very few (if any) tells, statistical knowledge becomes the main factor when choosing whether to bet, call, or fold. ~ Asian Poker

 

Post a Comment

<< Home