So I was given this question.
Given $3$ types of coins, how many ways can one select $20$ coins so that no coin is selected more than $8$ times.
First I make $x_1 + x_2 + x_3 = 20$ Then $ 0 \leq x_i \leq 8$
Then we use the Inclusion exclusion principle
Let $A_i$ be the non-negative integer solutions to $x_1 + x_2 + x_3 = 20$ $x_i \geq 9$. Then use inclusion exclusion formula to find $N(A_1 \bigcap A_2 \bigcap A_3)$
What i don't get is how to apply the inclusion exclusion formula. I know the process to get to it but not how to apply it.
Instead of trying to apply formulas take a look at the general theory. Suppose $a_j\le x_j\le b_j$ for $j=1,2,3$.
$$(x^{a_1}+x^{a_1+1}+\cdots+x^{b_1})(x^{a_2}+x^{a_2+1}+\cdots+x^{b_2})(x^{a_3}+x^{a_3+1}+\cdots+x^{b_3})$$
Every solution of $x_1+x_2+x_3=n$ with the constraints $a_j\le x_j\le b_j$ contributes $1$ to the coefficient of $x^n$ in the above expression. So the number of solutions is the coefficient of $x^n$.
Substituting accordingly we see we require the coefficient of $x^{20}$ in $$ (1+x+\cdots+x^8)^3={(1-x^9)^3\over (1-x)^3} $$ or equivalently in $$ (1-3x^9+3x^{18})\sum_{k=0}^{20}\binom{2+k}{k}x^k $$ which equals $$ \binom{22}{20}-3\binom{13}{11}+3\binom{4}{2} $$