2
$\begingroup$

Suppose you have $n$ boys and $n$ girls. How many ways are there to assign roommates to each other if

(1) boys can only room with boys and girls can only room with girls

(2) boys can only room with girls and vice versa?

Assume each person must room with exactly one other person.

  • 1
    If $n$ is odd, then the answer to part (1) is $0$. ;-)2012-10-25

1 Answers 1

3

in case 1 you can solve the problems of assigning boys rooms and girls rooms separately, then multiply the numbers to get the result. Both subproblem are the same actually so the answer is something squared. Assume $n$ even otherwise there's no solution: in that case line the boys up and for the first pick one of the $n-1$ boys, for the second pick one of the $n-3$ remaining and so on. Do the same with girls. Then you get $[(n-1)(n-3)\cdots]^2$ ways.

In the second case line the boys and pair girls up with them, then count the number of permutations of girls: $n!$

  • 2
    To write the first part without dots: $\left(\frac{n!}{m!2^m}\right)^2=\frac {n!^2}{m!^22^n}$, where $n=2m$.2012-10-25