Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26497
Joined: Oct 14, 2009
December 31st, 2013 at 9:40:01 AM permalink
Pai gow poker has combin(53,7)*combin(46,7) = 8,250,459,031,214,390 possible combinations. For each of these, two seven-card hands must be scored. Non-programmers may be saying "so?" at this point. Dealing with numbers this big it can take months or years to run through them all, depending in the speed of the computer and how fast the program is.

Our own JB is a master of doing huge calculation jobs quickly. Just this morning he completed what as far as I know is the first perfect analysis of pai gow poker. Previously, my analysis, and as far as I know, all others, were based on random simulations. I don't remember how long JB's program took to cycle through all 8.25 quadrillion combinations, but it was about two or three months.

His results can be found on my pai gow poker page. House way against house way, when not banking, his house edge is 0.01% less than my previously-published figure. When banking, his figure is 0.05% higher.

You can also see JB analyzed the game with optimal strategy. The tables show that using optimal strategy lowers the house edge by 0.21%. So far this bit information is pretty trivial, as I'm sure the number of people on the planet that know perfect pai gow poker strategy is zero. However, it gives us a goal to shoot for in terms of strategies we will be publishing soon.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
beachbumbabs
beachbumbabs
  • Threads: 100
  • Posts: 14265
Joined: May 21, 2013
December 31st, 2013 at 9:53:27 AM permalink
Quote: Wizard

Pai gow poker has combin(53,7)*combin(46,7) = 8,250,459,031,214,390 possible combinations. For each of these, two seven-card hands must be scored. Non-programmers may be saying "so?" at this point. Dealing with numbers this big it can take months or years to run through them all, depending in the speed of the computer and how fast the program is.

Our own JB is a master of doing huge calculation jobs quickly. Just this morning he completed what as far as I know is the first perfect analysis of pai gow poker. Previously, my analysis, and as far as I know, all others, were based on random simulations. I don't remember how long JB's program took to cycle through all 8.25 quadrillion combinations, but it was about two or three months.

His results can be found on my pai gow poker page. House way against house way, when not banking, his house edge is 0.01% less than my previously-published figure. When banking, his figure is 0.05% higher.

You can also see JB analyzed the game with optimal strategy. The tables show that using optimal strategy lowers the house edge by 0.21%. So far this bit information is pretty trivial, as I'm sure the number of people on the planet that know perfect pai gow poker strategy is zero. However, it gives us a goal to shoot for in terms of strategies we will be publishing soon.



This is a fanTAStic addition to the site, Wiz; JB, you are a rock star! Thanks for doing this!
If the House lost every hand, they wouldn't deal the game.
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
December 31st, 2013 at 9:55:33 AM permalink
It is probably worth mentioning that I did my analysis using the Foxwoods house way.
AcesAndEights
AcesAndEights
  • Threads: 67
  • Posts: 4300
Joined: Jan 5, 2012
December 31st, 2013 at 10:19:09 AM permalink
Nice! I just received Wong's book on PGP strategy in the mail, although I haven't cracked it yet. Looking forward to the forthcoming strategies.

Any reason for using the Foxwoods house way? The Wiz seems to prefer the Trump Plaza house way for "baselines" like this. I have asked the question, "Why the Trump Plaza house way?" in the past, and no one has answered :).
"So drink gamble eat f***, because one day you will be dust." -ontariodealer
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
December 31st, 2013 at 10:26:40 AM permalink
Quote: AcesAndEights

Any reason for using the Foxwoods house way?


I chose the Foxwoods house way because it has an exception which many house ways do not have, leading me to believe that it's one of the stronger house strategies.
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
December 31st, 2013 at 10:41:50 AM permalink
Quote: Wizard

Pai gow poker has combin(53,7)*combin(46,7) = 8,250,459,031,214,390 possible combinations. For each of these, two seven-card hands must be scored. Non-programmers may be saying "so?" at this point. Dealing with numbers this big it can take months or years to run through them all, depending in the speed of the computer and how fast the program is.

Our own JB is a master of doing huge calculation jobs quickly. Just this morning he completed what as far as I know is the first perfect analysis of pai gow poker. Previously, my analysis, and as far as I know, all others, were based on random simulations. I don't remember how long JB's program took to cycle through all 8.25 quadrillion combinations, but it was about two or three months.


Nice work. A few questions:
1) What tech are you using? I'm starting to investigate using GPGPU / stream processing and I'd be open to collaboration; one article I read reported a 70x speedup between a high-end GPU and a high-end CPU. I'm not that optimistic, but even a 20x speedup reduces 3 months to less than a week.
2) Are you going to be researching easier and/or stronger house ways? This is likely dependent on having an analysis engine capable of faster iteration frequencies than 3 months, but the generic procedure for finding at least a locally-optimum house way is described in Gwynn's paper on Pai Gow (tiles) from Finding The Edge, and I know you've see that already.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
December 31st, 2013 at 11:22:05 AM permalink
Quote: MathExtremist

