Suppose you want to distribute $15$ candies to $5$ different children.
(a) In how many ways can this be done if no kid receives more than $6$ candies?
(b) In how many ways can this be done if each child ends up with a different number of candies?
We already determined that the number of ways of distributing the candies to the $5$ children such that each child gets at least one piece is $1,001$ ways.
How do we take care of the restriction of each child receiving no more than $6$? Can we take the complement and subtract the number of ways a child receives $7-15$ pieces? Or would this be a long, unnecessary attempt?
My attempt:
Consider the complement where one kid receives at least $7$ candies.
Step $1$: Choose the child to receive $7$ candies and give him/her the $7$ candies: $5$ choices
Step $2$: Distribute the remaining $15-7=8$ candies to the $5$ children.
There are $\binom{8+4}{4}=\binom{12}{4}=495$ ways to do this.
So there are $5\cdot 495=2,475$ ways to distribute the candies such that one child receives at least $7$ candies.
There are $\binom{15+4}{4}=\binom{19}{4}=3,876$ ways to distribute the candies with no restriction.
So there are $3,876-2,475=1,401$ ways to distribute the candies such that no child receives more than $6$ candies.
Due to the particular values chosen for this problem, it is not too hard to do this by taking the complement, though it gets more difficult in general. For each of the $5$ children, consider the case where that child gets at least $7$. We want to compute the size of the set $S_i$, for $1\leq i\leq 5$, for each of the children. Once you give $7$ to child $i$, you can then count weak compositions of the remaining $8$ into $5$ parts using stars and bars.
Then, for each of the $5$ children, we've counted the number of ways that child $i$ gets at least $7$ pieces, which we put in the set $S_i$. If we subtract these from the total number of distributions without restriction, we get our desired number. But, there is a problem- what if a distribution that gives child $i$ at least $7$ pieces also gives child $j$ at least $7$ pieces? Then we would count it once in $S_i$ and again in $S_j$, meaning that we subtract it twice from the total number of distributions, which would be wrong. That means you would have to add back the number of distributions that give two different children at least $6$ pieces, so that you don't double count your bad cases.