We have a set $A=\{a_1, a_2, ..., a_{2n}\}$ such that $|A|=2n$. We have subsets of $A$, $G = \{a_1, a_2, ..., a_n\}$, $B=\{a_{n+1}, a_{n+2}, ..., a_{2n}\}$. For the sake of this example, lets say $A$ is all the students in a classrom; $G$ are girls and $B$ are boys. There are $n$ girls and $n$ boys, such that in total there are $2n$ students.
We are asked to line these students so that all girls are together forming a single block on the line. For example, if first letters of the alphabet are girls and last are boys,
$wxyabcdefzuv$
In this line we have three boys, $wxy$, six girls, $abcdef$, and three other boys $efg$ lined up in a way that all girls are together. Of course in this example $n=6$.
The question is: how many possible ways are there to sort the students for any value of $n$ so that girls are all next to each other on the line?
What I've tried so far is to state that, when forming a line, I can either choose a boy or a girl. So I have $2n$ possibilities, $n$ for choosing a girl and $n$ for choosing a boy. If I choose a boy, my alternatives for the second choice are down to $n-1$ for the boys and still $n$ for the girls. If, on the other hand, I'd chosen a girl, my alternatives would have been $(n-1)!$, this is all the girls that I didnt choose in the first place. In either decisition, it seems I can choose $n!$ for the boys or $n!$ for the girls, so the ways to line them up should be
$n! + n!=2n!$
But I then supposed $n=3$ and tested the possibilities and I think there are more than $3! + 3!=12$. What am I getting wrong?
Treat the girls as a block. Then we have $n + 1$ objects to arrange, the $n$ boys and the block of $n$ girls. The objects can be arranged in $(n + 1)!$ ways. The girls can be arranged within the block in $n!$ ways. Hence, there are $(n + 1)!n!$ ways to arrange $n$ boys and $n$ girls in a row if all $n$ girls are together.
To keep the numbers manageable, consider the case of two boys and two girls. Suppose the boys are Alan and Bruce and the girls are Claire and Debra. The block of girls must start in the first, second, or third position. The block of girls, Alan, and Bruce can be arranged in $3!$ ways. The girls can be arranged within the block in $2!$ ways, giving us $3!2! = 12$ possible arrangements. They are
Alan, Bruce, Claire, Debra
Bruce, Alan, Claire, Debra
Alan, Bruce, Debra, Claire
Bruce, Alan, Debra, Claire
Alan, Claire, Debra, Bruce
Bruce, Claire, Debra, Alan
Alan, Debra, Claire, Bruce
Bruce, Debra, Claire, Alan
Claire, Debra, Alan, Bruce
Claire, Debra, Bruce, Alan
Debra, Claire, Alan, Bruce
Debra, Claire, Bruce, Alan