What tech are you using? I'm starting to investigate using GPU / stream processing and I'd be open to collaboration; one article I read reported a 70x speedup between a high-end GPU and a high-end CPU. I'm not that optimistic, but even a 20x speedup reduces 3 months to less than a week.


Just my home desktop computer. I looked into GPU processing, specifically Microsoft Accelerator (since I write in C#), but scrapped the idea because it looked like a very difficult task to convert the process from "normal" to being something a GPU could process. Plus, I don't have a fancy GPU anyway.

Quote: MathExtremist

Are you going to be researching easier and/or stronger house ways? This is likely dependent on having an analysis engine capable of faster iteration frequencies than 3 months, but the generic procedure for finding at least a locally-optimum house way is described in Gwynn's paper on Pai Gow (tiles) from Finding The Edge, and I know you've see that already.


I don't plan on doing other house ways at this point. I do have my eye on a new computer, which should be able to do a full analysis in less than 2 weeks.
Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26497
Joined: Oct 14, 2009
December 31st, 2013 at 12:26:49 PM permalink
Quote: AcesAndEights

Nice! I just received Wong's book on PGP strategy in the mail, although I haven't cracked it yet. Looking forward to the forthcoming strategies.



Wong's book is based on the California version with a fully wild joker. I was disappointed to learn this when I bought the book.

Quote:

"Why the Trump Plaza house way?" in the past, and no one has answered :).



I use the Trump Plaza house way because it was the first house way I obtained. A floorman there was kind enough to let me copy it down from a printout of it he found in the pit.

Just prior to this the Atlantic City Tropicana refused to let me see theirs, despite the fact their rule booklet for pai gow poker said the house way was available upon request. When I requested it the floorman at the Trop found it and was just about to let me see it when he noticed it didn't have the phone number for Gambler's Anonymous on it, so he changed his mind. I asked if he could just write down the phone number with a pen on the piece of paper. He thought about it for a second, but then said "no." At the Trump Plaza there were no arguments at all.

Once I got home and programmed it I just have always stuck with it, since programming a PGP house way is time consuming.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
AxiomOfChoice
AxiomOfChoice
  • Threads: 32
  • Posts: 5761
Joined: Sep 12, 2012
December 31st, 2013 at 12:50:56 PM permalink
Quote: Wizard

Wong's book is based on the California version with a fully wild joker. I was disappointed to learn this when I bought the book.



I use the Trump Plaza house way because it was the first house way I obtained. A floorman there was kind enough to let me copy it down from a printout of it he found in the pit.

Just prior to this the Atlantic City Tropicana refused to let me see theirs, despite the fact their rule booklet for pai gow poker said the house way was available upon request. When I requested it the floorman at the Trop found it and was just about to let me see it when he noticed it didn't have the phone number for Gambler's Anonymous on it, so he changed his mind. I asked if he could just write down the phone number with a pen on the piece of paper. He thought about it for a second, but then said "no." At the Trump Plaza there were no arguments at all.

Once I got home and programmed it I just have always stuck with it, since programming a PGP house way is time consuming.



Does gaming (or whatever the AC equivalent is) really allow them to offer a game with secret rules? What's to stop the dealer from just setting his hand in whatever way beats yours (assuming that such a setting exists)?

Also: JB, have you considered paying for CPU time on Amazon EC2? It would allow you to complete your analysis much faster (since you can run as many simultaneous instances as you want, and you only pay for the time you use, so running on 10 machines for 1/10 the time (or 100 for 1/100 the time) is the same price as running the whole thing on one machine). And this is a very easily parallelizable problem.

I've looked into it just last week for a combinatorial analysis (also of a card game) that I was doing, and it wasn't very expensive. You even get 750 CPU hrs/month for free (admittedly on a slow-ish CPU) for the first year that you sign up. I ended up doing the analysis on my laptop for 2 reasons: First, I needed about 11G ram for a large lookup table (and the free tier on Amazon is a little ram-limited -- but it would be fine for analyzing PGP), and, second, even on a slow laptop CPU, using 1 out of the 4 virtual CPUs, it only took 3.5 days, so it was easier than setting up the EC2 stuff) but if the job had been bigger I would have definitely gone that route.
AcesAndEights
AcesAndEights
  • Threads: 67
  • Posts: 4300
Joined: Jan 5, 2012
December 31st, 2013 at 3:15:52 PM permalink
Quote: Wizard

Wong's book is based on the California version with a fully wild joker. I was disappointed to learn this when I bought the book.


Blast! I did not know that either.

Quote: Wizard

I use the Trump Plaza house way because it was the first house way I obtained. A floorman there was kind enough to let me copy it down from a printout of it he found in the pit.

Just prior to this the Atlantic City Tropicana refused to let me see theirs, despite the fact their rule booklet for pai gow poker said the house way was available upon request. When I requested it the floorman at the Trop found it and was just about to let me see it when he noticed it didn't have the phone number for Gambler's Anonymous on it, so he changed his mind. I asked if he could just write down the phone number with a pen on the piece of paper. He thought about it for a second, but then said "no." At the Trump Plaza there were no arguments at all.

Once I got home and programmed it I just have always stuck with it, since programming a PGP house way is time consuming.


Thanks for the background. I was always curious about that.
"So drink gamble eat f***, because one day you will be dust." -ontariodealer
Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26497
Joined: Oct 14, 2009
December 31st, 2013 at 3:26:52 PM permalink
Quote: AxiomOfChoice

Does gaming (or whatever the AC equivalent is) really allow them to offer a game with secret rules? What's to stop the dealer from just setting his hand in whatever way beats yours (assuming that such a setting exists)?



Yes. Vegas too. In my opinion there should be a regulation that the player has the right to know the rules of any game in the casino. Until then, yes, the dealer can pretty much set his hand any old way and say "that is the house way." I suspect a lot of dealer's don't even know the current and official house way where they work and follow an old one or one from another casino. It has happened to me in tiles a lot of times where the dealer set the hand one way and the floor reset it another way, against me, saying "we added a new rule for this situation."
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
sodawater
sodawater
  • Threads: 64
  • Posts: 3321
Joined: May 14, 2012
December 31st, 2013 at 3:52:40 PM permalink
very nice job, wiz and JB.
98Clubs
98Clubs
  • Threads: 52
  • Posts: 1728
Joined: Jun 3, 2010
December 31st, 2013 at 7:48:41 PM permalink
Quote: JB

It is probably worth mentioning that I did my analysis using the Foxwoods house way.



IIRC, this is close to the Trump Plaza way used originally.

Thanks much for an enlightening run.
Some people need to reimagine their thinking.
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
December 31st, 2013 at 9:13:15 PM permalink
Quote: AxiomOfChoice

JB, have you considered paying for CPU time on Amazon EC2? It would allow you to complete your analysis much faster (since you can run as many simultaneous instances as you want, and you only pay for the time you use, so running on 10 machines for 1/10 the time (or 100 for 1/100 the time) is the same price as running the whole thing on one machine). And this is a very easily parallelizable problem.

I've looked into it just last week for a combinatorial analysis (also of a card game) that I was doing, and it wasn't very expensive. You even get 750 CPU hrs/month for free (admittedly on a slow-ish CPU) for the first year that you sign up. I ended up doing the analysis on my laptop for 2 reasons: First, I needed about 11G ram for a large lookup table (and the free tier on Amazon is a little ram-limited -- but it would be fine for analyzing PGP), and, second, even on a slow laptop CPU, using 1 out of the 4 virtual CPUs, it only took 3.5 days, so it was easier than setting up the EC2 stuff) but if the job had been bigger I would have definitely gone that route.


I looked into Microsoft's offerings (which weren't a significant improvement over what my desktop can do) as well as Amazon's, which were difficult to decipher. My analyzer required a lot of memory for lookups as well, plus it saved a lot of data to disk, which I wasn't sure could be done with cloud computing. I suppose I could have made it just ping a URL to store the results remotely, but that would have probably either slowed things down on the cloud's end, or taxed the web server on the receiving end. So I just stuck with what I had. I guess I also prefer to have everything right in front of me anyway.
CrystalMath
CrystalMath
  • Threads: 8
  • Posts: 1911
Joined: May 10, 2011
December 31st, 2013 at 9:28:48 PM permalink
Awesome job, JB!
I heart Crystal Math.
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
December 31st, 2013 at 9:32:09 PM permalink
Quote: CrystalMath

Awesome job, JB!


Thanks. I'm looking forward to getting the strategies up, as there have been several "discoveries" which make perfect sense once you see them, but that I never would have thought of.
AxiomOfChoice
AxiomOfChoice
  • Threads: 32
  • Posts: 5761
Joined: Sep 12, 2012
January 1st, 2014 at 2:45:12 AM permalink
Quote: JB

I looked into Microsoft's offerings (which weren't a significant improvement over what my desktop can do) as well as Amazon's, which were difficult to decipher. My analyzer required a lot of memory for lookups as well, plus it saved a lot of data to disk, which I wasn't sure could be done with cloud computing. I suppose I could have made it just ping a URL to store the results remotely, but that would have probably either slowed things down on the cloud's end, or taxed the web server on the receiving end. So I just stuck with what I had. I guess I also prefer to have everything right in front of me anyway.



I agree that Amazon was a PITA to decipher. This the the main reason that I decided not to use it -- with an estimated run-time of only 3.5 days on my laptop, I figured that it was faster to just let it run than to figure out how to get an EC2 instance up and running.

Saving lots of data to disk can definitely be done in the cloud! You obviously don't want to write your own infrastructure for this, but I think that Amazon has some cloud-attached storage that you can purchase (I think that you get 30G free with your account? Again, the details were kind of difficult to figure out, but it looked like you could create a cloud storage partition and attach your instances to it.)

