# Logic Question

## Recommended Posts

Hey there, I'm planning to build a texas hold'em program to calculate the % of making each type of hand both before the flop, and throughout the rest of the hand. My question is, what is the best way of going about this? I'm not looking for code, just discussion on how to best tackle this problem. Personally, the first thing that came to mind was to iterate through all possible combinations of cards being drawn and calculate %'s by adding the relative combinations. Although this is the most accurate way of doing this, there are

`50*49*48*47*46 = 254251200`
possible combinations for the remaining community cards. This would, of course, cause a huge slow down. The only other thing that comes to mind for me is to read my cards and visible community cards, and calculate the % to make each hand. IE: If I'm holding a Ace of Hearts and King of Hearts with no community cards showing, my % to make a royal flush with this hand is:
`((50/3)*(49/2)*(48)) / (50*49*48*47*46) = .000077%`
That seems like the way to go, anyone else have anything to add ? suggestions? comments? a mystery algorithm i dont know about?

Edited by ame1011

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]

##### Share on other sites

It would be very extensive to calculate this as there are quite a lot of potential poker hands you could have. But i guess you could have it calculate you percentage for each hand.

Click!

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...