Answer: We can solve this problem using the technique of combinatorics known as the "Stars and Bars" method.
We can think of the 3 boys and 4 girls as 7 distinguishable objects and 3 "bars" that separate them. We are trying to find the number of ways to place the 3 bars among the 7 objects.
For example, if the 3 bars are represented by the symbols |, |, |
BB|G|GBG|G|GBG
The leftmost and rightmost spaces always contain a boy or a girl, so there are a total of 9 spaces to put the 3 bars.
This means that there are C(9,3) = 84 ways to place the 3 bars among the 7 people.
So, there are 84 ways in which 3 boys and 4 girls can sit in a row such that no two people of the same sex sit together.
Explanation: