Jacks Or Better - holding 3 to a straight flush

Discuss proper hold strategies and "advantage play" and ask questions about how to improve your play.
Ronnie
Forum Newbie
Posts: 8
Joined: Sat Jan 20, 2007 12:10 pm

Jacks Or Better - holding 3 to a straight flush

Post by Ronnie »






I am a computer programmer with forty years of experience who has recently taken an interest in Video Poker, particularly Full Pay Jacks or Better (with the 9/6 ratio for Full House and Flush).
 
I've written a computer program that can play millions of hands very quickly and analyze all possible combinations of Hold/Discard after the initial deal. For speed I wrote the program in assembler language.
 
My program has produced results that are consistent with all conventional wisdom derived and reported by experts except for one significant difference.
 
That significant difference occurs when you are dealt three low cards to a straight flush plus one high card and one unsuited low card not related to the first three low cards.
 
I am not suggesting for one second that I am smarter than the experts!
 
And, in fact, I fully acknowledge -- even with the data that I present here -- that I may be overlooking something!
 
But that is my reason for posting this message.
 
In presenting my findings here I am hoping that someone in this group will evaluate my data and then tell me where I am correct or incorrect.
 
Okay, here is the hand in question.
 
The cards dealt are:
 
3H 4H 6H KS 9C
 


Every book and every website article
I have seen has said that the optimum play is to hold the 3H 4H 6H: in other words, go for the straight flush.
 
My computer program, on the other hand, is telling me emphatically -- based upon playing one million hands with those same five cards dealt -- that the optimum play is to hold the King.
 
In terms of preferability my program is telling me that the decision to hold the King rather than going for the straight flush is not even close!
 
And it makes sense to me, for this reason.
 
Betting one credit, if you get a straight flush you get back 50 credits.
 
But with a 3H 4H 6H, what are your chances of actually nailing that straight flush?
 
Since you would be discarding the two black cards, there are 1081 possible combinations for the two cards you will draw to replace them, which in mathematical terms is Combin(47,2) -- meaning "2 cards out of a universe of 47." The universe represents the 52 cards in the deck, minus the five that were dealt. In other words you can draw AH 2H, AH 5H, AH 7H, etc.
 
The chances of you drawing 2H 5H are 1 in 1081.
 
The chances of you drawing 5H 7H are also 1 in 1081.
 
Therefore the chances of completing your straight flush are only 2 in 1081 or 1 in 504.5.
 
If you are lucky enough to do so, your payoff would be 50 credits.
 
My point is there are 1079 chances out of 1081 that you will not get your straight flush!
 
It is true that by holding those three cards you still have several possibilities for either a straight or a flush or a three of a kind or a pair of jacks or better high cards.
 
So the question becomes: will those added possibilities make it advisable to hold on to those three hearts?
 
My program emphatically says NO!
 
Keep in mind that if you hold the King you are drawing four cards and that in itself can result in paying hands that are better than merely drawing a second King, which is what is your most likely expectation for a paying hand.
 
There are, of course, 32 possible "Hold/Discard" combinations.
 
Considering the five cards presented above:
 
DDDDD means discard all five cards.
HHHHH means hold all five cards.
DDDHD means hold the King, discard the rest.
HHHDD means hold the first three cards, discard the other two.
 
I had my program play one million hands with the above draw, trying each of the 32 possible combinations for each one.
 
I am going to present my results in two ways: first, sorted alphabetically by "Hold/Discard" combination and second, sorted in descending order by payoff.
 
The first item shown below, for DDDDD, shows that if you get the five cards and play one million hands by discarding all five cards, your total payoff will be 335885: in other words a return (rounding up) of about 33.6% on your investment. By holding on to just the 9C (DDDDH) your total payoff will be 336737, which is a return (rounding up) of about 33.7% on your investment.
 
For ease in readibility -- at least in my personal opinion -- I am not using commas after the thousands. 
 
-----------------------------------------------------------------------------
3H 4H 6H KS 9C ..... 1,000,000 hands .....
(re-draw sorted by Hold/Discard Combination)
-----------------------------------------------------------------------------
DDDDD  335885
DDDDH  336737
DDDHD  499884 <----- BEST PAYOFF: HOLD THE KING!
DDDHH  374753
DDHDD  303931
DDHDH  248005
DDHHD  355372
DDHHH  212224
DHDDD  297901
DHDDH  215514
DHDHD  356387
DHDHH  212383
DHHDD  264644
DHHDH  104477
DHHHD  212426
DHHHH    68330
HDDDD  291906
HDDDH  215419
HDDHD  355243
HDDHH  212747
HDHDD  248717
HDHDH  104813
HDHHD  212430
HDHHH    68330
HHDDD  258006
HHDDH  104458
HHDHD  212119
HHDHH    68330
HHHDD  329145  <----- EIGHTH BEST: GO FOR THE STRAIGHT FLUSH 
HHHDH             0
HHHHD    68330
HHHHH             0




-----------------------------------------------------------
3H 4H 6H KS 9C ..... the same 1,000,000 hands .....
(re-draw sorted by best to worst payoff)
-----------------------------------------------------------
DDDHD  499884  <----- BEST PAYOFF: HOLD THE KING!
DDDHH  374753
DHDHD  356387
DDHHD  355372
HDDHD  355243
DDDDH  336737
DDDDD  335885
HHHDD  329145 <----- EIGHTH BEST: GO FOR THE STRAIGHT FLUSH
DDHDD  303931
DHDDD  297901
HDDDD  291906
DHHDD  264644
HHDDD  258006
HDHDD  248717
DDHDH  248005
DHDDH  215514
HDDDH  215419
HDDHH  212747
HDHHD  212430
DHHHD  212426
DHDHH  212383
DDHHH  212224
HHDHD  212119
HDHDH  104813
DHHDH  104477
HHDDH  104458
HDHHH   68330
HHHHD   68330
HHDHH   68330
DHHHH   68330
HHHHH            0
HHHDH            0


 
The redraws on the one million hands that I used were derived by my random number generator. Having used it successfully in dozens of other applications, I am convinced that it is reliable.
 
So the data above has been admittedly derived empirically.
 
I am in the process of modifying my program to have it play every actual possible redraw exactly once.
 
There are 2,598,960 different combinations of cards that can be dealt on the first deal. This number is Combin(52,5).
 
There are 1,533,939 different combinations of cards that can be dealt on the second deal. This number is Combin(47,5).
 
Therefore my program will deal the above five cards and then play each of those 1,533,939 redraw combinations exactly once.
 
I do not expect the results to be substantially different from what I have presented above.
 
Well, that's it.
 
I know you that folks here are extremely knowledgable about the game of Poker, admittedly much more so than I am.
 
I consider myself an expert in computer programmer but a neophyte when it comes to poker.
 
I am, relatively speaking, a Ronnie-come-lately in terms of analyzing it.
 
So I am eagerly awaiting your feedback on whether I am correct or incorrect in my conclusion that, in fact, holding a high card with three to a straight flush it is better in the long run -- contrary to conventional wisdom -- to hold that high card rather than going for the straight flush.
 
If you believe that I am incorrect, please explain the reason for that.
 
I consider every new day a learning experience.
 
Thanks in advance for all your feedback!
 
Ronnie
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

shadowman
Video Poker Master
Posts: 3587
Joined: Mon Oct 23, 2006 5:42 pm

Post by shadowman »

The problem with sims is that they can be quite a bit off even with a million hands. All it would take is hitting an extra RF holding just the King to throw off your results. The strategies are all based on average return for a given hold. In this case the average return for 346 is 2.68 and for the King with a 9 ST penalty is 2.38. These numbers are calculated by adding all winning hands and dividing by the total number of cases (1081 for 346 and 178+K for holding just the King).
 
