In how many ways five distinct balls can be put into the boxes if each box can hold at most one ball and no two boxes without balls are adjacent?

Eight boxes are arranged in a row. In how many ways can five distinct balls can be put into the boxes if each box can hold at most one ball and no two boxes without balls are adjacent?

Attempt: Choose the pair of boxes without balls first. There are $7$ ways to do this.

Then choose the other box without balls. There are $6$ ways to do this.

Then subtract the number of ways which the $3$ boxes are together. There are $6$ ways to do this.

Thus there are $36$ ways to choose empty boxes, and $5!$ ways to choose how to put in the balls, so we get $4320$.

I'm right?


Line up five unmarked boxes in a row. Arrange the five balls in those boxes, which can be done in $5!$ ways. Doing so creates six spaces in which to place an empty box. $$\square b_1 \square b_2 \square b_3 \square b_4 \square b_5 \square$$ To ensure that no two of the three empty boxes are adjacent, choose three of these six spaces in which to place an empty box, which can be done in $\binom{6}{3}$ ways. Now, number the boxes from left to right. Hence, there are $$5!\binom{6}{3} = 2400$$ admissible arrangements.