I'm trying to calculate how many poker hands called Two Pair, there are. Such a hand consists of one pair of one rank, another pair of another rank and one card of a third rank. A poker hand consists of 5 cards.
I have two methods that I thought would work equally well. Turns out only one of them yields the correct answer. I was wondering if anyone here knows why the second solution gives the wrong answer.
Solution 1 (Correct):
We choose 2 ranks out of 13, which can be done in $\binom{13}{2}$ ways.
For the first rank we choose 2 suits out of 4, which can be done in $\binom{4}{2}$ ways.
For the second rank we choose 2 suits out of 4, which can be done in $\binom{4}{2}$ ways.
The last card can be chosen in $44$ different ways.
So the total number of hands is $\binom{13}{2}\cdot \binom{4}{2}\cdot \binom{4}{2}\cdot 44=123,552$
Solution 2 (Incorrect):
We choose 3 ranks out of 13, which can be done in $\binom{13}{3}$ ways.
For the first rank we choose 2 suits out of 4, which can be done in $\binom{4}{2}$ ways.
For the second rank we choose 2 suits out of 4, which can be done in $\binom{4}{2}$ ways.
For the third rank we choose 1 suit out of 4, which can be done in $4$ ways.
So the total number of hands is $\binom{13}{3}\cdot \binom{4}{2}\cdot \binom{4}{2}\cdot 4=41,184$
This is just a third of the correct number of hands. Why the second solution is wrong unfortunately seems to elude me......
Assume your choose three ranks R1, R2, R3.
In the first solution: You choose (R1, R2) first $\binom{13}{2}$ then assign the suits. Lastly, you choose R3 from the rest (remaining 44). The reason why $\binom{13}{2}$ is chosen to avoid double count since order does not matter for this two ranks: as (R1,R1,R2,R2,R3) is the same as (R2,R2,R1,R1,R3). (writing R1 R1 meaning two suits rank 1, pardon my laziness). This is correct.
In the second solution:
You choose (R1,R2,R3) first then assign the suits. But using $\binom{13}{3}$ means the order of the three ranks do not matter. In other words, you are treating the three hands (R1,R1,R2,R2,R3), (R3,R3,R2,R2,R1), (R1,R1,R3,R3,R2) as one hand only. Thus you undercount 3 times.