Poker Equity Calculator

Log in to Vote
1 Vote • 2 Comments
I’d be interested in making a poker equity calculator, somewhat similar to, although probably only supporting holdem, and maybe limited to only 2 players.

Sample query would be (syntax could probably be improved, but just as an example):
AA-22 v AK,AQ,AJ
*h*h v TcTs on 8hTh2s

and the instant answer would return the equities of the two ranges:
AA-22: 57.9%, AK, AQ, AJ: 42.41%
*h*h: 28.22%, TcTs: 71.78%

I put together a 7-card hand evaluator in perl that's doing about 200k evals/sec on my machine (MacBook Air 1.8Ghz) using technique similar to the now open-sourced pokerstove:

Unfortunately 200k evals/sec really isn’t that great. There's definitely a few ways this can be improved upon, the easiest being to use larger lookup tables (I’m currently only using a few very small tables). However, an equity calculator in perl would likely have to fall back on using monte carlo simulations instead of full enumerations significantly more often then one written in c or c++.

So I guess I have a few questions then,
1. Is it acceptable for an instant answer to take a few seconds to execute? If we’re running 400k random hands to get an approximation of equities, that's ~2sec @ 200k/sec. Like I mentioned before there are ways to improve on this, and obviously you can play around with how many hands need to be run to get a good approximation, but still for everything besides non-trivial queries the instant answer would probably be noticeably non ‘instant’.

2. Is this something that would even be a good idea as an instant answer? As a poker player who uses DDG I think it would be cool, and is much more interesting and useful then static statistics like how many ways there are to make a flush or a straight. However it is a little bit different and would have to be a little less ‘instant’ then a lot of other IAs, so wondering if maybe it just isn't appropriate for the format.

Anyway, very much looking forward to hacking, been a big fan of DDG for a while now.
• posted 4 years and 1 month ago • type: Goodie (Perl functions) Needs a Developer

It's a very interesting idea, but taking a few seconds to load an IA like this is almost akin to what happened with Wolfram Alpha- it would take a few seconds to load, and by then, the user was halfway down the page of results, and the answer would "pop" the entire page down, which made it kind of annoying. Because of this, I don't think I would recommend making this IA to the scale you proposed; is there a way around this?
posted by javathunderman Community Leader4 years and 1 month ago Link
Although its not quite as cool in my opinion, calculating hand vs hand instead of range vs range would be a lot simpler. You'd just need a ~1MB look up table for hands preflop, and after the flop calculations should be able to return almost instantly.

I might try to do this since I don't think it would be too difficult to add on to what I already have, and could be expanded on later to support range vs range if that made sense to do.
posted by <hidden> • 4 years and 1 month ago Link