If you purchase one of the VP programs (FVP, winpoker, etc.) they will break down all the possible winning hands or you can do the arithmetic yourself if you'd like).
 
Also, evaluating 2.6 million hands and checking every possible draw takes a long, long time (been there, done that). All of the software programs use various forms of symmetry to reduce the number of hands that need to be evaluated (e.g there is no difference between a club flush and a spade flush). Otherwise you won't get your results for several months (if not years).

Ronnie
Forum Newbie
Posts: 8
Joined: Sat Jan 20, 2007 12:10 pm

Post by Ronnie »

Thanks for being the first one to reply to my message!
You wrote:
 
The problem with sims is that they can be quite a bit off even with a million hands. All it would take is hitting an extra RF holding just the King to throw off your results. The strategies are all based on average return for a given hold. In this case the average return for 346 is 2.68 and for the King with a 9 ST penalty is 2.38. These numbers are calculated by adding all winning hands and dividing by the total number of cases (1081 for 346 and 178+K for holding just the King).
 
I understand the "average return" methodology you describe but, at this juncture, I do not understand why my sims are producing results that are greatly at variance with it.
 
I have a feeling that maybe the possible fallacy in my reasoning lies in the fact that we are dealing with two different numbers of cases here, namely a miniscule 1081 and a gargantuan 178365. This may become more obvious to me after I have changed to my new approach using actual hands, which I shall describe below. 
 
Your point about sims is well-taken. And yes, the presence of an artificial number of Royal Flushes could certainly tip the scales and therefore produce invalid conclusions on my part.
 
However I have run my program with randomly generated "million hands" at least 20 times and the results have always been the same, with "Hold The King" coming out far ahead of "go for the straight flush."
 
Because I agree with you that sims can be inaccurate and that maybe even my random number generator may be suspect (horror of horrors!), I am planning to go the rest of the nine yards.
 
I am in the process of doing away with the sims and basing my subsequent analysis, as noted above, on actual possibilities.
 
In other words I am writing logic to generate every possible re-deal combination of five cards exactly one time and then to break down the results by each of the 32 possible "Hold/Draw" combinations.
 
You wrote:
 

Also, evaluating 2.6 million hands and checking every possible draw takes a long, long time (been there, done that). All of the software programs use various forms of symmetry to reduce the number of hands that need to be evaluated (e.g there is no difference between a club flush and a spade flush). Otherwise you won't get your results for several months (if not years).
 

At this point in time I am not interested in evaluating 2.6 million hands (actually 2,598,960)!
 
I am only interested in evaluating this one single hand. The one with the three hearts to a straight flush, a King and an unsuited 9.
 
If you have "been there done that" with the Combin(52,5) universe then I certainly must commend you for your diligence and hard work!
 
I could use symmetry to break down the number of possibilities but that would not change the results.
 
I will only worry about symmetry if I was to do an analysis of every possible original deal, which is as stated not my intention at this time.
 
Since I am only dealing with one single draw and since I only need to evaluate the 32 "Hold/Draw" possibilities for each of each of the 1,533,939  possible re-draws (considering all five cards) it should not take very long to accomplish my goal.
 
Assuming that my initial conclusion ("Hold The King") is incorrect -- which it probably is because it's me against the rest of the world, LOL -- doing this approach with actual rather than randomly-generated possibilities might shed light on exactly why I reached the incorrect conclusion! That is what I am really looking for here, the why!!!
 
I might consider purchasing one or more of those VP programs.
 
But first, I am going to follow through with my own efforts.
 
That, to me, is a lot more fun, even if in the end I find out that I have strayed away from the straight and narrow path.
 
Doing what I am doing is a wonderful way to learn more about the game while, at the same time, continuing to hone my programming skills.
 
Thanks again! I will let you know the follow-up results of course.
 
 
 

