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

Implied Odds

(continued from previous post)

The last segment covered Reflective Hand Odds, which are your basic, real-world hand odds, taking opponent play into account, albeit naively. At some point we can try to complete that model with opponent modeling data and a fuzzy, dynamic heuristic for putting a read on opponents’ play. What’s nice is that we have a model that will take in these innovations; we can incorporate opponent knowledge in a statistically meaningful way by evolving the “is-bettable” heuristic and customizing for each opponent.


1. Simple Pot Odds

So now let’s look at the other major component of straight play: pot odds. Pot odds are the ratio of your current contemplated bet or call to the current size of the pot. If the bet is $4, and the pot is $16, then the pot odds are 4-to-1; I’ll invert this as 25% for math purposes i.e. your bet is 25% of the current pot.


2. Implied Odds

As any player knows, simple pot odds are insufficient. What’s really meaningful is the ratio of two possibly larger numbers: your total bets for the rest of the hand, and the final pot minus your future bets; at any moment in the hand, that is the risk/reward equation. This is called your Implied Odds, and unlike pot odds it may depend on projections for opponent behavior, making the result fuzzy. In the preceding example, if there is also an expectation of one more call on the river against one opponent, then the total bet is $8 and the total pot (not counting your future bets) is $20, so the implied odds are 20-to-8 (10-to-4), or 40%.

In heads-up, implied odds are usually worse (higher percent) than pot odds; in multiway, they can be much better (lower percent).

In draw hands, there is a special complexity to implied odds, because your behavior will change based on the cards; on a flush draw, you will bet the river only if you make your flush. There is also the possibility of an opponent being on a draw. So you have to have an implied odds calculation that adjusts the numbers accordingly. This implied odds calculation is another big piece of AI required for good play.

This will be a trivial point for most: As the hand moves forward, more of your money ends up in the pot. As you recalculate your IPO in later betting rounds, that money is part of the pot, which tends to make your IPO better (lower percent) as the hand progresses (this is countered in limit holdem by moving to the higher limit at the turn). For this reason, a small statistical error early in the hand gets magnified on terms of your final losses, because your own mis-bet money winds up in the pot and gives you odds for staying in the hand and continuing to bet. So getting these statistics right in marginal cases matters big time.

Now let’s use these figures to compute straight play by the bot. This means no misleading or psychological trickery; no bluffs, check-raises, etc, just simple, predictable, statistically correct play. You can actually go pretty far with basic play in low-limit holdem, where no one is paying too much attention to you; and so can your bot, I suppose.


3. Check/Bet/Call/Raise/Fold ?

First let’s define a function that identifies a callable situation in straight play, based on Reflective Hand Odds (RHO) and Implied Pot Odds (IPO):

F(rho, ipo) = TRUE if rho > ipo/(100%+ipo); else FALSE

In straight play, deciding whether to call or not depends on a simple comparison of RHO an IPO, and is returned by F(). You can also trivially compute IPO for a raise by you; this will usually produce higher (worse) IPO since a greater proportion of the money is coming from you (unless it’s a very multiway hand). If RHO are still greater, then you may contemplate a raise.

If the first bet is to you, the minimum requirement to bet first (still assuming straight play only) is F(rho, ipo)==TRUE. With multiple players or a loose raiser ahead, you may require sufficient RHO to cover a raise before betting first. On the other hand, with any made hand, you don’t want to check and “give a free card”. Determining when to bet first is a creative part of the program, and may inject random behavior, but there is nothing very advanced or complex here; it comes down to expectation of an opponent betting first or raising, which is a direct consequence of opponent modeling and the “is-bettable” heuristic used in RHO to put each opponent on a hand. Even a static algorithm, with no opponent modeling, may be enough here.


4. The Preflop

On the preflop, the same calculations for RHO and IPO apply as for the rest of the game in theory. However, in reality, these are not computable on the preflop for several reasons.

First of all, there is much less information available on the preflop. There is no reflective component to RHO if an opponent has not yet acted. For IPO, the possibilities are too chaotic and dependent on the situation at the flop. Also, even if the hand odds information was available, it would not be computable in real time from the preflop.

For this reason, it makes much more sense to follow a precomputed strategy on the preflop, such as Sklansky’s. Sklansky gives you a general preflop strategy for playing each set of hole cards in early, middle, and late position. It is somewhat ambiguous with respect to different size games, and different types of opponents. Still, by maintaining a preflop history for each opponent, you can tweak the basic Sklansky action to respond to the game.

At some point, I’ll go through some of my ideas on generating the preflop strategy from scratch. I once estimated that generating the entire table would take 70 hours of computer time. One of my ambitions is to create my own preflop strategy which is adjustable statistically to variations in the game (as opposed to ad hoc, like Sklansky’s).


5. Straight Play

To summarize, the RHO/IPO calculation for straight play applies only after the flop. Straight play for a bot means following (some variant of) a precomputed strategy (like Sklansky’s) for the preflop, and (some variant of) the F() function thereafter.



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

0 Comments:

Post a Comment

<< Home