--- In pokersource@yahoogroups.com, "scottsen72" <scottsen72@y...>
wrote:
> Hi folks,
>
> I am trying to use the PokerSource eval package to enumerate and
> evaluate all the first 2 hole cards for texas holdem. The good
news
> is I got it to work (which as a windows user was a bit of a
feat).
Great! As you know, the windows support isn't the best. If you
made any generic changes that could help other people, you might
consider getting involved as a contributor. It would be nice to get
the Windows makefiles and other details cleaned up.
> Things bothering me:
> 1) the results. According to my results, pairs rule! The the
point
> of 8,8 being better than A,K suited. That doesn't sound right to
> me. If I had to guess, its in the way I handle ties.
Based on a quick scan of your code, it looks like you want to
compute the 2-player (heads-up) holdem preflop matchups. Your
handling of ties looks right to me. In the heads-up case 88 has a
slight lead over AK, so your results might be right. It depends on
suits, as you know, but for example:
$ pokenum 8c 8h Ah Kh
Holdem Hi: 1712304 enumerated boards
cards win %win lose %lose tie %tie EV
8c 8h 897979 52.44 806758 47.12 7567 0.44 0.527
Ah Kh 806758 47.12 897979 52.44 567 0.44 0.473
>
> 2) I couldn't figure out a good way to enumerate all the possible
> hands, without having a bunch of duplicatation (like evaluating
both
> unsuited combos, Ac 7s and As 7c).
Right, that is a common problem. There are two basic approaches.
The first one is to ignore it and let the brute-force power of the
computer simply count all the cases. Depending on your application,
this might be fine. The second approach is to identify all
the "equivalence classes" and then only compute the answer once for
each equivalence class. In the case of 88 vs AK, the classes and
results are:
matchup AKwin 88win tie
AsKs8s8h 806758 897979 7567
AsKs8h8d 813957 892317 6030
AsKh8s8h 770850 933653 7801
AsKh8s8d 764535 941337 6432
AsKh8h8d 764577 941294 6433
AsKh8d8c 758262 948978 5064
In the above, I've noticed that there are only 6 distinct ways that
AK and 88 can meet in a matchup. Then I've evaluated all possible
48c2 boards for each matchup to give the final result.
You can take this a step further by asking how many different boards
are there? For example, in AsKh vs 8s8h, you might put all the
boards with five diamonds or five clubs into one class. Or all the
boards with ranks AAKxy (x, y != 8) into another. Andrew Prock's
Pokerstove is an example of this approach.
>
> 3) The enumerations I *do* use in main() are only 1 card, and use
a
> dead mask that was setup in a freaky loop.
That is sort of freaky. As a point of advice, I suggest you follow
a two-step plan. Step one is to convince yourself that the basic
enumeration is working correctly without trying to eliminate the
duplicates. Do it by brute force first. Once you are sure that is
working, then you have a baseline that you can optimize against by
considering the equivalence classes.
Good luck!
-Michael Maurer