konglify
konglify
  • Threads: 28
  • Posts: 160
Joined: Aug 28, 2014
September 23rd, 2017 at 11:10:40 AM permalink
Hi there,
I spent some times to read this thread https://wizardofvegas.com/forum/questions-and-answers/math/26688-how-to-map-the-2-598-960-vp-hands-into-134-459-unique-hands/ about mapping 5-card hand from one deck to 134459 hands. To learn the code, I start with Jacks or better, enumerate each of the 134459 hands, consider 32 possible way to discard the card (including discarding none) and evaluate the win with each trial, then find out discard which and how many cards will lead to maximum pay. I then multiply the maximum pay with the total # of duplicate of that distinct hand and the probability of getting the hand. Repeat the similar procedure for all 134459 hands and sum up all payback, that will give me the return to player for the game in given pay table.

I am looking other video poker games. One of them is DEUCE BONUS, in which DEUCE acts as wild. But the initial distinct hands for analysis should not change at all so that 134459 hands is still a good and correct hands for analysis, are they?

Another game is joker poker there 53 cards used (1 is joker). In this case, I don't think the 134459 hands works but is it any way to reduce the joker included deck to some distinct hands as well or it will take me to long to do the analysis for all 5-card combination from 53 cards.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6679
Joined: Jun 22, 2011
September 23rd, 2017 at 12:09:20 PM permalink
Deuces wild - or, for that matter, any other game where any of the existing 52 cards are wild - will not change the mapping of the 2,598,960 hands to the 134,459 "unique" hands. What will change, of course, is the types of hands those 134,459 hands become. For example, in deuces wild, the unique hand, "four deuces and a six" is a "four deuces" hand, while "ace and deuce of one suit, ace of a second suit, deuce of a third suit, and five of the remaining suit" becomes "four of a kind" (instead of "two pair" in games without wild cards).

On the other hand, if you add a joker, the number of total hands is now (53)C(5) = 2,869,685, and there are more than 134,459 unique hands as you have to include all of the unique hands that include a joker - for example, "joker and four aces," "joker and A-K-5-3 suited," and "joker, a pair of kings, a three matching one of the kings' suits, and a six that does not match either king's suit."

I think there are 16,432 additional unique hands if there is one joker in the deck:

Joker and four of a kind - 13 hands
Joker, three of a kind, and a card matching one of the suits in the three - 156 x 12 hands (13 values for the three of a kind, 12 for the value of the fourth card, 4 sets of three suits for the three of a kind, and 3 possible suits for the fourth card)
Joker, three of a kind, and a card not matching one of the suits in the three - 156 x 4 hands (13 values for the three of a kind, 12 for the value of the fourth card, and 4 sets of three suits for the three of a kind; there is only one possible suit for the fourth card in this case)
Joker and two pair, where the suits in the higher pair match the suits in the lower pair - 78 x 6 hands
Joker and two pair, where one suit in the higher pair matches a suit in the lower pair - 78 x 24 hands
Joker and two pair, where no suits in the higher pair match the suits in the lower pair - 78 x 6 hands
Joker, pair, and two singles, where the singles are the same suit and it is one of the suits in the pair - 858 x 12 hands
Joker, pair, and two singles, where the singles are the same suit but it is not of the suits in the pair - 858 x 12 hands
Joker, pair, and two singles, where the singles are different suits and both suits match the suits in the pair - 858 x 12 hands
Joker, pair, and two singles, where the singles are different suits and the higher single's suit matches a suit in the pair - 858 x 24 hands
Joker, pair, and two singles, where the singles are different suits and the lower single's suit matches a suit in the pair - 858 x 24 hands
Joker, pair, and two singles, where the singles are different suits and neither suit matches a suits in the pair - 858 x 12 hands
For the hands that are a joker and four different values:
715 x 4 hands have the four cards in the same suit
715 x 12 x 4 hands have three cards suited but the fourth is a different suit
715 x 12 x 3 hands have two cards of one suit and two cards of another
715 x 24 x 6 hands have two cards of one suit, one of a third suit, and the remaining card the remaining suit
715 x 24 hands have the four cards be all different suits

