Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Poker Odds for Texas Holdem

by David Caughell (Monk)
on Mar 02, 2004 at 22:56 UTC ( #333396=CUFP: print w/replies, xml ) Need Help??

There are a few poker nodes already, under CUFP (apparently the second guy didn't look it up either. :) )... I've left this node as is, but if it gets reaped, that's fine. Sorry about that.

Back to poker odds again...

In Texas Holdem Poker games, you're dealt a pocket of two cards, that only you can see. At this point there's a round of betting, then three communal cards (flop) come down, then betting, then a fourth (turn), then betting, then a fifth (river).

It's necessary to be able to predict the odds of you making your hand in order to determine how to bet.

If, after the flop, you're looking for a single card to fill a straight on either side of your current hand (i.e. you have a 5-6-7-8 and are looking for a 9 or 4) (this is called an "open straight"), you have 8 outs (four 9's and four 4's), and you have roughly a 31.5% chance of getting that by the river (or a 17.4% chance of hitting it on the river, if you missed it on the turn).

These figures are presented by the program, and contain outs all the way up to 46 cards, even though I don't think it's possible to have outs that high. :)

I realize that I didn't use any of the cool perl features for making these types of forms (perl's original task?). It kinda sucks, but I don't plan on making this type of output too often...

kutsu pointed out the node of btrott's, for the rounding function. (Based on the fact that this is at least the third post on the same topic, I think it means that I used someone else's wheels, but I reinvented the automobile. :)) dragonchild Pointed out that you can't use the same odds for texas and omaha (ouch!).

#!/usr/bin/perl -w use strict; #statics my $file = 'outodds.txt'; my $width = 80; my $title = "Texas Holdem Odds From Outs"; my $rowdesk = "Outs\tTurn\t\tRiver\t\tEither\n"; #length calcs my $div = '-' x $width . "\n"; my $widthdif = int($width / 2) - int(length($title)/2); #make top section of report my $top = ' ' x $widthdif . $title . "\n"; $top .= ' ' x $widthdif . '-' x length($title) . "\n\n"; $top .= $rowdesk . $div; #make body my @body; for (1 .. 46) { my $row = "$_\t"; #turn my $perc = $_ / 47; $row .= round($perc * 100, 1) . "%\t\t"; #river $perc = $_ / 46; $row .= round($perc * 100, 1) . "%\t\t"; #either $perc = 1 - (47 - $_) * (46 - $_) / (47 * 46); $row .= round($perc * 100, 1) . "%\n"; push @body, $row; } #print output to file open FILE, ">$file" or die; print FILE $top; print FILE @body; close FILE; sub round { #from perlmonks: http://www.perlmonks.org/index.pl?node_id=8786 #I editted to right-justify for percentages rounded one place sprintf "%5.$_[1]f", $_[0]; }

Output:

                    Texas Holdem Poker Odds From Outs
                    ---------------------------------

Outs	Turn		River		Either
--------------------------------------------------------------------------------
1	  2.1%		  2.2%		  4.3%
2	  4.3%		  4.3%		  8.4%
3	  6.4%		  6.5%		 12.5%
4	  8.5%		  8.7%		 16.5%
5	 10.6%		 10.9%		 20.4%
6	 12.8%		 13.0%		 24.1%
7	 14.9%		 15.2%		 27.8%
8	 17.0%		 17.4%		 31.5%
9	 19.1%		 19.6%		 35.0%
10	 21.3%		 21.7%		 38.4%
11	 23.4%		 23.9%		 41.7%
12	 25.5%		 26.1%		 45.0%
13	 27.7%		 28.3%		 48.1%
14	 29.8%		 30.4%		 51.2%
15	 31.9%		 32.6%		 54.1%
16	 34.0%		 34.8%		 57.0%
17	 36.2%		 37.0%		 59.8%
18	 38.3%		 39.1%		 62.4%
19	 40.4%		 41.3%		 65.0%
20	 42.6%		 43.5%		 67.5%
21	 44.7%		 45.7%		 69.9%
22	 46.8%		 47.8%		 72.2%
23	 48.9%		 50.0%		 74.5%
24	 51.1%		 52.2%		 76.6%
25	 53.2%		 54.3%		 78.6%
26	 55.3%		 56.5%		 80.6%
27	 57.4%		 58.7%		 82.4%
28	 59.6%		 60.9%		 84.2%
29	 61.7%		 63.0%		 85.8%
30	 63.8%		 65.2%		 87.4%
31	 66.0%		 67.4%		 88.9%
32	 68.1%		 69.6%		 90.3%
33	 70.2%		 71.7%		 91.6%
34	 72.3%		 73.9%		 92.8%
35	 74.5%		 76.1%		 93.9%
36	 76.6%		 78.3%		 94.9%
37	 78.7%		 80.4%		 95.8%
38	 80.9%		 82.6%		 96.7%
39	 83.0%		 84.8%		 97.4%
40	 85.1%		 87.0%		 98.1%
41	 87.2%		 89.1%		 98.6%
42	 89.4%		 91.3%		 99.1%
43	 91.5%		 93.5%		 99.4%
44	 93.6%		 95.7%		 99.7%
45	 95.7%		 97.8%		 99.9%
46	 97.9%		100.0%		100.0%

