【Example 7】Place $k$ indistinguishable balls into $n$ different boxes, $4 \leqslant n \leqslant k$, with at most 3 empty boxes. How many ways are there to do this?
We can first find the number of ways for "no empty box", "exactly 1 empty box", "exactly 2 empty boxes", "exactly 3 empty boxes", etc., and then use the addition principle to get the total number of ways. Let the corresponding sets of ways be denoted as $B_{0}, B_{1}, B_{2}, B_{3}$.

We have $\left|B_{0}\right|=C_{k-1}^{n-1}$. In the ways in $B_{i}$, exactly $i$ boxes are empty, which $i$? There are $C_{n}^{i}$ different possibilities; the remaining $n-i$ boxes have no empty boxes, with $C_{k-1}^{n-i-1}$ ways to place the balls, so we know $\left|B_{i}\right|=C_{n}^{i} \cdot C_{k-1}^{n-i-1}$. Therefore, the number of ways with at most 3 empty boxes is $\sum_{i=0}^{3}\left|B_{i}\right|=\sum_{i=0}^{3} C_{n}^{i} \cdot C_{k-1}^{n-i-1}$.