Combinatorics – How Many Ways to Pair Up $2n$ People?

combinatorics

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?

Best Answer

Your answer is correct, but you should write it as $\frac{(2n)!}{2^n n!}$.

Other possible solution is the following. Take any person. Choose a couple for that person, that can be done in $2n-1$ ways. Take any of the remaining $2n-2$. Choose a couple for that person, that can be done in $2n-3$ ways. Continue this process until all couples are assigned. The total number of choices is $$(2n-1)(2n-3)\cdots 3\cdot 1 = \frac{(2n)(2n-1)(2n-2)\cdots 3\cdot 2\cdot 1}{(2n)(2n-2)\cdots2}=\frac{(2n)!}{2^n n!}$$