View Single Post
  #2  
Old 07-27-2003, 05:58 AM
FastCards FastCards is offline
Junior Member
 
Join Date: Oct 2002
Location: Scotland
Posts: 26
Default Re: Monte Carlo vs Possible Equation?

There are 48 cards left. To get an exact answer you need to deal every possible flop combination and evaluate the two hands with each flop.

The number of flops is (48*47*46*45*44)/(5*4*3*2*1)
=1,712,304

I haven't come across a formula to calculate the exact answer without dealing all the flops. If such a formula exists I would think it would be rather complicated if it was designed to deal with any heads-up situation (as opposed to just 7h8s v Ks3c). Please correct me if I am wrong about this.

One (rough) way to deal all the flops programmatically:

1. Use an array of cards numbered 1 to 52.
2. Give each card a number, e.g. As=1, Ks=2....2h=52 etc
3. Take the players' cards out of the array leaving 48 cards
4. With the remaining 48 cards, use nested loops to get every possible combination.
5. Within the loops evaluate each hand with each flop and tally the results.

e.g.
for a=1 to 48 do
for b=a+1 to 48 do
for c=b+1 to 48 do
for d=c+1 to 48 do
for e=d+1 to 48 do
EvaluateFlop(Crd[a],Crd[b],Crd[c],Crd[d],Crd[e])

The values for a,b,c,d,e generated by the loop will be

1,2,3,4,5
1,2,3,4,6
1,2,3,4,7
....
2,3,4,5,6
2,3,4,5,7
...
...
44,45,46,47,48.

This gives you every possible combination. With a bit of thought you can extend this to allow for more than 2 players and/or 1 or more board cards.

I'm pretty sure that there are examples of this type of thing in the public domain.

Regards
Fast Cards
Reply With Quote