How Many Ways to Arrange These Boys and Girls? 
There are $7$ boys and $3$ girls.  In how many ways can they be arranged in a row such that the two ends are occupied by boys and no two girls are seated together?

The answer is  $6 \cdot 5 \cdot 4 \cdot 7!$ and the book gave the same explanation is the same as the one here.  This was my analysis.  Can you explain why it's wrong?
There are $7 \cdot 6$ ways to fill the first and the last slot.  If we ignore the rules for a moment, there are $8!$ ways to fill the remaining slots.


*

*Any time we have two girls together is unacceptable.  So, we can count the two girls as one person.  This gives us $7!$ unacceptable arrangements before considering the different choices in the two-girl spot.

*Since there are $3 \cdot 2$ ways to fill the two-girl spots, we have $6 \cdot 7!$ unacceptable arrangements in the middle.


It follows that there are $2 \cdot 7!$ acceptable arrangements in the middle, and $7 \cdot 6 \cdot 2 \cdot 7!$ ways to fill the spots according the the rules.  As you see, I am short by $6 \cdot 7!$.  What am I missing?
 A: Note that you counted the time three girls were together two times. 
To elaborate, if there are three girls in a row, as in $GGG$, then you exclude these two times when you exlude when two girls are together. This is because you have counted $\color{red}{GG}G$ as well as $G\color{blue}{GG}$. Instead, you should apply the inclusion-exclusion principle and add the case three girls are together. 
Using the inclusion-exclusion principle, we have to add when three girls are in a row in the middle, which is  $5! \times 6$ using your method. This explains why you are short by $6! \times 6 \times 7$ since you have to multiply by $6 \times 7$ later. 
A: You have $20$ different seat-combinations for the girls:


*

*$2,4,6$

*$2,4,7$

*$2,4,8$

*$2,4,9$

*$2,5,7$

*$2,5,8$

*$2,5,9$

*$2,6,8$

*$2,6,9$

*$2,7,9$

*$3,5,7$

*$3,5,8$

*$3,5,9$

*$3,6,8$

*$3,6,9$

*$3,7,9$

*$4,6,8$

*$4,6,9$

*$4,7,9$

*$5,7,9$


Then, you can permute the girls in $3!$ different ways.
Then, you can permute the boys in $7!$ different ways.
Hence the total number of ways to arrange them is $20\cdot3!\cdot7!$.
