# Number of ways in which they can be seated if the $2$ girls are together and the other two are also together but separate from the first two

$5$ boys and $4$ girls sit in a straight line. Find the number of ways in which they can be seated if $2$ girls are together and the other two are also together but separate from the first two.

I divided the $4$ girls in two groups in $\frac{4!}{2!2!}$ ways.

I counted $10$ ways in which there is at least one boy between the two girl pairs. Boys can be arranged in $5!$ ways. Total number of ways$=\frac{4!}{2!2!}\times 10\times 5!=7200$

But the answer in the book is $43200$. I don't know where I am wrong.

• What do you mean "the two girls are together"? That makes it sound as if the pair is specified. – lulu Apr 4 '16 at 16:10
• Sorry,"the" was not given,i edited it.@lulu – mathspuzzle Apr 4 '16 at 16:13
• no problem. I'll post something below. – lulu Apr 4 '16 at 16:13

Method I: Fix two ordered pairs of girls $AB,CD$. Then there are $7!$ ways to arrange the five boys and these two dyads. Of course we might have $ABCD$ together, so to rule that out subtract $6!$. Similarly, we must rule out another factor of $6!$ to exclude $CDAB$. Thus for these two ordered pairs there are $$7!-2\times 6!=3600$$ suitable arrangements.
Now, sticking to these pairs but varying the order gets us $$4\times 3600=14,400$$
And, finally, we can change the pairs. Instead of $AB$ we could have had $AC$ or $AD$ so, finally, $$3\times 14,400= 43,200$$
Method II: (closer to what you were trying) Arrange the kids as $$-\;AB-CD\;-$$ Where $A,B,C,D$ denote the four girls (unspecified) and the boys go in the dashed areas. We know the middle dashed area must contain at least a single boy. There are $15$ satisfactory ways to arrange the boys: $$\{0,5,0\},\;\{1,4,0\},\;\{0,4,1\},\;\{2,3,0\},\;\{0,3,2\},\;\{1,3,1\},\;\{3,2,0\},\;\{0,2,3\},\;\{2,2,1\},\;\{1,2,2\},\;\{3,1,1\},\;\{1,1,3\},\{2,1,2\},\;\{4,1,0\},\;\{0,1,4\}$$ (I'm writing them all out because I believe you only counted $10$ of these). We must then pick some permutation of the girls to fill the slots labeled $A,B,C,D$ and pick some permutation of the boys to populate the dashed regions thus $$15\times 4!\times 5!=43,200$$
First we count the number of strings of length $7$ made up of the letters b (a single boy) and $G$ (a pair of girls) such that the two G's are not together. Write down five b's like this, with a little gap between them. $$\text{b}\qquad\text{b}\qquad\text{b}\qquad\text{b}\qquad\text{b}$$ These determine $6$ gaps, the $4$ obvious ones and $2$ endgaps. We want to choose two of these to insert the G's into. This can be done in $\binom{6}{2}$ ways.
We have found the number of "patterns." Now permute the girls, permute the boys. The number of arrangements is $\binom{6}{2}4!5!$.