problem regarding permutation.

There are 8 boys and 7 girls in a group. For each of the tasks specified below, write an expression for the number of ways of doing it.

a) Sitting in a row so that all boys sit contiguously and all girls sit contiguously, i.e., no girl sits between any two boys and no boy sits between any two girls

I Cant able find to the correct reasoning.please someone help.

• "all boys sit contiguously and all girls sit contiguously" sounds like $8!\cdot7!\cdot2!$. – barak manos Dec 18 '16 at 19:40
• yes right but how sir,reason it please @barakmanos – Sathasivam K Dec 18 '16 at 19:41
• "no girl sits between any two boys and no boy sits between any two girls" sounds not equivalent to the previous definition!!! Unless that row is a circle, something's fundamentally wrong with this question IMO. – barak manos Dec 18 '16 at 19:42
• no girl sits between any two boys and no boy sits between any two girls – Sathasivam K Dec 18 '16 at 19:49
• @barakmanos : Yes, I first wrote an answer to the "all boys sit contiguously and all girls sit contiguously". This is just 8!7!2! by clumping them together in two groups, B and G. Saying "no girl sits between any two boys and no boy sits between any two girls" is saying that we could have girls/boys sitting together in pairs (or groups of n) for example (leaving one girl alone furthest out in the first case). You have to decide what the question is. EDIT: Sorry, saw your answer above first now Sathasivam, also therefore I deleted my answer. – Christopher.L Dec 18 '16 at 20:01

Ok, so what you do is to first realize that you may order the boys in $8!$ ways. Hopefully you already know how to reason here. (You may choose the first one in $8$ ways, the second in $7$ ways, and so on.)
The same reasoning goes for the girls, here we get $7!$ ways to sit them down.
Now for each order of boys, $8!$, you may order the girls in $7!$ ways, so by the rule of product you can sit them down in $8!7!$ ways.
Now, think of all boys/girls, sitting down in a row, as one group, call the groups $B$ for boys and $G$ for girls (you have $8!$ such boy groups, and $7!$ such girl groups). Then you have to take into account that you may order these two groups in $2!$ ways, namely $BG$ and $GB$. (This is because you couldn't mix the two groups up, because of the condition of boys/girls sitting contiguously by gender. You may only mix up the order of the groups.)
Again then, by rule of product, you have $8!7!2!$ ways in total.