BobDancer
BobDancer
  • Threads: 21
  • Posts: 200
Joined: Jun 22, 2013
September 23rd, 2017 at 8:54:08 PM permalink
The mapping in 134,459 hands isn't very efficient in Deuces Wild, because deuces are suitless.

Four example, in the hand 44422, in Jacks or Better there are two separate ways this can be mapped --- namely

1. the suit of both deuces are included in the three suits for the fours --- there are 12 ways for this to happen
2. the suit of one of the deuces is different than the three suits for the fours --- thee are also 12 ways for this to happen.

In Deuces Wild --- there are 4 ways to be dealt three fours and 6 ways to be dealt two deuces --- for a total of 24 ways for this hand to be dealt. Whether the deuces are suited with how many of the fours is totally irrelevant in this game.
DeMango
DeMango
  • Threads: 36
  • Posts: 2958
Joined: Feb 2, 2010
September 24th, 2017 at 12:32:18 AM permalink
All this work for what? Reinventing the wheel???
When a rock is thrown into a pack of dogs, the one that yells the loudest is the one who got hit.
konglify
konglify
  • Threads: 28
  • Posts: 160
Joined: Aug 28, 2014
September 24th, 2017 at 3:59:56 AM permalink
Quote: ThatDonGuy

Deuces wild - or, for that matter, any other game where any of the existing 52 cards are wild - will not change the mapping of the 2,598,960 hands to the 134,459 "unique" hands. What will change, of course, is the types of hands those 134,459 hands become. For example, in deuces wild, the unique hand, "four deuces and a six" is a "four deuces" hand, while "ace and deuce of one suit, ace of a second suit, deuce of a third suit, and five of the remaining suit" becomes "four of a kind" (instead of "two pair" in games without wild cards).

On the other hand, if you add a joker, the number of total hands is now (53)C(5) = 2,869,685, and there are more than 134,459 unique hands as you have to include all of the unique hands that include a joker - for example, "joker and four aces," "joker and A-K-5-3 suited," and "joker, a pair of kings, a three matching one of the kings' suits, and a six that does not match either king's suit."

I think there are 16,432 additional unique hands if there is one joker in the deck:


Joker and four of a kind - 13 hands
Joker, three of a kind, and a card matching one of the suits in the three - 156 x 12 hands (13 values for the three of a kind, 12 for the value of the fourth card, 4 sets of three suits for the three of a kind, and 3 possible suits for the fourth card)
Joker, three of a kind, and a card not matching one of the suits in the three - 156 x 4 hands (13 values for the three of a kind, 12 for the value of the fourth card, and 4 sets of three suits for the three of a kind; there is only one possible suit for the fourth card in this case)
Joker and two pair, where the suits in the higher pair match the suits in the lower pair - 78 x 6 hands
Joker and two pair, where one suit in the higher pair matches a suit in the lower pair - 78 x 24 hands
Joker and two pair, where no suits in the higher pair match the suits in the lower pair - 78 x 6 hands
Joker, pair, and two singles, where the singles are the same suit and it is one of the suits in the pair - 858 x 12 hands
Joker, pair, and two singles, where the singles are the same suit but it is not of the suits in the pair - 858 x 12 hands
Joker, pair, and two singles, where the singles are different suits and both suits match the suits in the pair - 858 x 12 hands
Joker, pair, and two singles, where the singles are different suits and the higher single's suit matches a suit in the pair - 858 x 24 hands
Joker, pair, and two singles, where the singles are different suits and the lower single's suit matches a suit in the pair - 858 x 24 hands
Joker, pair, and two singles, where the singles are different suits and neither suit matches a suits in the pair - 858 x 12 hands
For the hands that are a joker and four different values:
715 x 4 hands have the four cards in the same suit
715 x 12 x 4 hands have three cards suited but the fourth is a different suit
715 x 12 x 3 hands have two cards of one suit and two cards of another
715 x 24 x 6 hands have two cards of one suit, one of a third suit, and the remaining card the remaining suit
715 x 24 hands have the four cards be all different suits



