
Posted Thu Aug 10, 2006 9:09 pm GMT by ToyMachine22122
Basically I'm just trying to make a calculator for pre- and post-flop odds...nothing that hasn't been done before. I'm writing it in a bit of a weird language (as requested by a friend) though so I can't really find anything to build off of.
Is there anywhere I can find a list of all the formulas for calculating odds?
Like on this site, for instance, the PF odds calculator is awesome and shows you odds and stuff for like how many overcards etc...what are the formulas for that stuff?
Did you know that participating in a poker forum can help you improve your own game? Be it by sharing experiences or simply asking for help, participation in a forum helps you focus and keep 'on topic' which will help you improve your game. You can learn from other players feedback and from their experiences. Why the THP poker forums? We offer one of the best managed texas holdem poker forums available, and the community within is far more friendly than those typicaly found on other sites. We've made a 'lurkers edition' of the poker forum available here on Holdem Poker Online, but we encourage all visitors to register and join in on the conversations on TexasHoldem-Poker.com
Posted Thu Aug 10, 2006 11:29 pm GMT by snoogins47
| ToyMachine22122 wrote: | Basically I'm just trying to make a calculator for pre- and post-flop odds...nothing that hasn't been done before. I'm writing it in a bit of a weird language (as requested by a friend) though so I can't really find anything to build off of.
Is there anywhere I can find a list of all the formulas for calculating odds?
Like on this site, for instance, the PF odds calculator is awesome and shows you odds and stuff for like how many overcards etc...what are the formulas for that stuff? |
Basically any calculator worth its salt is actually a simulator, that either enumerates through all the possible outcomes, or generates X random boards and compares the numbers. Some do both. Generally, the first is better when it can be used, and the second is better when it gets complex to the point where running through them all isn't feasible time wise (which is fairly quickly, actually)
So what confuses me I guess, is, what formula(s) are you looking for? There's not really some formula where you plug in two overcards vs a pair, and get the odds of winning. You can usually approximate using simple arithmetic (flush draw has 9 outs against X on the flop, so there's a 9/45 chances he'll hit on the turn, 9/44 that he'll hit the river when he misses the turn, and you can kinda ignore the uber longshots of runner-runner board straights to split, etc)
The 45 is assuming the pot is heads up and we don't know any exposed cards... two hands of two cards each and the three flop cards are known
Admittedly I'm nowhere near an experienced programmer, but I can't possibly see a scenario where that could work... what would the user input be?
If you're just looking for the basics of calculating these probability things, it's all basically the same thing, with differing levels of complexity. For instance the 9 out thing:
45 unknown cards left in the deck, 9 that improve him, and we'll ignore any redraws and so forth. He hits on the turn 9/45 times, and when he misses, he still improves 9/44 of those times. So
| Code: |
9/45 + [(36/45) * 9/44]
(Hit Turn) Misses Turn Hit River
|
You can see how all sorts of little longshots and redraws can complicate this calculation (it keeps branching and branching. What if the turn card is a flush card that pairs the board? What about a non-flushcard that does the same? A non-flush card that pairs up either one of them?) and as I said, it's slightly different for (almost?) every situation.
As far as I'm aware (and I may well be wrong; please somebody let me know if I'm missing something obvious) your best bet is to attack it from a simulation angle: basically, since we're trying to take game situations and derive odds from them, we're going to need to model game situations.
As for advice on that front: that gets more complicated, and I'm probably not the man for the job. I wrote a sim program a year or two back in QBasic mostly out of boredom and to see if I could do it (I made random Basic things back when I was a kid, but hadn't done anything in over 10 years... and I was just a kid, so I didn't really know how to code back then anyway) but I lost interest before I even tried to implement a sim that enumerated all possibilities (just did the 'monte carlo' thing where it would run X random trials) and chances are overwhelming that I did everything in a horribly inefficient manner, because that's how I roll.
If you do end up attacking it from that side of things, there's plenty of people smarter than me that you can probably get all the help you need from. Good luck
You may want to take a look, even if it's not in your language, at some of the poker progs out there. I don't recall what it's called but I'm pretty sure I've seen at least one open-source poker 'game' program, and one open-source calculator/sim. Google it up.
Posted Fri Aug 11, 2006 3:27 pm GMT by Muck
Nice post snoogins, very comprehensive As you said there aren’t really any formulas just algorithms to generate every possible outcome and see who wins.
I coded a brute force simulator to see if there was any potential edge in the Betfair Poker Exchange.

|
|