QlarIITy

MathematicsJEE Main 2025 · 23 JanuaryInteger

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 ________

Try it before you look.The full solution is on this page, below the answer box, the moment you check. No sign-in needed.

Solution

Core idea. Conditions that cannot hold together are counted separately and added.

Concept refresher. Objects that must stay together are treated as one block. If the block and the other objects make kk units and the block holds mm different objects, the number of arrangements is

N=k!×m!N = k! \times m!

Picture the situation. Nine people sit in a row. In the first case the five boys form one unbroken stretch. In the second case no two boys are neighbours; with five boys and only four girls this forces the boys into every other seat, starting and ending with a boy. The two cases cannot happen together.

Approach. Count each case separately and add.

  1. Step 1: All boys together

    The block of boys and the 4 girls make 5 units, arranged in 5!5! ways, with 5!5! orders inside the block, giving 120×120=14400120 \times 120 = 14400.

  2. Step 2: No two boys together

    With 5 boys and only 4 girls, the boys must take seats 1, 3, 5, 7 and 9. They can be arranged in 5!5! ways and the girls in 4!4! ways, giving 120×24=2880120 \times 24 = 2880.

  3. Step 3: Add

    The two cases cannot overlap, so the number of ways is 14400+2880=1728014400 + 2880 = 17280.

Answer. 17280

Sanity check. The gap method agrees for the second case: the 4 girls make 5 gaps, all of which the 5 boys must use, giving 4!×5!4! \times 5!.

Common wrong answers

  • 14400: Counting only the case in which all the boys sit together gives 14400.
  • 3000: Forgetting to arrange the boys inside their block gives 120+2880=3000120 + 2880 = 3000.

Key takeaway

The trap. With one more boy than girls, the alternating pattern must start with a boy.

How toppers think. They check the alternating case with the gap method.

Remember. 5!×5!+5!×4!5! \times 5! + 5! \times 4!

More on Permutations