Two Plus Two Older Archives  

Go Back   Two Plus Two Older Archives > General Gambling > Probability
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2005, 02:35 PM
VivaLaViking VivaLaViking is offline
Member
 
Join Date: Jul 2005
Posts: 97
Default Eureka! Probability of flopping a straight.

I believe I have succeeded in writting some reasonably concise code for calculating the probabilty of flopping a straight depending on the separation of the hole cards. Turn and river calculation will follow later. Can anyone post known probabilities to use as a benchmark? I have been wrong before and I don't trust myself. Afterall, I've got myself in more trouble than other people have got me into. I will explain the code to anyone interested.
[ QUOTE ]


// T -> A converted to 10 -> 14 except when A is low, then it's one.
// the LowCard and HiCard have been resolved.

Separation = HiCard - LowCard;
SolutionsAdjustForBounds = 0;
FlopStraightProbabilityRatio = 0;
if((Separation <= 4) && (Separation > 0)) { // If a straight is possible
. . . if(LowCard < 5) SolutionsAdjustForBounds = LowCard;
. . . else if(HiCard > 10) SolutionsAdjustForBounds = 15 - HiCard;
. . . else SolutionsAdjustForBounds = 5 - Separation;

. . . MaxSolutions = 5 - Separation;
. . . Solutions = (MaxSolutions - SolutionsAdjustForBounds) > 0? MaxSolutions -
. . . . . .(MaxSolutions - SolutionsAdjustForBounds): MaxSolutions;
. . . Permeations = Solutions * 384;
. . . FlopStraightProbabilityRatio = Permeations / 19600 (50 C 3);
}




[/ QUOTE ]
Reply With Quote
  #2  
Old 08-05-2005, 03:31 PM
jba jba is offline
Senior Member
 
Join Date: Feb 2005
Posts: 672
Default Re: Eureka! Probability of flopping a straight.

explain the 384 number for me. better yet just include the equation in the code computers are pretty good at calculating stuff fast.



and I have to nit at this:

(MaxSolutions - SolutionsAdjustForBounds) > 0

just make it

(MaxSolutions > SolutionsAdjustForBounds)

just say what you mean
Reply With Quote
  #3  
Old 08-05-2005, 04:02 PM
VivaLaViking VivaLaViking is offline
Member
 
Join Date: Jul 2005
Posts: 97
Default Re: Eureka! Probability of flopping a straight.

For a given two down cards a straight may have a possible solution. Assume the solution is 7 8 9. Those numbers have be permeated 6 ways but considering the 3 suited values it results in 6 * 4 * 4 * 4 = 384 permeations. A number without any comment is referred to in computerese as a "magic number". It is considered a faux pas. Sorry.
Reply With Quote
  #4  
Old 08-06-2005, 10:17 AM
TonyBlair TonyBlair is offline
Senior Member
 
Join Date: Sep 2004
Location: Liverpool, UK
Posts: 108
Default Re: Eureka! Probability of flopping a straight.

.
Reply With Quote
  #5  
Old 08-06-2005, 08:43 PM
emp1346 emp1346 is offline
Junior Member
 
Join Date: Mar 2004
Posts: 1
Default Re: Eureka! Probability of flopping a straight.

[ QUOTE ]
.

[/ QUOTE ]

Thank you SO much for this very, very insightful post... I mean what more can anyone say than "."? [I'll just self-censor myself here.]

Anyway, as for the code, looks like it should work... Good job... You need to make sure the 50c3 is commented instead of parenthesized, but I hope it works!
Reply With Quote
  #6  
Old 08-07-2005, 07:28 PM
VivaLaViking VivaLaViking is offline
Member
 
Join Date: Jul 2005
Posts: 97
Default Re: Eureka! Probability of flopping a straight.

This code should serve you better. It reavealed something interesting to me. On a flop if the are N solutions for a straight, the probability is 2% x N. eg assume you have Q J for down cards so the solutions are A K T, K T 9 and T 9 8 so the probalility for the three solutions is 6%. The actual numbers are ~1.95% ~3.91% ~5.87% and ~7.83% but when you're sitting at a table, 2%, 4%, 6% and 8% are close enough.

// the LowCard and HiCard have been resolved.
int nLowCard = nValue2;
int nHiCard = nValue1;
int nSeparation = nHiCard - nLowCard;
double dFlopStraightProbabilityRatio = 0;
if(nSeparation <= 4) { // If a straight is possible
int nMaxSolutions = 5 - nSeparation;
int nSolutionsReducedByBounds = 0;

// only low straights will satify this
// conditional. Either the separation will be too great
// and it will never test the condition or the low
// straight is not being considered this iteration.
if((4 - nSeparation) >= nLowCard)
nSolutionsReducedByBounds = nMaxSolutions - nLowCard;

// only high straights will satify this conditional.
// Either the separation will be too great and it will
// never test the condition or the high straight is not
// being considered this iteration.
else if(nLowCard >= 11)
nSolutionsReducedByBounds = nLowCard - 10;

// 384 = 6 permeations solution x (4 C 1) cubed(suits)
int nPermeations = (nMaxSolutions -
nSolutionsReducedByBounds) * 384;

// 19300 = (50 C 3) // the total possible flops
dFlopStraightProbabilityRatio = ((double)nPermeations) /
((double)19600);
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.