JEE Main 2025 · 23 January · evening · Numerical answer · +4 / −1

The number of ways, 5 boys and 4 girls can sit in a row so that either all the boys sit together or no two boys sit together, is ________.

Answer and solution

Answer 17280

Solution

Maths sir · 4 steps

The two conditions can never happen together, so count each case on its own and add.

  1. All boys together. Tie the 5 boys into one block. The block and the 4 girls make 5 units, which can be arranged in 5! ways. Inside the block, the boys can be arranged in 5! ways, so this case gives 5! × 5! = 120 × 120 = 14400.
  2. No two boys together. First seat the 4 girls in 4! = 24 ways. They leave 5 gaps (two at the ends and three between), and the 5 boys must fill all 5 gaps, one boy each, in 5! = 120 ways. This case gives 24 × 120 = 2880.
  3. No overlap. If all 5 boys sit together, some two boys are next to each other. So no arrangement is counted in both cases, and the two counts can be added directly.

    5! × 5! + 4! × 5! = 14400 + 2880 = 17280

  4. So. The number of ways is 17280.

The common slip: 3000. Forgetting that the 5 boys can swap places inside their block gives 5! + 2880 = 3000 instead of 17280.

The idea to keep. For "together", glue the group into one block and remember to arrange inside the block. For "no two together", seat the others first and place the group in the gaps.

Answer from the NTA final answer key. Solution by PrepWiser.

Study Permutations & Combinations

Asked about 160 times in JEE Main since 2020. This question is from 2025.