shadowman
Video Poker Master
Posts: 3587
Joined: Mon Oct 23, 2006 5:42 pm

Post by shadowman »


However I have run my program with randomly generated "million hands" at least 20 times and the results have always been the same, with "Hold The King" coming out far ahead of "go for the straight flush."

 
20 times? ... you almost certainly have an error in your sim. I've been there and done that too.
 

Because I agree with you that sims can be inaccurate and that maybe even my random number generator may be suspect (horror of horrors!), I am planning to go the rest of the nine yards.

 
What RNG are you using? I've used the Knuth RNG in all my sims and it has been very good.
 


I am in the process of doing away with the sims and basing my subsequent analysis, as noted above, on actual possibilities.
 
In other words I am writing logic to generate every possible re-deal combination of five cards exactly one time and then to break down the results by each of the 32 possible "Hold/Draw" combinations.

 
I wrote that program many years ago for JOB when I was first getting into VP. It's a simple dos C program that I didn't even bother to format the results. Here's what you should get. There are two values for each type of ending hand. The total number and the %.
 

3d 5d 6d
ER=2.682701 NumDraws=1081  
rf 0 0.000000
sf 2 0.185014
k4 0 0.000000
fh 0 0.000000
fl 43 3.977798
st 30 2.775208
k3 9 0.832562
p2 27 2.497687
hp1 21 1.942646
zip 949 87.789084
 
ks
ER=2.382586 NumDraws=178365
rf 1 0.000561
sf 1 0.000561
k4 52 0.029154
fh 288 0.161467
fl 493 0.276400
st 446 0.250049
k3 4102 2.299779
p2 8874 4.975191
hp1 45456 25.484820
zip 118652 66.522019
 
By the way, I think doing the program is a good idea. I've used my single hand analysis programs to help me develop strategies for many games. It's a good tool to have at your disposal.
 

oej719
Video Poker Master
Posts: 1777
Joined: Wed Sep 06, 2006 5:46 pm

Post by oej719 »

Wow! Great post Ronnie. I am not a programmer nor do I play one on TV. I did not stay at a holiday inn last night, but I did read every word of your post and I under stood all of it. Keep us informed of your results please.

Ronnie
Forum Newbie
Posts: 8
Joined: Sat Jan 20, 2007 12:10 pm

Post by Ronnie »

This is in reply to Shadowman's second post.
 
Please forgive me as I am new to the the forum and need to get use to all the wonderful bells and whistles!
 
Originally posted by Ronnie


However I have run my program with randomly generated "million hands" at least 20 times and the results have always been the same, with "Hold The King" coming out far ahead of "go for the straight flush."

 
20 times? ... you almost certainly have an error in your sim. I've been there and done that too.
 
That may well be. Hopefully when I deal with actual hands rather than sims I will be able to figure out why there is a discrepancy.
 
I have plenty of time to work on this thankfully.
 

Originally posted by Ronnie


Because I agree with you that sims can be inaccurate and that maybe even my random number generator may be suspect (horror of horrors!), I am planning to go the rest of the nine yards.

 
What RNG are you using? I've used the Knuth RNG in all my sims and it has been very good.
 

I am not familiar with Knuth.
 
Since I wrote my program in assembler language I decided to use my own random number generator. I won't jump up and down about it but I have used it for several dozen games I have developed over the years and it appears to be adequate. The methodology is difficult to explain here.
 
I did use it to shuffle one million decks and list out the cards and, if I recall, there were no exact duplications of more than the first six cards.
 
I suspect that if there is a problem with my sims it lies in some logic that I am doing that does not have to do with the RNG.
 
I will let you know if/when I determine what that problem is.
 
I can tell you that it is ONLY in the area of three to straight flush vs. holding a high card (king in this case) that I am at variance with strategy reported elsewhere.
 
Why this one case is way way off (I get a 49% return for holding King versus 32% for go for the straight flush) is something yet to be determined.
 
