How many "Two pair" poker hands are there in a standard deck? From the solutions to our midterm, I know the answer of this question to be:
$$\binom{13}{2} \times \binom{4}{2} \times \binom{4}{2} \times \binom{11}{1} \times \binom{4}{1}$$
However, I initially thought it would be:
$$\binom{13}{1} \times \binom{4}{2} \times \binom{12}{1} \times \binom{4}{2} \times \binom{11}{1} \times \binom{4}{1}$$
I think I see that my answer would could KKQQ5 and QQKK5 as two separate hands, but wouldn't the solution read 5QQKK and QQKK5 as separate hands as well?
 A: One thing I like to do with counting problems is to construct bijections -- algorithms for converting back and forth between the thing I'm trying to count, and the thing I know how to count.
e.g. the thing you "knew how to count" is all possible ways to choose the following six things:


*

*A rank

*two distinct suits

*A rank other than the one chosen above

*two distinct suits

*A rank other than the two chosen above

*a suit


and your algorithm for conversion to hands is:


*

*Pick the two cards described by the rank chosen first and the two suits chosen second

*Pick the two cards described by the rank chosen third and the two suits chosen fourth

*Pick the card described by the rank chosen fifth and the suit chosen sixth


and the problem is that the choice $(K, \{\heartsuit, \spadesuit\}, Q, \{\heartsuit, \clubsuit\}, 5, \diamondsuit)$ and $(Q, \{\heartsuit, \clubsuit\}, K, \{\heartsuit, \spadesuit\}, 5, \diamondsuit)$ give the same hand.
The thing the solution manual "knows how to count" is the choices


*

*Two distinct ranks

*Two distinct suits

*Two distinct suits

*A rank different than the ones chosen above

*A suit


and one possible conversion algorithm is


*

*Pick the two cards described by the largest rank chosen first and the two suits chosen second

*Pick the two cards described by the smallest chosen first and the two suits chosen third

*Pick the card described by the rank chosen fourth and the suit chosen fifth


In this case, the only possible list of choices that produce the hand $K \heartsuit K \spadesuit Q \heartsuit Q \clubsuit 5 \diamondsuit$ is the choice $(\{K,Q\}, \{\spadesuit, \heartsuit\}, \{\clubsuit, \heartsuit\}, 5, \diamondsuit)$.
The important thing to note to see this is the fact $\{ K,Q \} = \{ Q, K \}$.
In fact, you can work out an algorithm to go back the other way: from any given poker hand, fill in the blanks for the five choices above. And you can check that the two algorithms are inverses of each other: if you do one and then the other, you always get back what you started. (you need to check both orderings)
A: Constract the hand (of 5 cards) in steps, find the ways that each step can be conducted and then use the multiplication principle to count all the possible ways.
First step. Name two cards (f.e. 3 and J). You can do it in $\dbinom{13}{2}$ ways.
Second step. Take 2 out of 4 from each of the named cards (f.e. take two "3's" and two "J's"). You can do it in $\dbinom{4}{2}\cdot\dbinom{4}{2}$ ways.
Third step. Name the fifth card. (f.e. 5). You can choose now 1 out of 11, so this can be done in $\dbinom{11}{1}$ ways.
Fourth step. Finally take 1 out of the 4  of the named card in the previous step. You can do it in $\dbinom{4}{1}$ ways.
By the multiplication principle you have the result $$\binom{13}{2} \times \binom{4}{2} \times \binom{4}{2} \times \binom{11}{1} \times \binom{4}{1}$$
A: The difference between yours and the solution is $\binom{13}{2}$ versus $\binom{13}{1} \times \binom{12}{1}$. If you write them out you will see that $2 \binom{13}{2} = \binom{13}{1} \times \binom{12}{1}$, the 2 double counting as you have noticed (that KKQQ5 and QQKK5 are essentially the same). 
(Note that $\binom{13}{2}$, the number of ways to choose $2$ pairs from 13 possible is unordered. Meanwhile, $\binom{13}{1} \times \binom{12}{1}$ involves order which we have to remove)
