# In how many ways can $3$ boys and $3$ girls be seated in a row such that each boy is adjacent to at least one girl?

The number of ways of seating 3 boys and 3 girls in a row, such that each boy is adjacent to at least one girl, is?

My Approach:
First arrange the 3 boys in $3!$ ways one of them being $$\_b_1\_b_2\_b_3\_$$ Now, the girls can sit in any 3 of the 4 spaces left so $$^4C_3*3!$$ In total $^4C_3\times (3!)^2=144$

Book says the answer is 360, I'm not sure how I'm missing over half of the permutations.

Here is an approach that can be used even for larger problems with ease.

Place the $3$ girls. Each placement creates $2$ inner slots ($\bullet$) where one or two boys can be placed, and $2$ outer slots ($\circ$) where only one boy can be placed, viz. $\quad\circ\;G\;\bullet\;G\;\bullet\;G\;\circ$

If all the boys are separate, there will be $\binom43 = 4$ placements

If two boys are together, they can occupy either of $2$ inner slots,
and the remaining boy can occupy any of the remaining $3$ to create $2\cdot3 = 6$ placements

Thus total arrangements $=(4+6)(3!3!) = 360$

Your attempt is incorrect since you did not consider cases such as $b_1g_1g_2b_2b_3g_3$ in which two girls sit in adjacent seats.

There are $6!$ ways to arrange six children. From these, we must exclude those arrangements in which at least one boy is not adjacent to a girl. This can occur in two ways. Either all three boys sit in consecutive seats or exactly two of the boys are at one end of the row.

Three boys sit consecutive seats: We have four objects to arrange, the block consisting of three boys and the three girls. The objects can be arranged in $4!$ ways. The boys can be arranged within their block in $3!$ ways. Hence, there are $4!3!$ such seating arrangements.

Exactly two boys are at one end of the row: There are two ways to choose the end of the row where the two boys will sit. There are $\binom{3}{2}$ ways to choose which two of the boys will sit together. There are $3$ ways to choose which of the girls will sit adjacent to the block of boys. There are $3!$ ways to arrange the remaining three students in the remaining three seats. There are $2!$ ways to arrange the boys within the block. Hence, there are $$\binom{2}{1}\binom{3}{2}\binom{3}{1}3!2!$$ such seating arrangements.

Hence, the number of admissible seating arrangements is $$6! - 4!3! - \binom{2}{1}\binom{3}{2}\binom{3}{1}3!2!$$

There are $\binom63=20$ different boy/girl configurations. Ten are inadmissible because they have a boy next to only boys:

BBBggg  BBgBgg
BBggBg  BBgggB
gBBBgg  ggBBBg
BgggBB  gBggBB
ggBgBB  gggBBB


This leaves ten admissible configurations, and for each there are $(3!)^2=36$ ways of permuting the boys and girls, for a total of 360 ways.

• ok, but where exatcly am i going wrong? – Anvit Dec 10 '17 at 11:21
• @AnvitGarg Note that you have considered the case that boys and girls should sit in alternate positions. But, the question says that a boy can be adjacent to atleast one girl. – Rohan Dec 10 '17 at 11:22
• @AnvitGarg You overlooked permutations such as $b_1g_1g_2b_2b_3g_3$ in which two or more girls are consecutive. – N. F. Taussig Dec 10 '17 at 11:22