What is the difference between the number of combinations you can make when forming a line with 8 girls and 6 boys where at most 3 of the same gender can only be adjacent to each other to when you arrange them in a round circle with the same rule?
In the first scenario we have 6 boys and 8 girls. And only at most 3 of the same gender can be adjacent. So I can treat this as a random 14 letter arrangement like: ${A,B,C,D,E,F,G,H,a,b,c,d,e,f}$
Where only at most 3 uppercase letters and 3 lowercase letters can be adjacent to each other. So the total number of arrangments is $14!$ ways without restrictions.
The second scenario has the same number of students and restrictions. But the total number of arrangments is $(14-1)!$
So my question is, how can I form an expression for both of the scenarios so that I can find their total number of arrangements with the restrictions since I am looking for their difference?
In an online math contest, I assume it's legitimate to use a computer. Even so, it requires some analysis, because $14!$ is over $87$ billion, so you don't want to list all the permutations.
I approached it by counting all the permutations of $8$ B's and $6$ G's that don't have $3$ consecutive identical letters. I counted $300$ of these. Of course, each represents $6!\cdot8!$ permutations of the children.
In some of these permutations, we can close the line into a circle that obeys the condition, and in some we cannot. For example, if the line begins with $2$ boys and also ends with a boy, closing the circle would give $3$ boys in a row. I also counted how many lines could be closed into circles, and got $196$. That gives $196\cdot8!\cdot6!$, but since we're arranging the children in a circle, we have to divide by $14$ so we have only $14\cdot8!\cdot6!$ circular arrangements.
Finally the difference is $$(300-14)\cdot8!\cdot6!=8,302,694,400$$ so that we really didn't want to generate them.
The numbers are small enough that one could do it by hand, if for some reason that were necessary. There can must be at least $3$ groups of girls, and there can be at most $6$, where a group is a maximal set of adjacent persons of the same sex. There are at least $4$ groups of boys and at most $7$. (There can't be $8$ because $6$ girls cans separate the boys into at most $7$ groups.)
Suppose there are $3$ groups of girls. The only possible arrangement is BBGGBBGGBBGGBB, which gives $1$ line, and no circle.
Suppose there are $6$ groups of girls. There are at least $5$ groups of boys, so that leaves $3$ boys to dispose of. If we don't put any boys on the end, we must put $1$ boy in each of $3$ of the $5$ spots between the girls, giving $\binom53$. If we put a boy on one of the ends but not the other, we have $2\binom{5}{2}$ ways, since there are two ways to choose the ends. Or we could put $1$ boy on each end in $5$ ways. We could put $2$ boys on one end, and none on the other in $10$ ways. Finally, we could put $2$ boys on one end, and $1$ one the other in $2$ ways. Only these last $2$ ways can't be closed into a circle. If I haven't lost count, that's $47$ lines and $45$ circles.
I'll leave the cases or $4$ and $5$ girls to you, if you're interested.