Thanks. I find that the original code you post have 3 columns in UniqueHands[134459][3], so if I need to consider a different game says one specific game in which 4 of a kinds will break into different pays, 4 ACES and 4 DEUCES and all other 4 of a kinds pays differently, does it mean I should map the original COMB(52,5) hands into something more than 134459 hands since I am breaking the case for 4 of a kind into sub groups.

I copy and paste your code and did minor modification to c++, 99% of code unchanged, but after I generate the map of 134459 hands, I would like to have sanity check by adding all UniqueHands[n][1] up, however it only gives me 2588664 hands instead. I am comparing my code to the original code to see if I am missing something
Last edited by: konglify on Sep 24, 2017
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6679
Joined: Jun 22, 2011
September 24th, 2017 at 1:52:07 PM permalink
Quote: konglify

Thanks. I find that the original code you post have 3 columns in UniqueHands[134459][3], so if I need to consider a different game says one specific game in which 4 of a kinds will break into different pays, 4 ACES and 4 DEUCES and all other 4 of a kinds pays differently, does it mean I should map the original COMB(52,5) hands into something more than 134459 hands since I am breaking the case for 4 of a kind into sub groups.


No. The three columns are there for (a) pointing to the pay table, (b) having a count of how many of the 2,598.960 hands point to that Unique Hand, and (c) a pointer back to one of the 2,598,960 hands that point to the Unique Hand. The last two columns are used to calculate a game's entire expected return faster than going through all 2,598,960 hands one at a time.

If you switch from, say, Jacks or Better to Double Bonus (where four Aces, four 2s-4s, and four 5s-Kings pay different things), then the only change in the UniqueHands table would be, in the [0] column, each four-of-a-kind points to the correct pay table value. There would still be only four hands that point to the Unique Hand of "four Aces and a 10," so the [1] column does not change.

Quote: BobDancer

The mapping in 134,459 hands isn't very efficient in Deuces Wild, because deuces are suitless.

Four example, in the hand 44422, in Jacks or Better there are two separate ways this can be mapped --- namely

1. the suit of both deuces are included in the three suits for the fours --- there are 12 ways for this to happen
2. the suit of one of the deuces is different than the three suits for the fours --- thee are also 12 ways for this to happen.

In Deuces Wild --- there are 4 ways to be dealt three fours and 6 ways to be dealt two deuces --- for a total of 24 ways for this hand to be dealt. Whether the deuces are suited with how many of the fours is totally irrelevant in this game.


True, but I found that keeping the 134,459 hands for a standard 52-card deck easier when switching between games.
konglify
konglify
  • Threads: 28
  • Posts: 160
Joined: Aug 28, 2014
September 24th, 2017 at 7:18:58 PM permalink
Quote: ThatDonGuy

Quote: konglify

Thanks. I find that the original code you post have 3 columns in UniqueHands[134459][3], so if I need to consider a different game says one specific game in which 4 of a kinds will break into different pays, 4 ACES and 4 DEUCES and all other 4 of a kinds pays differently, does it mean I should map the original COMB(52,5) hands into something more than 134459 hands since I am breaking the case for 4 of a kind into sub groups.


No. The three columns are there for (a) pointing to the pay table, (b) having a count of how many of the 2,598.960 hands point to that Unique Hand, and (c) a pointer back to one of the 2,598,960 hands that point to the Unique Hand. The last two columns are used to calculate a game's entire expected return faster than going through all 2,598,960 hands one at a time.

If you switch from, say, Jacks or Better to Double Bonus (where four Aces, four 2s-4s, and four 5s-Kings pay different things), then the only change in the UniqueHands table would be, in the [0] column, each four-of-a-kind points to the correct pay table value. There would still be only four hands that point to the Unique Hand of "four Aces and a 10," so the [1] column does not change.


True, but I found that keeping the 134,459 hands for a standard 52-card deck easier when switching between games.



Thanks. But one of my last question is asking those 134459 hands doesn't add up back to 2598960 hands if you sum up all UniqueHands[134459][1].
  • Jump to: