# Number of 7-card hands with at least one exact pair?

I checked the related questions How many ways to get at least one pair in a seven card hand? and Dealing a 5 card hand with exactly 1 pair, but didn't see an answer to my precise question.

It's easy to count the number of 7-card hands from a 52-card pack with at least one pair or triplet or 4-of-a-kind (quadruplet?): $C(52,7)-4^7C(13,7)$, with the latter term being the number of hands that have no repeated ranks. The fraction of hands with at least one such multiplet is $508027\,/\,643195$ or about $0.790$.

I want the number of hands that have at least one pair that is not also a triplet and not also a quadruplet. Empirically, the fraction of such hands is about $0.738$.

My unsuccessful attempt at a theoretical calculation goes as follows:

There are $52$ choices for the first card. To complete the mandatory pair, take one of the three remaining cards of the same rank and different suits (three choices), and eliminate the remaining two of the same rank, leaving $48$ cards. Draw the remaining five cards in $48!\,/\,43!$ different ways (multiplets in the remaining five are fine). Reckon as equivalent all $7!$ permutations of the total hand, for a final count of

$({52\times{3}\times{48}\times{47}\times{46}\times{45}\times{44}})\,/\,{7!}$

Unfortunately, this is $44519904\,/\,7$, not only non-integer, but yielding a fraction $0.0475$ of $C(52,7)$, much too low.

What is wrong with my counting argument?

What is the right counting argument?

• There are thirteen ranks (2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A) and four suits (heart, diamond, club, spade). You seem to be confusing the names, which makes your argument difficult to follow. – N. F. Taussig Dec 28 '16 at 0:58
• @N.F.Taussig I made the required corrections. Thanks. – Reb.Cabin Dec 28 '16 at 1:11
• Note: there was an arithmetic error in my original posted solution. I have corrected it now. – lulu Dec 28 '16 at 11:51
• I'll note that the corrected theoretical ratio (0.7388171) is closer to my empirical ratio (from repeated million-hand computer runs) than the uncorrected one I looked at yesterday here (I don't remember that number, but I do remember thinking it wasn't as close as I'd like). The closeness of the numbers boosts confidence both in the argument and in the computer code. – Reb.Cabin Dec 28 '16 at 14:47

Your count multiply counts some combinations but not others. For example, you multiply count $AABBCDE$. Also you divide by $7!$, but you should only divide by $5!$, to reflect the symmetry between the ways to choose the last five cards (that symmetry does not extend to the pairs). Note, for illustration, that we can count the hands that have a unique pair, that is hands of the form $AABCDE$ as $13\times \binom 42 \times 4^5\times \binom {12}5=63258624$ which is already $.47283$ of the total.

Here's a way to do the count:

The "bad" hands are of the following types:

No duplicates is $4^7\times \binom {13}7=28114944$.

One triple: Pattern is $AAABCDE$ so $13\times \binom 43 \times 4^4 \times \binom {12}4=6589440$

One quadruple: Pattern is $AAAABCD$ so $13 \times 4^3 \times \binom {12}3=183040$

Two triples: Pattern is $AAABBBC$ so $\binom {13}{2}\times \binom 43^2\times \binom {11}1\times \binom 41=54912$

One Quadruple, One triple: Pattern is $AAAABBB$ so $13\times 12 \times \binom 43=624$

Thus there are $34949260$ bad hands altogether, so $\boxed{133784560-34949260=98841600}$ good hands.

Using these numbers we get the desired ratio: $$\frac {98841600}{133784560}=\fbox {.7388171}$$

• Seems straightforward to generalize, also. – Reb.Cabin Dec 28 '16 at 1:08
• Agreed. You just need to be able to list the bad patterns....each individual count is straight forward. – lulu Dec 28 '16 at 1:11
• I don't understand the count for 2 triples. – user84413 Dec 28 '16 at 4:53
• @trueblueanil Indeed. Thanks. Will, edit now. Well, it's $\binom {13}2 \times \binom 43^2 \times 11$, no? I am just waking up so all manner of blunder is possible. – lulu Dec 28 '16 at 11:36
• @user84413 And for the the very good reason that it is wrong. I (believe I have corrected it now. Thanks! – lulu Dec 28 '16 at 11:42

I'd prefer to count directly for each "good" pattern, by multiplying two factors,

[Choose various ranks]$\times$ [Choose suits for chosen ranks]

$4-2-1: [\binom{13}{1,1,1}][\binom44\binom42\binom41] =41184$

$3-2-2:[\binom{13}{1,2}][\binom41\binom42^2] =123552$

$3-2-1-1:[\binom{13}{1,1,2}][\binom43\binom42\binom41^2] = 3294720$

$2-2-2-1: [\binom{13}{3,1}][\binom42^3\binom41]=2471040$

$2-2-1-1-1:[\binom{13}{2,3}[\binom42^2\binom41^3] = 29652480$

$2-1-1-1-1-1:[\binom{13}{1,5}][\binom42\binom41^5]= 63258624$

Adding up and dividing by $\binom{52}{7}$, we get $\frac{98841600}{133784560}, \approx 0.7388$

• Don't know how an answer got added instead of getting edited ! – true blue anil Dec 28 '16 at 11:09
• @bof: Yea, certainly less tedious !+1 :) – true blue anil Dec 28 '16 at 13:35
• @trueblueanil Would you be so kind as to explain the notation of binomial coefficients with commas in the lower position, for instance, $\binom{13}{1,1,1}$? I'm not familiar with that notation. – Reb.Cabin Dec 28 '16 at 14:54
• Well, strictly speaking, I should have written $\binom{13}{1,1,1,10}$ since the sum of the lower indices of a multinomial coefficient must equal the upper index, but since expanded, it is $\binom{13}1\binom{12}1\binom{11}1\binom{10}{10}$, the last lower index can always be left out w/o affecting the result. – true blue anil Dec 28 '16 at 15:16
• Of course, if you intend to computerise, you must use the full form ! An equivalent expression which you might find more convenient is $\frac{13!}{1!1!1!10!}$ – true blue anil Dec 28 '16 at 15:32

Perhaps the following solution using the in-and-out formula is slightly less tedious.

For $1\le i\le13$ let $A_i$ be the set of all $7$-card hands containing an exact pair of rank $i.$ $$|A_i|=\binom42\binom{48}5.$$ $$|A_i\cap A_j|=\binom42\binom42\binom{44}3\text{ for }i\lt j.$$ $$|A_i\cap A_j\cap A_k|=\binom42\binom42\binom42\binom{40}1\text{ for }i\lt j\lt k.$$ By the in-and-out formula, $$|A_1\cup\cdots\cup A_{13}|=\binom{13}1\binom42\binom{48}5-\binom{13}2\binom42\binom42\binom{44}5+\binom{13}3\binom42\binom42\binom42\binom{40}1$$ $$=133559712-37189152+2471040=\boxed{98841600}.$$