Here's a Python program that I believe is correct. It takes a little under 7 minutes on my machine to run through every pair of hands.
from itertools import combinations
from collections import Counter
JACK, QUEEN, KING, ACE = 11, 12, 13, 14
N_HANDS = 22100 # 52 choose 3
deck = frozenset((rank, suit)
for rank in range(2, ACE + 1)
for suit in range(4))
assert len(deck) == 52
evaluate_hand_cache = {}
def evaluate_hand(hand):
if hand not in evaluate_hand_cache:
evaluate_hand_cache[hand] = evaluate_hand_(hand)
return evaluate_hand_cache[hand]
def evaluate_hand_(hand):
ranks = tuple(sorted((rank for (rank, _) in hand), reverse = True))
suits = [suit for (_, suit) in hand]
if ranks[0] == ranks[1] == ranks[2]:
# Three of a kind
return (5, ranks[0])
straight = (ranks[0] == ranks[1] + 1 == ranks[2] + 2
or ranks == (ACE, 3, 2))
flush = suits[0] == suits[1] == suits[2]
if straight and flush:
return (6, ranks[0])
if straight:
return (4, ranks[0])
if flush:
return (3,) + ranks
if ranks[0] == ranks[1]:
# Pair
return (2, ranks[0], ranks[2])
if ranks[1] == ranks[2]:
# Also a pair
return (2, ranks[2], ranks[0])
return (1,) + ranks
results = Counter()
divisor = N_HANDS // 100
for i, dealer_hand in enumerate(combinations(deck, 3)):
if i % divisor == 0:
print "{}% complete".format(i // divisor)
dealer_hand = frozenset(dealer_hand)
dealer_e = evaluate_hand(dealer_hand)
for player_hand in combinations(deck - dealer_hand, 3):
player_e = evaluate_hand(player_hand)
outcome = (
'Dealer does not qualify'
if dealer_e < (2, QUEEN) else
'Player loses'
if player_e < dealer_e else
'Player wins'
if dealer_e < player_e else
'Tie')
results[(player_e[0], outcome)] += 1
print "Player hand class,Outcome,Count"
for (hand, outcome), n in sorted(results.items()):
print ','.join([str(hand), outcome, str(n)])
The output is:
Player hand class,Outcome,Count
1,Dealer does not qualify,264851952
1,Player loses,38038608
2,Dealer does not qualify,60280560
2,Player loses,8453520
2,Player wins,242784
2,Tie,2592
3,Dealer does not qualify,17630040
3,Player loses,1260596
3,Player wins,1298780
3,Tie,3288
4,Dealer does not qualify,11581584
4,Player loses,267804
4,Player wins,1392204
4,Tie,23688
5,Dealer does not qualify,836520
5,Player loses,3312
5,Player wins,118216
6,Dealer does not qualify,771024
6,Player loses,956
6,Player wins,112204
6,Tie,168
Best Answer
This one might be easier to think of from the other direction.
What is the probability of choosing 4 cards without any pairs (this is the complimentary set to seeing at least 1 pair).
To see 0 pairs there are 12 possibilities for the 1st card, but only 10 for the second card (since the 1st chosen card is no longer possible and the card that matches the 1st would form a pair) and 8 cards for the 3rd and 6 for the 4th, this multiplies to 5760. The total number of possible hands (with order mattering) is $12 \times 11 \times 10 \times 9 = 11880$, so the complimentary number which is the number of (ordered) hands that contain at least 1 pair is $11880 - 5760 = 6120$, divide that by 11880 and it reduces to $17/33$. We could also do this with order not mattering, but that would be more complicated and the extra pieces would all end up cancelling each other.
I think the 10 choose 2 may be throwing you off, I don't see where that comes into any version.