0
$\begingroup$

Let's say I have $2n$ items and I want to designate $n$ pairs, where each pair is unordered. For example, if $n=2$:

$A A B B$

$B B A A$

$A B A B$

$B A B A$

$A B B A$

$B A A B$

I think that's all of them, anyway. I am having trouble figuring out how to count these without overcounting.

I tried a recursive idea: $\binom{2n}{2}$ ways to pick the positions of the $A$s. Then there are $\binom{2n-2}{2}$ ways to pick the positions of the $B$s. And so on. But for large $n$ this seems possibly wrong or too complex.

For $n=3$, I count $90$:

$AABBCC$

$AABCBC$

$AABCCB$

...

$CCBAAB$

$CCBABA$

$CCBBAA$

  • 0
    For $n=3$ shouldn't you have $A,B,C,D,E,F$ as your items? (and for n=2: $A,B,C,D$?)2017-01-11
  • 0
    @Bram28 No, that isn't what I am trying to count2017-01-11
  • 0
    OK, then I guess I don't understand your question ... can you please make it more clear?2017-01-11
  • 0
    OK, is the question analogous to 'in how many ways can you pair up $2n$ people'?2017-01-11
  • 0
    Or is it that there are $n$ $A$'s and $n$ $B$'s? Or is it that there are two of each of $A$, $B$, $C$, ... (up to $n$)? Looks like it's the latter, right?2017-01-11
  • 1
    For $n=4$ there are only three pairings possible. To be clear, if the objects are $A,B,C,D$ I regard the pairing $AB,CD$ as the same as $CD,AB$.2017-01-11
  • 0
    @lulu I interpreted the OP's question that way as well and answered accordingly ... but apparently that's not what the OP meant. I have been urging the OP to state the question more clearly.2017-01-11
  • 0
    @Bram28 I agree with you. Most readers, I think, would say that to "designate $n$ pairs" means simply to pair the elements...no order implied. Of course, you can say "I have $n$ distinct boxes...how many ways can I put $2$ objects in each, starting with $2n$ objects".2017-01-11
  • 0
    @lulu Right. Without a clearer statement of the problem, I am a bit worried that maybe the OP was making certain (mistaken?) assumptions in the way the six cases for $n=2$ were listed. I *think* that the OP meant your 'boxes' problem where the boxes are unordered (in which case there are only 2 options for $n=2$, but I am not sure. In fact, I note the accepted answer is not compatible with this interpretation.2017-01-11

3 Answers 3

0

Your post simply says that there are $2n$ items without any further assumptions, so I assume that these are all distinct items. OK:

$n=1$ Items are $A$ and $B$: 1 pairing: $AB$

$n=2$ Items are $A,B,C,D$: $A$ can go with 3 possible others, and then it is the number of possible pairing for the other 2, which is of course just 1. So: 3*1 = 3 possible pairings ($AB+CD$, $AC+BD$, and $AD + BC$)

$n=3$: First object can go with 5, and then 3 possible pairings for other 4, so 5*3 = 15 possible pairings.

Etc. ... it is easy to see you will get $(2n-1)*(2n-3)*...*5*3*1$ possible pairings.

0

The answer is

$$\prod_{i=0}^{n-2}\binom{2n-2i}{2},$$

which you can further simplify. To see this, first pick the location of the 2 $A$'s from $2n$ slots. Then pick the location of the $B$'s from the remaining $2n-2$ slots. And so on. The final pair will have a deterministic (only one possible) location.

  • 0
    I don't know if this is true for larger values of $n$ though (where we introduce $C$, $D$, etc). For instance if $n=3$ I get $90$2017-01-11
  • 0
    @user406165: Ah, thanks for the clarification. See new answer.2017-01-11
  • 0
    That looks like my "recursive approach" I mentioned in the main post. Is that the only way to do it? Any hints on how to simplify, if it can be done?2017-01-11
  • 0
    NVM the factorials cancel! I think it simplifies to $(2n)! / 2^n$ unless there's some way to simplify even this2017-01-11
0

I think you want:

$$\frac{(2n)!}{2^n}$$

For each permutation of $2n$ elements, each pair (of the same letter) can appear in two ways; i.e, for $n=2$, think of the strings:

$$A_1 A_2 B_1 B_2 \equiv A_2A_1B_1B_2 \equiv A_1A_2B_2B_1 \equiv A_2A_1B_2B_1$$

as all being the same 'form': $AABB$.

More generally, this is a case of the multinomial theorem. Here, each $k_i! = 2! =2$, so we get the simpler result above.

  • 0
    Intuitive way to think about it, thanks2017-01-11
  • 0
    I'd have said the answer was this divided by $n!$. with four elements $A,B,C,D$ there are only three ways to pair them...just specify which element gets paired with $A$.2017-01-11
  • 0
    To be clear, for objects $A,B,C,D$ I assume the pairing $AB,CD$ is equivalent to the pairing $CD,AB$. Yes?2017-01-11
  • 0
    @lulu I wouldn't have $4$ labeled elements in $4$ slots. I'd have $2n$ slots with $n$ pairs of elements where each pair has the same label.2017-01-11
  • 0
    @user406165 Not following. With $n=2$ I thought you wanted to know how many ways there were to pair the $4$ objects. Right? Well, there are only three. $AB,CD$ and $AC,BD$ and $AD,BC$. What others would you have?2017-01-11
  • 0
    @lulu: The OP counts 'ABAB' and 'BABA' as separate cases; you would not.2017-01-11
  • 0
    Well, the problem doesn't specify that distinction. It asks, simply, for the ways to "designate $n$ pairs". You could, of course, specify that you want an ordered list of $n$ pairs...which is what you have done. I do think, however, that most readers would say that to "designate $n$ pairs" simply means to pair the elements...not to do so in an ordered way.2017-01-11
  • 0
    Perhaps; I found it helpful that the OP additionally explicitly listed all the cases for $n=2$.2017-01-11
  • 0
    I don't think you and I are in disagreement here. You correctly answered one question and I another. The OP needs to edit the post to clarify which was intended.2017-01-11