Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java library to calculate the equity of texas poker hands

Tags:

java

poker

Does anyone know a fast java algorithm\library to calculate the equity or the probability of winning (as the program PokerStove) of texas poker hands?

like image 910
Webman Avatar asked Feb 22 '23 16:02

Webman


1 Answers

Oh that's my domain ; )

As fast as PokerStove it's very, very hard to do because PokerStove is incredibly fast. However there are several evaluators out there that are quite interesting.

It all depends on how much memory you're willing to use for this and what are your exact needs. For example there are now quite good online evaluators that do not require any program to be installed (PokerStove needs to be installed).

People who wrote great (that is: fast, darn fast) poker evaluators go by the names of "Cactus Kev", "Paul Senzee", "Steve Brecher", etc. (Googling them should lead you to great threads on various forums).

If you've got 133 MB to spare, then there's RayW's big lookup table. The code to evaluate a 7-card hand basically becomes a gigantic table lookup. You can hardly beat that.

Note that PokerStove itself is a bit limited in what it can do. Take the following scenario:

  1. Ac Ad all-in preflop with a stack of $25
  2. As Ks all-in preflop with a stack of $25
  3. Qh Qd all-in preflop with a stack of $10

Well, you cannot compute all these equities in one pass in PokerStove. You must first compute the equities for the first pot and then compute the equities for Ac Ad vs As Ks for the second pot, using Qh Qd as dead cards. It can be done, but it's kinda painful: you have to manually compute the pot sizes and you have to run two different computation in PokerStove.

If this is real-money Hold'em, you also must take into account the rake or your computation are flawed.

like image 65
TacticalCoder Avatar answered Mar 23 '23 02:03

TacticalCoder