Replies are listed 'Best First'.
Re: Poker Odds for Texas Holdem / Omaha
by dragonchild (Archbishop) on Mar 03, 2004 at 00:42 UTC
    Although you cannot adjust the official odds based on the number of players, you can adjust the estimated odds by how people have been betting. For example, let's say I'm holding 7-8 unsuited in a 6-man game and the flop is free. It's 5-6-K, no flush possibilities. You're the wheel. The betting is check, raise, fold, fold, see to you. My estimations of the hands would be:
    1. Face(not King)-5/6
    2. K-x
    3. 10-7 (or so)
    4. J-8 (or so)
    5. A-x

    Given that, the odds change quite a bit. Intead of 8 outs from 47 cards, it's actually 8 outs from around 39 cards. That's 20.5% (37.2% for either). Compare that to your official 17.0% (31.5% for either).

    Let's change the game. You've got 9-10 suited. Intead of 5-6-K, it's 2-6-K, but the 2-6 is your suit. All other things are the same. So, we now have 9 outs in 39 cards. Your number is 19.1% (35.0%). My number is 23.1% (41.3%). If I've got a medium stack, that extra 4-6% means a lot.

    The numbers are all well and good, but you can't depend on them. 6% is 1 of 16. That means, with reading the bets, you'll win an extra hand every hour. I don't know about you, but I wouldn't mind that.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

      Let's change the game. You've got 9-10 suited. Intead of 5-6-K, it's 2-6-K, but the 2-6 is your suit. All other things are the same. So, we now have 9 outs in 39 cards. Your number is 19.1% (35.0%). My number is 23.1% (41.3%). If I've got a medium stack, that extra 4-6% means a lot.

      In this second scenario, you know practically nothing about the suits of the players cards based on observations of their bets.

      If you are decreasing the number of remaining cards, you must also decrease the number of outs by the expected number of outs contained in those cards. If you go from 47 to 37 remaining cards, you must also lower your number of outs from 9 to about 7. Now you are back at %18.9. You can't get something for nothing.

      PokerFoo

Re: Poker Odds for Texas Holdem
by coder_ (Initiate) on Mar 14, 2004 at 13:52 UTC
    A more useful program would be to estimate the odds of you hole cards vs. any random "hot/cold" hand before the flop. It would tell you probability of you all-in vs. one caller who hasn't looked @ their cards basically. :) I would also replace the Turn column with the Both column and rename the Both column, Turn. The true probability of you making one of your outs is in fact both turn and river @ the turn. Cool idea, not useful. Need to account for more variables, assuming heads-up only situation with 47 cards in the deck per flop isn't helpful.

      I'm not 100% sure what you mean here...

      There have been others in this thread who have commented that it's a good idea to make some sort of estimate as to what the other players had in their pockets, and that you can use that estimate to increase the probability of your outs coming up (if you were correct). Is this what you were implying when you referenced the 47 card deck and the hold/cold hand?

      If you're suggesting that I change the order of the columns, that's an adjustement you're able to make on your own, I'm sure. My "river" column represents what your chances would be of making your outs if you were on the turn, and you wanted to hit it on the river. It doesn't represent the chances of hitting your outs on the river, from the flop. Sorry if there was any confusion about that.

        Basically this, notice the minute difference in probability for Turn then for River? Which you obviously know is simply because you are taking one card out of the equation. More useful knowledge is your odds of winning after the flop with the turn and river both left. Therefore it would make more sense to have your "Either" column listed as "Turn", since you still have turn and river to catch. After the Turn, your River column is fine. Do you follow why I suggest this? Obviously its only a suggestion of how you display your data, but how useful is information regarding "am I going to catch on the turn or river", when what you really consider is "what are the odds of me catching after the flop? what are the odds of catching after the turn?". Where the odds of catching after the flop is the Probability of 1 in 47 + 1 in 46 and after the turn 1 in 46. Basically.
        Too many people use the odds for both the turn and the river when in all actuality it doesnt matter what they are collectively after flop unless you are committed to staying around to see the river if your card(s) don't come on the turn and you want to ignore the odds of the river alone.
Re: Poker Odds for Texas Holdem
by Vautrin (Hermit) on Mar 06, 2004 at 19:47 UTC
    It doesn't look like you're actually calculating any odds, you're just taking some odds you've gotten from somewhere, correct? There are so many variables in a typical poker game that witout more rigorous calculations I would not trust my money to your program.

    Want to support the EFF and FSF by buying cool stuff? Click here.

      Well, there are a lot of people who've written a lot better stuff on poker odds: Sklansky, for example (and if you want to google "nofoldem" you might find something).

      That being said, I'm pretty sure that this does produce accurate results for the scenarios I mentioned: what are the odds of hitting a four-flush from the flop to the river? I think roughly 31.5%

      As to how to use that information, therein lies the art of poker. I just wanted something that I could take a quick look at if I wanted to know my chances of hitting a certain card.

      --Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://333396]
Approved by Roger
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2022-06-27 23:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (89 votes). Check out past polls.

    Notices?