Q. Find the number of different ways that $6$ boys and $4$ girls can stand in a line if
(i) all $6$ boys stand next to each other,
(ii) no girl stands next to another girl.
A. (i) There are $5$ "patterns", because I can start with $0$ to $4$ Gs, then put $6$ Bs, and then the remaining $4$ to $0$ Gs. For each pattern, $6!$ orders of B and $4!$ of G, so the answer is $5.6!.4! = 86400$.
(ii) As before, the answer is $k.6!.4!$, but it is not so easy to find $k$, the number of patterns. I can enumerate them as xGBxGBxGBxGx where each x represents $0$ to $3$ Bs, and the total of the xs is $3$. With some work, I find $k=35$. But there should be an easier way, I think.
(ii)
You must find the number of sums $b_1+b_2+b_3+b_4+b_5=6$ where $b_1,b_5$ are nonnegative integers and $b_2,b_3,b_4$ are positive integers.
Here $b_1$ stands for the number of boys utmost left, $b_5$ for the number of boys utmost right and e.g. $b_2$ for the number of boys between the first and the second girl on the left.
Finding this number comes to the same as finding the number of sums $a_1+a_2+a_3+a_4+a_5=3$ where then $a_i$ are nonnegative numbers.
This arises if we substitute $b_1=a_1, b_5=a_5$ and $b_i=a_i+1$ for $i=2,3,4$.
Then with stars and bars we find $\binom{3+4}4=35$ possibilities for that.
So the final number of possibilities equals $35\times4!\times6!$.