- #1
KFC
- 488
- 4
Hi there,
I am writing a program to verify the total combination of dealing 10 cards to two players out of 52 cards. The math is simple. Firstly, the total way to draw 10 cards from 52 is C(52, 10) = 15820024220. From the drawn 10 cards, we pick any 5 for player A and the rest of player B, total combination is C(10,5) = 252. Hence, there are total 15820024220*252 = 3986646103440 ways to deal 10 cards from 52 to two player. We can also consider this problem by first draw 5 cards out of 52 for player A, and then draw another 5 cards from the rest 47 cards for player B, which also give C(52,5)*C(47,5) 3986646103440
I am trying to loop all possible cases to repeat this number. My program is something like this
for (H1: each hand in total combination) // total 2598960 hands
begin
for (H2: each hand in total combination) // total 2598960 hands
begin
if (H1 not same as H2) increase count
end
end
this program gives the count 6754590482640 instead of 3986646103440. So anything wrong in my program or in my math? Which one is correct?
I am writing a program to verify the total combination of dealing 10 cards to two players out of 52 cards. The math is simple. Firstly, the total way to draw 10 cards from 52 is C(52, 10) = 15820024220. From the drawn 10 cards, we pick any 5 for player A and the rest of player B, total combination is C(10,5) = 252. Hence, there are total 15820024220*252 = 3986646103440 ways to deal 10 cards from 52 to two player. We can also consider this problem by first draw 5 cards out of 52 for player A, and then draw another 5 cards from the rest 47 cards for player B, which also give C(52,5)*C(47,5) 3986646103440
I am trying to loop all possible cases to repeat this number. My program is something like this
for (H1: each hand in total combination) // total 2598960 hands
begin
for (H2: each hand in total combination) // total 2598960 hands
begin
if (H1 not same as H2) increase count
end
end
this program gives the count 6754590482640 instead of 3986646103440. So anything wrong in my program or in my math? Which one is correct?