October 21st, 2012 at 1:11:52 PM
permalink
Hi, I've been looking at the probabilities of three card poker hands.
I understand how to work out the probabilities using COMBIN on excel (and the maths behind it) but I can't recompute the combined probabilities of the pair plus and ante/play bets.
I'm essentially trying to recalculate the combined return table from the link above. I understand the total combinations is 407170400 which would be COMBIN(52,3)*COMBIN(49,3).
Anyone know how to recalculate the combinations?
Thanks!
I understand how to work out the probabilities using COMBIN on excel (and the maths behind it) but I can't recompute the combined probabilities of the pair plus and ante/play bets.
I'm essentially trying to recalculate the combined return table from the link above. I understand the total combinations is 407170400 which would be COMBIN(52,3)*COMBIN(49,3).
Anyone know how to recalculate the combinations?
Thanks!
October 21st, 2012 at 1:33:08 PM
permalink
Cycle through all player hands. For each player hand, cycle through all dealer hands. Track the net win/loss under both options (Fold or Play). Choose the option that gives the maximum result and use that to score the player hand's value. Here is the code I use (I'm not providing my Utilities library). Even if you don't know computer programming, the code should be pretty intuitive. The only thing to know is that I score each hand once before starting so that all three card poker hands are evaluated in advance. The output of this program is "-0.033730, 3172". The number 3172 is the score for Q64. The number 3122 is the score for Q23. By the way, showing your code is a bit like showing your underwear. I am sure there are some (eh) inefficiencies.Quote: altoidscooperAnyone know how to recalculate the combinations?
#include <stdio.h>
#include <stdlib.h>
#include "Utilities.h"
main() {
int c1, c2, c3;
int p1, p2, p3;
int d1, d2, d3;
int score[52][52][52];
double handWagered = 0;
double handWon = 0;
double totalWagered = 0;
double totalWon = 0;
double evPlay = 0;
double evFold = 0;
double playerScore = 0;
double dealerScore = 0;
double minPlayScore = 1000000;
for(c1 = 0; c1 < 52; c1++) {
for(c2 = 0; c2 < 52; c2++) {
for(c3 = 0; c3 < 52; c3++) {
if (c1 == c2 || c1 == c3 || c2 == c3)
score[c1][c2][c3] = -1;
else
score[c1][c2][c3] = getHash(c1,c2,c3);
}}}
for (p1 = 0; p1 < 52; p1++) {
for (p2 = p1+1; p2 < 52; p2++) {
for (p3 = p2+1; p3 < 52; p3++) {
totalWagered++;
handWagered = 0;
handWon = 0;
evFold = -1;
evPlay = 0;
playerScore = score[p1][p2][p3];
for (d1 = 0; d1 < 52; d1++) {
if (d1 == p1 || d1 == p2 || d1 == p3)
continue;
for (d2 = d1+1; d2 < 52; d2++) {
if (d2 == p1 || d2 == p2 || d2 == p3)
continue;
for (d3 = d2+1; d3 < 52; d3++) {
if (d3 == p1 || d3 == p2 || d3 == p3)
continue;
handWagered++;
dealerScore = score[d1][d2][d3];
if (dealerScore < 3122)
handWon += 1;
else
if (dealerScore >= 3122 && dealerScore > playerScore)
handWon -= 2;
else
if (dealerScore >= 3122 && dealerScore < playerScore)
handWon += 2;
else
handWon += 0;
if (playerScore >= SF)
handWon += 5;
else
if (playerScore >= TR && playerScore < SF)
handWon += 4;
else
if (playerScore >= ST && playerScore < TR)
handWon += 1;
}}}
evPlay = (double)handWon/handWagered;
if (evPlay > evFold)
totalWon += evPlay;
else
totalWon += evFold;
if (evPlay > evFold && playerScore < minPlayScore)
minPlayScore = playerScore;
}}}
printf("%f, %.0f\n", totalWon/totalWagered, minPlayScore);
}
Climate Casino: https://climatecasino.net/climate-casino/