# What is the probability for this following problem?

Suppose you have 7 boys and 3 girls want to sit in the line.

What is the probability if two boys must be sit in the both end and the girls must not sit adjacent to another girl?

My attempt:

Since both end are occupied by boys, so the available slots is only 8 seats.

From 8 seats, because girl may not sit with another girl, so the available slot for girl 1 is 8-2= 6 seats. Girl 2 is 5 seats and the girl 3 is 4 seats. So, the ways to arrange girl is $6*5*4$ ways

From the boys, there are no restrictions, so the number of arrangement is 7!.

So, the total number of arrangement is $7!*(6*5*4)$

Then the probability is $\frac{7!*6*5*4}{10!}$= $\frac{1}{6}$

Is my way true? Or I missed something?

Thanks

Your answer is correct, but the method you used is not sound.

We seat the boys first, leaving gaps in which to place the girls. The seven boys can be arranged in $7!$ ways. Since the girls must not be placed at the ends of the row, there are six spaces between successive boys in which the girls can be placed. We can choose three of these six spaces in $\binom{6}{3}$ ways. We can arrange the three girls in the chosen spaces in $3!$ ways. Thus, of the $10!$ arrangements of the ten people, there are $$7!\cdot \binom{6}{3} \cdot 3!$$ arrangements in which there is a boy at each end of the row and no two girls sit in consecutive seats. Hence, the desired probability is $$\frac{7! \cdot \binom{6}{3} \cdot 3!}{10!}$$ which agrees with your answer.

The problem is more complicated.

For example, if the first girl sits in the first or last positions, the second girl will have 6 available spots, but if the first girl sits away from the ends, the second girl will have 5 available spots.

Then the number of available spots for the third girl will depend on how the first and second girl were seated. There will be several different cases.

The most direct solution I imagine is simply use the computer. Let $a,b,c$ be the positions of the girls. They cannot sit on top of one another, nor next to each other. So $a\notin \{b-1,b,b+1\}$, etc.

Using Maple or Mathematica, compute the sum

$\sum_{a=1}^8\sum_{b=1}^8\sum_{c=1}^8(1-\delta_{a,b-1})(1-\delta_{a,b})(1-\delta_{a,b+1})(1-\delta_{c,b-1})(1-\delta_{c,b})(1-\delta_{c,b+1}) (1-\delta_{a,c-1})(1-\delta_{a,c})(1-\delta_{a,c+1})=120$

This is not nice-looking, but it is easier than trying to control all possible seating arrangements.

As you say, the boys have no constraint, so they give a factor 7!.

Quite surprisingly, this gives the same result you had.