Hopefully when I go away from the sims and use actual hands instead I will come up with the results you have come with or very similar!
 
I have plenty of time to work on this thankfully.
 

Thanks again. No matter what happens I am enjoying this and I am certain it's going to be educational to me!


Originally posted by Ronnie


Ronnie
Forum Newbie
Posts: 8
Joined: Sat Jan 20, 2007 12:10 pm

Post by Ronnie »

Wow! Great post Ronnie. I am not a programmer nor do I play one on TV. I did not stay at a holiday inn last night, but I did read every word of your post and I under stood all of it. Keep us informed of your results please.
 
This is my reply to oej719. And as noted in a reply I just did for Shadowman's second post, please forgive me here because I am new and this will take a little getting used to. I am very impressed with the forum software, that's for sure!
 
Oej719, thanks for your compliment! I feel honored because it comes from a senior member!
 
And I love your line about not being a programmer nor do you play one on TV. I can also assume you are not a doctor but that may not be correct.
 
It seems obvious to me that in this case of holding King versus holding three to a straight that there must be something wrong with my simulation logic, as Shadowman pointed out. I hope I am ultimately able to pinpoint the problem.
 
I will certainly keep you and Shadowman and anyone else here who is interested (wow, over 50 views!) informed of my results.
 
Thanks again!
 
 
 
 

shadowman
Video Poker Master
Posts: 3587
Joined: Mon Oct 23, 2006 5:42 pm

Post by shadowman »

Just in case anyone is interested ... you don't have to be a computer programmer to figure this stuff out. For example, in the suited 3 4 6 example all you need is a good calculator or remembering your combinations. A couple of examples:

To compute the number of flushes you take the 10 remainding cards in the same suit and deterime the number of possibilities. Ten cards combined two at a time (10.C.2) is 45, but you have to subtract the two possible straight flushes leaving you with 43.
 
To compute the number of high pairs you take 4.C.2, four cards combined two at a time, which is 6 and multiple that by the 4 different kinds of high cards (A,K,Q,J) which give you 24 ... but you threw away a king so the possible number of pairs for the remainding 3 kings (3.C.2) = 3. This reduces the number to 21. In this case the king is known as a high card penalty.
 
To get the Expected Return (ER) for this hold you would take each result and multiply it by the value from the paytable, e.g. 43*30 for the flush and 21*5 for the high cards, add them all together and divide by 1081, the total number of possible draws.
 
SF(2*250)+FL(43*30)+ST(30*20)+3K(9*15)+2P(27*10)+HP(21*5) / 1081 = 2.6827
 
I hope everyone can now see there is no magic. This is essentially what all the software programs are doing in there logic to analyze various hand combinations. When these programs analyze a game they simply extend this logic to all possible UNIQUE hands. That is why these program all get the same results.
 
I should note the formula for combinatorial arithmetic (n.C.r) is n! / r!(n-r)!. The exclamation mark stands for the mathematical term "factorial". This value is the number given multiplied by all succeeding lower integer values (5! = 5*4*3*2*1),  so 10.C.2 = 10!/(2!*8!) = 10*9/2*1 = 45.

rascal
VP Veteran
Posts: 674
Joined: Tue Sep 12, 2006 12:25 am

Post by rascal »

Shadowman, some of your wordage is very famiiar. Did we meet on a cruise a few years ago????

shadowman
Video Poker Master
Posts: 3587
Joined: Mon Oct 23, 2006 5:42 pm

Post by shadowman »

Shadowman, some of your wordage is very famiiar. Did we meet on a cruise a few years ago????
 
I doubt it very much. The last cruise I was on was in 1981. I didn't even play VP back then.
 
I'm not all that surprised that someone else would sound like me. The math is pretty standard stuff. The difficulty is to figure out how to state the problem. That is, translating from language to mathematics. Once you accomplish that difficult task the rest is going to be pretty similar.
 
Then again, maybe we met somewhere else ...

Post Reply