# Number of ways in which 5 girls and 5 boys can be arranged in a line such that only 4 girls stand adjacent to one another

I have already calculated n but i am confused to find the value of m. I have tried the following process:-

1. Selected 4 girls from 5 girls in $${}_5C_1$$ ways and treated it as a unit

2. After selecting 4 girls, we are left with 6 people (5B and 1G), these 6 people create 7 gaps among one other but we can place the 4 girl unit in only one of the 5 gaps ( excluded the gap created by the one remaining girl). So out of 5 gaps i can select 1 gap in $${}_5C_1$$ and place the 4 girls there. Additionally, these 4 girls can be permuted among themselves in 4! ways in that gap. Finally, the 5 boys can be permuted among themselves in 5! Ways (We cannot include the remaining girl in the permutation of the 5 boys as then the permutation would be 6! which would also include the case when all the girls are together)

Where did i go wrong in these process?

• To any would-be drive-by close-voters (of which there has already been one): Please help the new user out by explaining how to improve the question. (Use of MathJax is probably high on the list, but being explicit is helpful.) If you don't explain, then we just get more questions that you'll close-vote. This user is not obviously insincere or unwilling to work toward a solution—at least, not to me. Thanks! Apr 12 at 6:17
• To the OP: Please use MathJax (some tips linked above) to improve the typesetting of your question. For example, ${}_5C_1$ yields ${}_5C_1$, and $4!$ yields $4!$. Apr 12 at 6:18

Where you have complicated things for yourself ("gone wrong") is to place the girl group first among others and then think of permuting the rest

Instead, choose the girl who will not be part of the girl group and permute along with the boys.

Then place and permute the group of girls, avoiding placing them next to the already placed girl (which you already know how to do).

• Can you provide the answer? Apr 12 at 8:18
• Only the order of steps from your efforts has been changed, you should be able to solve it. If you are still facing difficulty, let me know Apr 12 at 11:21

In your attempt, the number of spaces in which you can place the group of four consecutive girls depends on whether or not you placed the single girl at an end of a row or between two boys.

Here is an alternate strategy:

1. Arrange the five boys in a row. This creates six spaces in which to place the girls, four between successive boys and two at the ends of the row.
2. Choose the girl who will be placed by herself.
3. Choose one of the six spaces in which to place that girl.
4. Choose one of the five remaining spaces in which to place the other four girls.
5. Arrange the four girls in that space.

If you have one group of four girls, and one group of a single girl, then you can break it down into five smaller problems, which differ by the number of boys between the two groups of girls:

1: Five boys between the girl groups: Two permutations, GGGGBBBBBG and GBBBBGGGGG.

2: Four boys only: Two permutations, GGGGBBBBG and GBBBBGGGG, can each have a boy added to either the front or the end, for a total of four permutations.

3: Three boys only: Two permutations, GGGGBBBG and GBBBGGGG, can each have two boys added to the start, or two boys added to the end, or one boy at the start and end, for a total of six permutations.

4: Two boys only: Two permutations, GGGGBBG GBBGGGG, with four permutations for each to distribute the remaining three boys. Total of eight permutations.

5: One boy only: Two permutations, GGGGBG and GBGGGG, with five permutations each for the distribution of the remaining four boys. Ten permutations.

Total permutations: 2 + 4 + 6 + 8 + 10 = 30.

• I think this is incomplete. I like the general approach, but the OP seems to be assuming that the boys and girls are all distinguishable, and seems to want to take that into account. For each of your 30 allowed patterns of boys and girls, then, there would be ${5!}^{2}$ distinct ways to line up the children according to that pattern. Apr 12 at 21:57