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 \rule{2cm}{0.4pt}.
Step-by-Step Solution
Key Concept: Two events: $A=$ all boys together (block of $5$ + $4$ girls $=5!$ outer arrangements $\times 5!$ inside the block) and $B=$ no two boys adjacent (place $4$ girls in $4!$ ways, then $5$ boys in the $5$ gaps in $5!$ ways). $A\cap B$ requires both — impossible with $5$ boys — so add the counts.
$|A|$: treat $5$ boys as one block. Block + $4$ girls $=5$ entities $\Rightarrow 5!$ outer orders. Internal: $5!$. So $|A|=5!\cdot 5!=14400.$
$|B|$: place $4$ girls in a row ($4!$). They create $5$ gaps (including ends). Place $5$ boys, one per gap: $5!$ ways. So $|B|=4!\cdot 5!=2880.$
$A\cap B=\emptyset$ (cannot both hold).
$|A\cup B|=14400+2880=17280.$
Correct Answer: 17280