Player wins with straight flush: 617,044
Player has straight flush, dealer doesn't qualify: 266,196
Player ties with straight flush: 144
Player loses with straight flush: 968
Total events involving player with straight flush: 884,352
I have no problem whatsoever figuring out how many combinations exist for each event in its totality, that is: 884,352. But I am banging my head against a wall trying to figure out each event individually. Maybe it's late and maybe I'm tired but I am stuck like Chuck. If anyone can help, you can get me out of what will certainly become an existential crisis lol. Thank you!!!
I quickly wrote some simple JavaScript code that will probably help you. Because it's 2:30am I am not going to test to see if this really works but basically you can use loops to find every possible combination, without the order of cards being taken into account (the dealer having an Ace Queen Jack is treated the same as the dealer having a Jack Queen Ace). Hope this helps and let me know if you have any questions. Sleep well.
// frenchdeck = ["AC", "AD", "AH", "AS", "KC", "KD", "KH" etc. all the way to "2S"
// straights = ["A32", "432", "543", "654", "765", "876", "987", "T98", "JT9", "QJT", "KQT", "AKQ"]
// instancearray = [] this is where all the combinations involving straight flushes will go
for(a = 0; a < 52; a++){
for(b = a + 1; b < 52; b++){
for(c = b + 1; c < 52; c++){
for(c = 0; d < 52; c++){
for(e = d + 1; e < 52; e++){
for(f = e + 1; f < 52; f++){
arr = [a, b, c, d, e, f] . map(x => frenchdeck[x])
if(Array.from([ ... new Set(arr)] . length == 6){ //making sure all cards are different
if((a[1] == b[1] && b[1] == c[1]) && straights . includes(a[0] + b[0] + c[0])){
instancearray[instancearray.length - 1] = [
[a, b, c],
[d, e, f]
]
}
}
}
}
}
}
}
}
return instancearray
the forum is messing up my code to "remove website links" so sorry that some parts are spaced weirdly
Quote: harris
the forum is messing up my code to "remove website links" so sorry that some parts are spaced weirdly
link to original post
(snip)
Once you're off new member probation, that will be sorted out.
No, I do not know when that will be.
No, I cannot accelerate the approval.
I tacitly blame The Algorithm, and kick back to watch the fireworks.
Quote: DeucesDeucesOh boy, I appreciate the help but this is all way over my head. I'm far from fluent or even conversational in Java. I guess my question would be if there is a way render this on excel?
link to original post
Yes. Keep in mind that that you are looking at the combinations for 3 cards in players's hand and 3 more cards in dealers hand, and the total number of those combinations is c(52,3)*c(49,3).
First let me give you an example.
What are the chances you will get a 543 straight flush, and that you will tie with a dealer's 543 straight flush?
Player combinations to get a 543 SF are 4 (basically 4 possible suits); and then dealer combinations to get a 543 SF (with player's cards removed from the deck) are 3 (3 possible suits); therefore the chance of two 543 SF's tieing are 4*3=12. There are 12 possible SFs: A-hi, K-Hi,Q-Hi . . . 3-Hi. So the total number of combinations for any two SFs tieing are 12*(4*3) = 144.
Now how often does a player get a SF and lose?
Combinations for player getting a AKQ SF and losing are 0.
Combinations for player getting a KQJ SF and losing to an AKQ SF are 4*3=12. The dealer only has 3 ways of making that AKQ SF because player has one suit blocked with his cards.
Combinations for player getting a QJT SF and losing to an AKQ SF or KQJ SF are 4*(3+3)= 24.
Combinations for player getting a JT9 SF and losing to an AKQ, KQJ or QJT SF are 4*(4+3+3)= 40. Note that a dealer AKQ SF has four combinations because all four suits are 'unblocked' by player's cards.
Combinations for player getting a T98 SF and losing to an AKQ, KQJ, QJT or JT9 SF are 4*(4+4+3+3)= 56.
If you complete this exercise for all the player SFs down to 32A and then sum up the total number of times that all 12 SF's get beat, you will derived the value in your original post.
I assumed spades for the player hand, but I suppose it doesn't matter. Of course, the dealer will be shorter on options for non-qualifying hands on each one of these except for the A-K-Q. So from that I built the following chart:
Player Hand/Combinations/Dealer Comb./Total Comb.
A-K-Q/4/6720/26880
K-Q-J/4/6195/24780
Q-J-T/4/5685/22740
J-T-9/4/5190/20760
T-9-8/4/5220/20880
9-8-7/4/5235/20940
8-7-6/4/5235/20940
7-6-5/4/5235/20940
6-5-4/4/5235/20940
5-4-3/4/5220/20880
4-3-2/4/5190/20760
3-2-A/4/5685/22740
Total: 264,180
So I got 264,180, but the ante return table lists that answer as 266,196. I feel like I got my chart right, what am I missing?
Also, its easy to inadvertently doublecount low hands that have both a straight and a flush.
Quote: DeucesDeucesNow I am trying to calculate the combinations for "Player has straight flush, dealer doesn't qualify"
I assumed spades for the player hand, but I suppose it doesn't matter. Of course, the dealer will be shorter on options for non-qualifying hands on each one of these except for the A-K-Q. So from that I built the following chart:
Player Hand/Combinations/Dealer Comb./Total Comb.
A-K-Q/4/6720/26880
K-Q-J/4/6195/24780
Q-J-T/4/5685/22740
J-T-9/4/5190/20760
T-9-8/4/5220/20880
9-8-7/4/5235/20940
8-7-6/4/5235/20940
7-6-5/4/5235/20940
6-5-4/4/5235/20940
5-4-3/4/5220/20880
4-3-2/4/5190/20760
3-2-A/4/5685/22740
Total: 264,180
So I got 264,180, but the ante return table lists that answer as 266,196. I feel like I got my chart right, what am I missing?
link to original post
I got 266196 :-
A-K-Q/4/6720
K-Q-J/4/6195
Q-J-T/4/5706
J-T-9/4/5250
T-9-8/4/5277
9-8-7/4/5292
8-7-6/4/5292
7-6-5/4/5292
6-5-4/4/5292
5-4-3/4/5277
4-3-2/4/5250
3-2-A/4/5706
Welcome to the forum. Check out our rules here: Forum rules
Quote: gordonm888Glad the folks here were willing to help you and that it has worked out well.
Welcome to the forum. Check out our rules here: Forum rules
link to original post
Thank you, Gordon. I'm actually testing myself by trying to replicate the entire table with the individual events, but I'm not seeing any way to do it other than going painstakingly through each and every individual combination. Accounting for say QcJdTc against all the queen highs (not to mention all sorts of other hands) that need to be discounted for those three individual cards. If there's a shortcut I would quite possibly salivate over it.