[Math] Counting number of two pair hands in poker (not standard)

card-gamescombinatoricspoker

I was doing number counting problem and wanted to check if my result was correct.

Problem description:

From a standard deck of cards(52 cards, 4 suits, 13 numbers in each suit) there are 5 cards drawn.
Calculate number of hands where there are atleast two cards with the same number and atleast two cards with different number. The fifth card can be anything, even same as one of the pair numbers.

For example these two would be valid hands:

5$\heartsuit$ 5$\clubsuit$ 9$\spadesuit$ 9$\diamondsuit$ 2$\heartsuit$,

J$\heartsuit$ J$\clubsuit$ 4$\spadesuit$ 4$\diamondsuit$ 4$\heartsuit$

My attempt at solving this:

First I choose two cards with the same number from two different suits.

$\dbinom{13}{1} * \dbinom{4}{2}$

Then I choose two cards with the same number but not the one from the first two and two different suits.

$\dbinom{12}{1} * \dbinom{4}{2}$

Finally I choose the last card which can be anything.

$\dbinom{13}{1} * \dbinom{4}{1}$

So the total number of hands would be: $\dbinom{13}{1} * \dbinom{4}{2} * \dbinom{12}{1} * \dbinom{4}{2} * \dbinom{13}{1} * \dbinom{4}{1}$

Is this correct?
If not then could you correct the part where I am wrong?

Thanks!

Best Answer

From the comments, it seems that you are allowing only hands of the $3$-$2$ type, commonly called Full House, and hands of the $2$-$2$-$1$ type, commonly called Two Pairs.

Full House: The kind we have $3$ of can be chosen in $\binom{13}{1}$ ways. For each such way, the actual $3$ cards can be chosen in $\binom{4}{3}$ ways. for every way of doing these things, there are $\binom{12}{1}$ ways of choosing the kind we have $2$ of, and then $\binom{4}{2}$ ways to choose the $2$ cards, for a total of $\binom{13}{1}\binom{4}{3}\binom{12}{1}\binom{4}{2}$.

Two Pairs: This one is tricky, it is all too easy to double count. The two kinds we have $2$ each of can be chosen in $\binom{13}{2}$ ways. For each of thse ways, the $2$ cards of the higher-ranking kind can be chosen in $\binom{4}{2}$ ways, and for each of these ways the cards of the other kind can be chosen in $\binom{4}{2}$ ways. Finally, after all this has been done, the "junk" card can be chosen in $\binom{44}{1}$ ways, for a total of $\binom{13}{2}\binom{4}{2}\binom{4}{2}\binom{44}{1}$.

Finally, add the two numbers obtained above.

Remark: Your calculation does multiple counting in various ways. For example, consider the hand $\spadesuit$ K, $\heartsuit$ K, $\diamondsuit$ $7$, $\clubsuit$ $7$, $\heartsuit$ Q. This has been double-counted, for you have counted as different the choice $\diamondsuit$ $7$, $\clubsuit$ $7$, $\spadesuit$ K, $\heartsuit$ K, $\heartsuit$ Q. This is because your first choice of kind, among the $\binom{13}{1}$ could have been K, and your second choice among the $\binom{12}{1}$ could have been $7$, or the other way around. But these give the same hand,

Counting in a way that avoids multiple counting can be initially quite tricky. We naturally think in terms of doing things sequentially, "first" then "second." we have to be careful to make sure that different choices of "first" and "second" do not yield the same final hand.