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: 17280
Solutions · 1
Official solution
All boys together: Treat 5 boys as one block; arrange block with 4 girls: 5! ways, and boys within block: 5! ways: 5!×5!
No two boys together: Arrange 4 girls first: 4! ways, creating 5 gaps; place the 5 boys into these 5 gaps: 5! ways: 4!×5!
These two cases are mutually exclusive, so:
\[\text{Total} = 5!\times5! + 4!\times5! = 14400 + 2880 = 17280\]