Quote: Original post by PredictorQuote: Original post by Anonymous Poster
First start with a table of all combinartions of 5 cards (IIRC 52*51*50*49*48 = 311875200 Different possibilities).
That's actually the number of permutations.
Yep. To calculate combinations (where order doesn't matter) this is the formula:
n!
--------- = nCk
k!(n - k)!
52!
---------- = 52C5
5!(52 - 5)!
or 2598960 combinations
Of course in Texas Hold'em one has 7 cards (2 hole cards and 5 community cards) from which one cherry picks the best 5 card hand from so the above figure isn't very meaningful.
Hello theredpill99,
I'm working on the same problem. Some questions: is your game arbitrary limit, no limit or pot limit? Tournament(where you play until one person at the table has all the chips) or sit-and-go(people may enter and leave at any point in the game)? I'm trying to make my game have all these as options which is pretty ambitious considering that limit poker and a no limit poker are completely different games requiring radically different strategies.
Pre-Flop - You said you had your pre-flop evaluation done. Are you basing it on David Sklansky's starting hand chart(ie the 169 distinct starting hand combinations)? And before anyone asks, I know there are actually 1326 combinations (ie 52C2) but many of them have identical values, for example AhKd is worth the same as AhKs and AhAd is worth the same as AhAc pre-Flop. There are 169 distinct starting hands...
-----------------------------Total--Distinct----Odds of Happening
Pairs ------------------- XX = 78 = 13 ------- .058823529
Not-paired but suited --- XYs = 312 = 78 ------- .235294117
Not-paired and not suited XY = 936 = 78 ------- .705882352
Poker players agree that a good player should probally muck (fold pre-flop) at least half his hands if he is not in one of the blinds and isn't short-stacked. Sklansky and others have tried to rank the 169 hands to aid in hand selection.
I'm currently writing a little helper program which will randomly deal out tens of thousands of hands of Hold'em and keep track of which starting hands resulted in victory so that I can then mathematically order and weight them. For example I know that AA is better than AKs(suited) but how much better? Once I get a number for each starting hand combination then I can weight it with such factors as position, # of players still in the hand and chip count(the short stack can't be too picky).
Post-Flop - If I've got AhKd in my hand and the flop is Ad5sJc then I've got Aces with a King kicker. I know that at present the only hands that could be ahead of me are
AsAc,
AsJd, AsJs, AsJh, AcJd, AcJs, AcJh,
As5h, As5d, As5c, Ac5h, Ac5d, Ac5c,
JdJs, JdJh, JsJh,
Jd5c, Jd5d, Jd5h, Js5c, Js5d, Js5h, Jh5c, Jh5d, Jh5h,
5c5d, 5c5h, 5h5d,
or 25 hands out of a possible 1081 combinations(ie 47C2).
The way I've handled it is figure out how many hands are ahead of me and calculate a probability that someone at the table holds one of those hands. Eventually I will weight that probability with player tendencies(like how a tight player wouldn't play J5 unless he were in the big blind and had not been raised)
In addition to keeping track of which hands are ahead of me I also need to know the probability that hands not currently ahead of me could still beat me. For example if an opponent has 2 diamonds and the Turn and the River are both diamonds then he has an Ace high flush. This is a little more complicated than merely figuring which hands are ahead of me, I'm still working on this part but the final solution will probally take the form of linked nodes in some kind of tree structure(tracing all possible outcomes and the % of those outcomes which would beat my hand).
The Turn and the River are handled the same way. As each card is revealed then the tree gets trimmed back and the probabilities get adjusted.
During each betting round you have to decide whether to fold, check, call, raise or go all in. I'm still working on a formula to decide what action should be taken but variables include probability of winning the hand, # of people still in the pot, table position, amount in the pot vs. amount to be called, size of my stack, size of blinds and eventually player profile(but this is far off into the future). Put all info into the formula and then pump out a figure like...
if (formulaResult > 95)
raise()
else if(formulaResult > 75)
call()
etc......
I'd like to even include a bluff function. When a computer player object gets created then I randomly assign a value to a bluffModifier which figures into the formula and allows the computer player to bluff and/or semi-bluff at unpredictable intervals and to unpredictable degrees.
Of course at this point most of this is theoretical but I have given it a lot of thought. I'd love to compare notes with you.