TITLE: If you have $2n$ people how many different ways can you pair them up?
QUESTION [7 upvotes]: If you have $2n$ people how many different ways can you pair them up?
My method:
Considering making pairs like this:
Randomly line them up and then pair of the $1^{st}$ person in line with the $2^{nd}$, the $3^{rd}$ with the $4^{th}$, ..., the $(2n-1)^{th}$ with the $2n^{th}$
We have $2n!$ ways to line them up. However, this overcounts pairs, a lot.
Consider just 6 people. $A,B,C,D,E$ and $F$. The line $ABCDEF$ gives the same result as the line $BACDEF$
We can flip each person with their partner. He can do this $n$ times so we have overcounted $2^n$ times per order.
However, we have still overcounted! Consider again the line $ABCDEF$ this gives the same pairs as $ABEFCD$ We can indeed shuffle the pairs , as long as they remain with their partners in any order! We have $n!$ ways to shuffle the pairs.
My final answer is then $\frac{2n!}{2^n n!}$
Is this correct? Is anyone able to give some pointers as to how to use some code to confirm this?  Does someone have a nicer answer?

REPLY [3 votes]: Your reasoning is perfectly fine and your answer is correct.
Another approach is to use binomial coefficients (yet very parallel to your method).

How many ways are there to form the first couple? ${2n \choose 2}$.
The second couple? ${2n-2 \choose 2}$.
The third? ${2n-4 \choose 2}$.
etc.

Therefore, there are
$${2n \choose 2} {2n-2 \choose 2} {2n-4 \choose 2} \dots {2 \choose 2} = \frac{(2n)!}{2^n}$$
ways to choose the couples (observe the cancellations in the product).
Finally, as you argued above, the couples may be ordered in $n!$ ways. Hence, the final answer is
$$\frac{(2n)!}{2^n n!}.$$