# Very simple poker holdem question

N holdem hands (just 2 cards from a standard 52 cards deck)  are dealt to N players

How to compute the probability that:

-exactly k players have a pair ( Two cards of the same value e.g.: 7, 7).

-at least k players have a pair

-
That's not a very simple question :-) – joriki Oct 30 '11 at 15:20

The case $n=1$ is simple. The probability that the (one and onl player has a pair is $3/51=0.0588\dots$.

For more than one player, one method of computation is simulation. The following Mathematica code simulates $10^8$ hands and counts the number of hands with $k$ pairs, $0\le k\le n$, for $1\le n\le10$. {k,m} means that in $m$ hands there were exactly $k$ pairs among the $n$ players.

deck = Range[52];
hands = 10^8;
Do[
Clear[freq];
freq = Tally[
Table[Count[
Mod[#[[1]] - #[[2]], 13] & /@
Partition[RandomSample[deck, 2 n], 2], 0], {hands}]];
Print["n = ", n, Sort@freq],
{n, 10}]

n = 1 ; {{0,94119269},{1,5880731}}
n = 2 ; {{0,88582902},{1,11065651},{2,351447}}
n = 3 ; {{0,83379527},{1,15610723},{2,988653},{3,21097}}
n = 4 ; {{0,78489009},{1,19572572},{2,1858334},{3,78843},{4,1242}}
n = 5 ; {{0,73888621},{1,23009515},{2,2909371},{3,186390},{4,6022},{5,81}}
n = 6 ; {{0,69563109},{1,25968871},{2,4100553},{3,349923},{4,17092},{5,451},{6,1}}
n = 7 ; {{0,65483801},{1,28501493},{2,5400074},{3,575770},{4,37359},{5,1473},{6,29},{7,1}}
n = 8 ; {{0,61659751},{1,30637208},{2,6764126},{3,865183},{4,69909},{5,3702},{6,118},{7,3}}
n = 9 ; {{0,58052756},{1,32430263},{2,8172001},{3,1218287},{4,118645},{5,7735},{6,306},{7,7}}
n = 10 ; {{0,54670799},{1,33895225},{2,9599732},{3,1634219},{4,184723},{5,14465},{6,805},{7,31},{8,1}}

-
Thank you a lot for your answer.However, I am also looking for a general formula. – Jean-Pierre Oct 31 '11 at 20:40
As joriki says in its comment, it is not a simple problem. – Julián Aguirre Nov 1 '11 at 12:40
I think Jean-Pierre was being ironic. It is a complex problem that can be stated simply. – Zippy Nov 2 '11 at 21:31

The problem seems simpler that I thought.The probability that any player has a pair is constant (3/51=0.0588). Hence,if I am right:

• the probability that k players have a pair is given by the binomial distribution B with parameters N and 0.588: P(K=k)=B(N,0,0588)
• the probability that at least k players have a pair is given by the cumulative 1-I(1-0.0588)(N-k,1+k) where I is the regularized incomplete beta function
-
The problem is that the binomial distribution only works if the events are independent, and because you're dealing from a single deck without replacement, the hands are dependent on each other and you can't apply the binomial distribution. It's a good first approximation, but it's not an exact formula. – Steven Stadnicki Nov 15 '11 at 16:03
For a simpler version of this dependency, imagine a 4-card deck of AAKK; then the probability of being dealt a pair is 1/3, but the probability that both players in a 2-player game have pairs is also 1/3 (as opposed to 1/9), because if one player is dealt a pair then the other player must have been as well. – Steven Stadnicki Nov 15 '11 at 18:57
@Steven Thank you a lot for pointing and explaining my mistake. Anx idea how to find the exact formula? – Jean-Pierre Nov 16 '11 at 19:31