Here is the example that I was solving from the book on probability.
A football team consists of $20$ offensive and $20$ defensive players. The players are to be paired in groups of $2$ for the purpose of determining roommates. If the pairing is done at random, what is the probability that there are no offensive-defensive roommate pairs? What is the probability that there are $2i$ offensive-defensive roommate pairs, $i=1,2,\ldots,10$?
Solution There are $$\binom{40}{2,2,\ldots,2}=\frac{(40)!}{(2!)^{20}}$$ ways of dividing the $40$ players into $20$ ordered pairs of two each. (That is, there are $(40)!/2^{20}$ ways of dividing the players into a first pair, a second pair, and so on.) Hence, there are $(40)!/2^{20}(20)!$ ways of dividing the players into (unordered) pairs of $2$ each. Furthermore, since a division will result in no offensive-defensive pairs if the offensive (and defensive) players are paired among themselves, it follows that there are $[(20)!/2^{10}(10)!]^2$ such divisions. Hence, the probability of no offensive-defensive roommate pairs, call it $P_0$, is given by $$P_0=\frac{\left(\frac{(20)!}{2^{10}(10)!}\right)^2}{\frac{(40)!}{2^{20}(20)!}}=\frac{[(20)!]^3}{[(10)!]^2(40)!}.$$
What I don't understand is why is the solution considering unordered pair for the calculation? Aren't we choosing sets without any permutation of elements within them? What are we over-counting here? Can someone explain what am I missing?
Consider the $20$ rooms and assign players to these rooms as follows:-
Choose two players for the first room in $\begin{pmatrix}40\\2\\\end{pmatrix}=\frac {40\times 39}{2\times 1}$ ways.
Now choose for the next room from the remaining 38 players etc.
This gives the number $$\frac {40!}{(2!)^{20}}.$$
The rooms themselves can be arranged in $20!$ ways and this arrangement is irrelevant to the pairings so the answer is divided by $20!$ to obtain the number of pairings.