I'm curious to know what you are storing in a large lookup table, and what you are writing to disk. I'm not sure if you are willing to share the details, but, if you are, please PM me (or post it here if you don't think we are boring people too much) :)
socks
socks
  • Threads: 15
  • Posts: 364
Joined: Jul 13, 2011
January 1st, 2014 at 6:29:24 AM permalink
Quote: AxiomOfChoice

I'm curious to know what you are storing in a large lookup table, and what you are writing to disk. I'm not sure if you are willing to share the details, but, if you are, please PM me (or post it here if you don't think we are boring people too much) :)



While I can understand if it's proprietary, it would hardly be boring.
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
January 1st, 2014 at 12:31:26 PM permalink
Quote: AxiomOfChoice

I'm curious to know what you are storing in a large lookup table, and what you are writing to disk. I'm not sure if you are willing to share the details, but, if you are, please PM me (or post it here if you don't think we are boring people too much) :)


I had several lookup arrays but the largest ones stored the high and low hand ranks of each 7-card hand as the house would set them. There are combin(53,7) = 154,143,080 hands; I had two arrays of that length, HouseWay2[] and HouseWay5[]. Rather than pick apart the suits and ranks of each 7-card hand every time I needed to know the house's low and high hands for a 7-card combination, I would just calculate the offset into those arrays and look them up instead. (Separately, beforehand, I populated these arrays, saved their contents to disk, and then just loaded the results from disk into memory in the final analyzer since that was the fastest approach.) These two arrays consumed about 1.2GB of memory.

What I saved to disk were the outcome counts for each way to play each 7-card hand, both when the player is banking, and when the dealer is banking. This data file occupies about 2.24GB.

At this point you might be thinking that something is amiss:

     154,143,080 player hands
x 21 ways to play each hand
x 3 outcome counts per way to play
x 2 banking scenarios
x 4 bytes per count
=============================================
= 77,688,112,320 bytes


Why is the data file just over 2GB instead of 72GB? Two reasons:

1) For every possible play there are only three outcomes: win, push, or lose. There are always combin(53-7,7) = 53,524,680 possible dealer hands once the player's hand is established. Therefore, the (win + push + lose) counts always sum to 53,524,680. So I only saved the win and lose counts to disk; the push counts can always be derived as (53524680 - win - lose).

2) This is the big one. While there are combin(53,7) = 154,143,080 possible seven-card hands, only 6,972,147 of them are unique. I only analyzed each unique hand once. (I weighted their results appropriately when gathering the statistics for the game as a whole.)
socks
socks
  • Threads: 15
  • Posts: 364
Joined: Jul 13, 2011
January 1st, 2014 at 2:19:16 PM permalink
Thanks for the explanation. This doesn't seem all that novel. A tedious pain, I'm sure, but not that novel. Is the previous lack of combinatorial analysis just that no one had gotten around to it yet? If so, are there other obvious games in this category?

Also, any comments on the hand evaluator? I'm particularly interested in the cache efficiency of the hand eval if you've profiled your code to this extent. It seems like this might be important for games using a 5-card eval. My Mac mini has 6M, and I believe the computer to linked to earlier had an 8M cache. The new Mac Pro's I've been drooling over have up to 30M. I've been wondering if this is likely to make a real world difference.
socks
socks
  • Threads: 15
  • Posts: 364
Joined: Jul 13, 2011
January 1st, 2014 at 2:35:25 PM permalink
I ask about the cache with this video in mind, http://www.youtube.com/watch?v=v5dYE0CMmHQ

This video makes some interesting comments (at around 21:10) about how long it takes to do various things on a computer. Apparently, getting things from main memory takes about 14x as long as from the L2 cache.
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
January 1st, 2014 at 7:01:37 PM permalink
Quote: socks

Thanks for the explanation. This doesn't seem all that novel. A tedious pain, I'm sure, but not that novel. Is the previous lack of combinatorial analysis just that no one had gotten around to it yet? If so, are there other obvious games in this category?


There were other optimizations I used to speed up the major bottleneck, which was looping through every possible dealer hand for every unique player hand. (I used 7 loops, one for each card.) Since there are 53 cards to the deck, I used a 64-bit integer to indicate which cards the example player hand used, and then used bit-shifting inside each of the 7 dealer card loops to determine if that card was already in use. If it was, I skipped that iteration (as well as all of its inner loops) by increasing the accumulating index (0 to 154143079) by the appropriate value, which is combin(n + 1, k) - combin(n, k), where n = the card index that is in use, and k = the card "position" (0 to 6). But of course, rather than perform all of those calculations, I cached the figures in an array such that SuperChoose7[n] was the result of combin(n + 1, 7) - combin(n, 7).

Also, the analyzer skipped any of the 21 ways to play which were (a) foul, (b) dominated in the low hand high hand by another play, or (c) duplicates of an earlier way to play [for that hand] which was already analyzed.

So ultimately, it was the total number of valid and unique ways to play which really determined how long the program would take. Looking only at the unique hands, there are a total of 60,641,940 valid unique ways to play. Multiply that by 53,524,680 possible dealer hands and the result is 3,245,840,433,079,200 (3.2 quadrillion) iterations. I split that up among my 4 cores, so each core processed roughly 811,460,108,269,800 (811.5 billion) iterations.
socks
socks
  • Threads: 15
  • Posts: 364
Joined: Jul 13, 2011
January 2nd, 2014 at 3:42:38 AM permalink
Quote: JB

There were other optimizations I used to speed up the major bottleneck, ...



Nice. That's a much more interesting explanation, to me at least. Thanks again,

-John
AxiomOfChoice
AxiomOfChoice
  • Threads: 32
  • Posts: 5761
Joined: Sep 12, 2012
January 2nd, 2014 at 12:21:06 PM permalink
Thanks, JB. You pretty much got all the optimizations that I got in my analysis of my game (ie, I have nothing useful to add).
98Clubs
98Clubs
  • Threads: 52
  • Posts: 1728
Joined: Jun 3, 2010
January 2nd, 2014 at 3:19:59 PM permalink
Quote: JB

Thanks. I'm looking forward to getting the strategies up, as there have been several "discoveries" which make perfect sense once you see them, but that I never would have thought of.



A few of my faves...

AAAA/22 or 33 ---> AA22/33 + AA, maybe KKKK22 also
AAA* KQJ ----> AA + best hand (str/fl/str-fl)
KKK +10-high or less ---> KK + K
AAAA + Face-Card---> AAA + Ace-Face
KKKK + Ace ---> KKK + AK
Full House that has 22, 33, or 44 as Pair ---> Play Ace-Face in front of FH
very low 2-pairs ( 4433, 4422, 3322) NO SPLIT
PaiGow AKQJ or AKQ10 plays AQxyz + KJ or K10
I have heard that sometimes its better to split AA, I never do, but interesting if validated.
Always play a Royal Str-Flush + Ace if two paired
Always play a Royal Str-Flush + A or K if One Pair
Always play a Face-Card-high Flush + Ace if One Pair
Know wether A2345 is 2nd-best straight or lowest.
Some people need to reimagine their thinking.
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
January 2nd, 2014 at 3:40:16 PM permalink
My comments below on your strategy plays apply specifically to the Foxwoods house way:

Quote: 98Clubs

AAAA/22 or 33 ---> AA22/33 + AA, maybe KKKK22 also


Lots of similar ones.

Quote: 98Clubs

AAA* KQJ ----> AA + best hand (str/fl/str-fl)


All house ways that I'm aware of would play this way; it's rather obvious.

Quote: 98Clubs

KKK +10-high or less ---> KK + K


The rules aren't that cut and dry, but yes.

Quote: 98Clubs

AAAA + Face-Card---> AAA + Ace-Face
KKKK + Ace ---> KKK + AK


These aren't done against the Foxwoods house way, but there is a different quad where you do this under certain circumstances.

Quote: 98Clubs

very low 2-pairs ( 4433, 4422, 3322) NO SPLIT


I'm not yet sure about this against the Foxwoods house way; from what I can tell so far, I think if there's no straight or flush, and you can't make the minimum low hand, that the pairs should be split.

Quote: 98Clubs

PaiGow AKQJ or AKQ10 plays AQxyz + KJ or K10


There are many situations like this.

Quote: 98Clubs

I have heard that sometimes its better to split AA, I never do, but interesting if validated.


Not against the Foxwoods house way, but there are lots of cases where you play the highest and third-highest kickers in the low hand, leaving the second-highest kicker to go with the pair (and not just for AA but other pairs as well).

Quote: 98Clubs

Always play a Royal Str-Flush + Ace if two paired
Always play a Royal Str-Flush + A or K if One Pair
Always play a Face-Card-high Flush + Ace if One Pair


Single pairs with straights and flushes are tricky and I haven't finished studying those yet so I can't say one way or the other.

Quote: 98Clubs

Know wether A2345 is 2nd-best straight or lowest.


Foxwoods sanely treats A2345 as the lowest straight or straight flush.
98Clubs
98Clubs
  • Threads: 52
  • Posts: 1728
Joined: Jun 3, 2010
January 2nd, 2014 at 4:09:30 PM permalink
JB: there are some House ways over at WoO that are not that clear... it would appear (if correctly posted) that AAA* + KQJ might go as 4-Aces AA + A*. Thats why the comment.

The very low 2-pairs are a guard against a HW that splits a 2-pair unless an Ace. Foxwoods knows from 2-pairs and allows K or A for lower 2-pairs.

One pair Str/Fl/Str-Fl's are the tough ones. I'll tank thinking these over, esp. the Flushes.

The 4-Aces or Kings: Lower two pair get cleaned up using AAA + AK, when two pair + Ace, the KKK + AK gives the House the win. Anytime the two-pair splits, PUSH. Thanks to PaiGowDan for help with this one. Naturally, a Straight or better as 5-card is still usually a push unless monster Straight + Pair, Flush + Pair, etc. For me AA + AA gets an undeserved push by 2-pairs or trips with crappy 2-cards.
Some people need to reimagine their thinking.
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
January 2nd, 2014 at 4:33:24 PM permalink
Quote: 98Clubs

JB: there are some House ways over at WoO that are not that clear... it would appear (if correctly posted) that AAA* + KQJ might go as 4-Aces AA + A*. Thats why the comment.


It doesn't matter which rule they follow, the end result is the same, a pair of aces in the low hand and an ace-high straight in the high hand. If it is possible to improve the straight to a royal flush by changing which two aces they put in the low hand, then obviously they would do that since that is the only way to play such a hand.

Quote: 98Clubs

The very low 2-pairs are a guard against a HW that splits a 2-pair unless an Ace. Foxwoods knows from 2-pairs and allows K or A for lower 2-pairs.


I'll know better about this situation when I get to that section of the optimal player strategy.

Quote: 98Clubs

The 4-Aces or Kings: Lower two pair get cleaned up using AAA + AK, when two pair + Ace, the KKK + AK gives the House the win. Anytime the two-pair splits, PUSH. Thanks to PaiGowDan for help with this one.


I'm going by the math which, against the Foxwoods house way, indicates that this is not even close to being the best play with four Aces or Kings. As an example, consider AAAAKQJ:

AAKQJ/AA is worth +0.710218
AAAQJ/AK is worth +0.549490

The difference is smaller with KKKKA32, but splitting the Kings in half is still the best play:

KKA32/KK is worth +0.614227
KKK32/AK is worth +0.563435
TucsonSteve
TucsonSteve
  • Threads: 5
  • Posts: 14
Joined: Apr 2, 2014
July 7th, 2015 at 12:56:05 PM permalink
Hi, JB,

I have a question about the 7-million-or-so "unique" hands. I'm trying to figure out what makes a set of hands all collapse into one unique hand.

For example, when you are determining the unique hands, do the following two 7-card deals fall together as one "unique" hand:
K J 8 7 6 4 2, with a spade, three diamonds, and three clubs, and
K J 8 7 6 4 2, with three spades, and four diamonds.

Certainly all of the 21 possible high and low hands that these two 7-card deals can make are identical in value.

But isn't it the case that the two deals above will yield different chances that the dealer will have a flush, and therefore must be considered separately?

Or is it something else that allows many 7-card deals to all be part of the same "unique" deal? I'm very curious about the criteria you used.

Thanks for any insight into this.

--Steve
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
July 7th, 2015 at 1:59:57 PM permalink
Quote: TucsonSteve

do the following two 7-card deals fall together as one "unique" hand:
K J 8 7 6 4 2, with a spade, three diamonds, and three clubs, and
K J 8 7 6 4 2, with three spades, and four diamonds.


Those are considered different hands because of the different suit shape.

Here's a way to see if two hands share the same unique hand. I'll use the following hand as an example: J♥ 4♦ K♥ 2♠ 7♣ 6♦ 8♣

1. Group the cards by suit ---> J♥ K♥ 4♦ 6♦ 2♠ 7♣ 8♣

2. Sort the ranks within each suit, highest to lowest ---> K♥ J♥ 6♦ 4♦ 2♠ 8♣ 7♣

3. Sort the suits according to how many cards each suit has, most to least ---> K♥ J♥ 6♦ 4♦ 8♣ 7♣ 2♠

4. Sort suits that have the same number of cards like poker hands (no straights), highest to lowest ---> K♥ J♥ 8♣ 7♣ 6♦ 4♦ 2♠

5. Separate the suits with a slash and drop the actual suit ---> KJ/87/64/2

If two hands produce the same result, they share the same unique hand.
gordonm888
Administrator
gordonm888
  • Threads: 60
  • Posts: 5049
Joined: Feb 18, 2015
July 7th, 2015 at 3:27:21 PM permalink
deleted in the face of a harsh response by a moderator
So many better men, a few of them friends, are dead. And a thousand thousand slimy things live on, and so do I.
beachbumbabs
beachbumbabs
  • Threads: 100
  • Posts: 14265
Joined: May 21, 2013
July 7th, 2015 at 3:51:23 PM permalink
Quote: gordonm888

Quote: Wizard

Pai gow poker has combin(53,7)*combin(46,7) = 8,250,459,031,214,390 possible combinations. For each of these, two seven-card hands must be scored. Non-programmers may be saying "so?" at this point. Dealing with numbers this big it can take months or years to run through them all, depending in the speed of the computer and how fast the program is.

Our own JB is a master of doing huge calculation jobs quickly. Just this morning he completed what as far as I know is the first perfect analysis of pai gow poker. Previously, my analysis, and as far as I know, all others, were based on random simulations. I don't remember how long JB's program took to cycle through all 8.25 quadrillion combinations, but it was about two or three months.

His results can be found on my pai gow poker page. House way against house way, when not banking, his house edge is 0.01% less than my previously-published figure. When banking, his figure is 0.05% higher.

You can also see JB analyzed the game with optimal strategy. The tables show that using optimal strategy lowers the house edge by 0.21%. So far this bit information is pretty trivial, as I'm sure the number of people on the planet that know perfect pai gow poker strategy is zero. However, it gives us a goal to shoot for in terms of strategies we will be publishing soon.



As I posted many times on this thread, I have such a Pai Gow Poker code, which involves composition-dependent algorithms for the probability and outcome of >240,000 dealer hands -which represent the total number of hands you have listed above. The fact that I don't post results on a website for free doesn't mean that I don't have it -it just means that I use it differently.



Good for you? I'm not sure why you posted your comment on this. Whether you intend it to or not, it implies to me that you think JB is some hack who threw up some free calcs for the hell of it, and you're somehow promoting your services at his expense.

JB is a professional, and was a paid staffer on this site/ the WoO site at the time he did this analysis for the Wizard (the post you quote is about 18 months old). This & WoO site provide reliable analyses and information about most casino games as part of their core mission.

So, if I'm misunderstanding your intent on posting this, please correct my impression. If not, and you're challenging his results, you should probably get specific and back it up with facts and calcs. Or maybe just not throw airballs trying to one-up another member; it's disrespectful of JB's many contributions.
If the House lost every hand, they wouldn't deal the game.
gordonm888
Administrator
gordonm888
  • Threads: 60
  • Posts: 5049
Joined: Feb 18, 2015
July 7th, 2015 at 4:00:03 PM permalink
So, having read the thread, I now have a question for JB.

Other than PGP player hands that have 5 cards or more of the same suit (i.e., 5-card , 6-card, and 7-card flushes), are there any player hands for which the suit distribution needs to be considered in order to make the optimal decision?

In other words, does the optimal way of playing the hand ever depend upon whether the suit distribution is 4-3-0-0 versus 2-2-2-1?
So many better men, a few of them friends, are dead. And a thousand thousand slimy things live on, and so do I.
gordonm888
Administrator
gordonm888
  • Threads: 60
  • Posts: 5049
Joined: Feb 18, 2015
July 7th, 2015 at 4:22:52 PM permalink
Quote: beachbumbabs



Good for you? I'm not sure why you posted your comment on this. Whether you intend it to or not, it implies to me that you think JB is some hack who threw up some free calcs for the hell of it, and you're somehow promoting your services at his expense.

JB is a professional, and was a paid staffer on this site/ the WoO site at the time he did this analysis for the Wizard (the post you quote is about 18 months old). This & WoO site provide reliable analyses and information about most casino games as part of their core mission.

So, if I'm misunderstanding your intent on posting this, please correct my impression. If not, and you're challenging his results, you should probably get specific and back it up with facts and calcs. Or maybe just not throw airballs trying to one-up another member; it's disrespectful of JB's many contributions.



Yes, you have misunderstood my intent, and, frankly, I don't appreciate the tone of your post. Now cool your jets, because you are way out -of line, Babs.

I frankly did not realize the post was 18 months old. That's my error - I thought it was a recent post. I would not have posted what I did. I will delete my post.

I was saying that I have a similar code - I never have used it to do this type of calculation, where I explicitly consider all the possible combination of suits in the player's hand (because I don't think it has any value -the palyer's PGP decisions are not affected by suit distribution when he/she does not have a flush). So , I agree that this is the first time that someone has published this specific type of calculation.

Babs -you seem to usually be a level-headed person who makes sound decisions and I have never had a run-in with you of any kind. I make it my policy to not judge someone by their worst moment -but, for crissakes - get a handle.
So many better men, a few of them friends, are dead. And a thousand thousand slimy things live on, and so do I.
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
July 7th, 2015 at 4:23:45 PM permalink
Quote: gordonm888

So, having read the thread, I now have a question for JB.

Other than PGP player hands that have 5 cards or more of the same suit (i.e., 5-card , 6-card, and 7-card flushes), are there any player hands for which the suit distribution needs to be considered in order to make the optimal decision?

In other words, does the optimal way of playing the hand ever depend upon whether the suit distribution is 4-3-0-0 versus 2-2-2-1?


Without analyzing the results looking for duplicate outcome counts, I don't know. When I analyzed the game, I did a brute-force analysis using all 6,972,147 unique 7-card hands, rather than attempt to simplify them further, in the event that suit composition did matter for the optimal play.

If you're interested, I added a calculator that lets you enter any 7-card hand and see the results: Pai Gow Poker Calculator

The game conditions are of course important. The conditions used for my analysis were: the dealer uses the Foxwoods house way; A2345 is the lowest straight or straight flush; and a 5% commission.
DoubleOrNothing
DoubleOrNothing
  • Threads: 0
  • Posts: 186
Joined: Jan 2, 2012
July 7th, 2015 at 4:32:49 PM permalink
Quote: gordonm888

Yes, you have misunderstood my intent, and, frankly, I don't appreciate the tone of your post. Now cool your jets, because you are way out -of line, Babs.


Your post struck me the same way as it seems it did BBB. But I decided to refrain from saying this.

Quote: gordonm888

Babs -you seem to usually be a level-headed person who makes sound decisions and I have never had a run-in with you of any kind. I make it my policy to not judge someone by their worst moment -but, for crissakes - get a handle.


Wow, a worst moment? Gotta be kidding.
I can't believe what I believe.
beachbumbabs
beachbumbabs
  • Threads: 100
  • Posts: 14265
Joined: May 21, 2013
July 7th, 2015 at 4:43:31 PM permalink
Quote: gordonm888

Yes, you have misunderstood my intent, and, frankly, I don't appreciate the tone of your post. Now cool your jets, because you are way out -of line, Babs.

I frankly did not realize the post was 18 months old. That's my error - I thought it was a recent post. I would not have posted what I did. I will delete my post.

I was saying that I have a similar code - I never have used it to do this type of calculation, where I explicitly consider all the possible combination of suits in the player's hand (because I don't think it has any value -the palyer's PGP decisions are not affected by suit distribution when he/she does not have a flush). So , I agree that this is the first time that someone has published this specific type of calculation.

Babs -you seem to usually be a level-headed person who makes sound decisions and I have never had a run-in with you of any kind. I make it my policy to not judge someone by their worst moment -but, for crissakes - get a handle.



Gordon,

Thanks for the clarification and sorry for misunderstanding your intent. It's all good.
If the House lost every hand, they wouldn't deal the game.
gordonm888
Administrator
gordonm888
  • Threads: 60
  • Posts: 5049
Joined: Feb 18, 2015
July 7th, 2015 at 4:47:30 PM permalink
Quote: JB

Without analyzing the results looking for duplicate outcome counts, I don't know. When I analyzed the game, I did a brute-force analysis using all 6,972,147 unique 7-card hands, rather than attempt to simplify them further, in the event that suit composition did matter for the optimal play.

If you're interested, I added a calculator that lets you enter any 7-card hand and see the results: Pai Gow Poker Calculator

The game conditions are of course important. The conditions used for my analysis were: the dealer uses the Foxwoods house way; A2345 is the lowest straight or straight flush; and a 5% commission.



I model a House Way very similar to Foxwoods and use the same assumptions on A2345 and 5% commission. When I started analyzing PGP, I was excited about the prospect of being the first person to discover player decisions that depend upon suit composition (in non-flush hands.) Alas, I have never found any such decisions! But I 've never done the brute force calculation that you have done -so I was curious if you had data mined it and found anything.

My code has similar functionality to your on-line Pai Gow Poker Calculator (which you've done a very nice job of formatting). In the past two years I have added capability to my personal PGP models for analyzing the effects on the optimal decision of the number of Aces and Kings that a player sees when peeking at other players' hands (from 1 to 5 hands).

Anyway, you've done a very nice job. There is (or used to be) another PGP calculator on line that used the PGP Power Rankings to analyze hands. It is (or was) awful, awful, awful and provided erroneous answers because of its defective method of calculation. So, I'm glad to see your calculator is on-line.
So many better men, a few of them friends, are dead. And a thousand thousand slimy things live on, and so do I.
TucsonSteve
TucsonSteve
  • Threads: 5
  • Posts: 14
Joined: Apr 2, 2014
July 7th, 2015 at 6:40:36 PM permalink
(Concerning JB's explanation of "unique" hands)

Fantastic, JB! Thank you for such a clear explanation!

Has anyone written something up that discusses more of the issues involved in making these calculations? Perhaps something like the papers Dr. Gwynn wrote in the early '80's on pai gow tiles, showing exactly how his computations were done.

This would all be mostly trivial if our computers were a million times faster than they are. But the limited speed of the computers and the number of computations that are necessary require that we be much more thoughtful about how to write the programs.

I'd like to repeat some of the computations myself, and I'm trying to learn as much as I can before starting to code.

--Steve
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
July 7th, 2015 at 7:34:52 PM permalink
Quote: TucsonSteve

Has anyone written something up that discusses more of the issues involved in making these calculations? Perhaps something like the papers Dr. Gwynn wrote in the early '80's on pai gow tiles, showing exactly how his computations were done.


You probably won't find much on PGP programming. Some poker programming tricks can be extended to fit PGP, like the one here. If you have any questions, you can post them here or PM me and I can probably help.
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
July 7th, 2015 at 9:05:42 PM permalink
Quote: JB

You probably won't find much on PGP programming. Some poker programming tricks can be extended to fit PGP, like the one here. If you have any questions, you can post them here or PM me and I can probably help.

I'd suggest the questions be posted here, if only to make it easier for the next TucsonSteve to find answers to the same questions.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
TucsonSteve
TucsonSteve
  • Threads: 5
  • Posts: 14
Joined: Apr 2, 2014
July 16th, 2015 at 12:46:18 PM permalink
Quote: JB

I chose the Foxwoods house way because it has an exception which many house ways do not have, leading me to believe that it's one of the stronger house strategies.



Hi, JB,

What is that exception?

Also, you mentioned, "Foxwoods sanely treats A2345 as the lowest straight or straight flush." I agree that's "sane." Do you know about what percentage of casinos are now treating a 5-high straight/straight flush as the lowest?
  • Jump to: