<s>[INST] Dividing balls into boxes with capacity limits Problem:
In how many ways can you divide $13$ identical balls into $3$ different boxes
$k_1$, $k_2$, $k_3$, such that $k_1$ contains no more than $5$ balls, $k_2$ contains no more than $6$ balls and $k_3$ contains no more than $4$ balls?
My idea: 
So my idea is to use the following theorem:
"There are $C(n+r-1,r)$ r-combinations from a set with $n$ elements when repetition of elements is allowed." But I'm not sure.
Any great hints would be appreciated.
 [/INST] To show the working behind the generating function approach:
A binomial expansion of $(1-x)^{-n}$ gives $$(1-x)^{-n} = 1 + (-n)(-x) + \frac{(-n)(-n-1)}{2!} (-n)^2 + \frac{(-n)(-n-1)(-n-2)}{3!} (-n)^3 + \cdots \\
= \sum_{i\ge 0}\frac{(-1)^i (-n)^\underline{i}}{i!}x^i \\
= \sum_{i\ge 0}\frac{n^\overline{\,i\,}}{i!}x^i \\
= \sum_{i \ge 0}\binom{n+i-1}{i}x^i \\
= \sum_{i \ge 0}\binom{n+i-1}{n-1}x^i$$
Then $$[x^k] \frac{\sum_{j\ge 0} a_j x^j}{(1-x)^n} = \sum_{j\ge 0} [x^k] \frac{a_j x^j}{(1-x)^n} = \sum_{j\ge 0} a_j [x^{k-j}] (1-x)^{-n} = \sum_{j\ge 0} a_j \binom{n+k-j-1}{n-1}$$

Now we can apply that to your problem as outlined in Manthanein's first answer: by considering the three boxes we're looking for the coefficient of $x^{13}$ in $$\frac {(1-x^6)(1-x^7)(1-x^5)}{(1-x)^3} = \frac{1-x^5-x^6-x^7+x^{11}+x^{12}+x^{13}-x^{18}}{(1-x)^3}$$
So applying the lemma with $n=3$, $k=13$ we get $$\binom{15-0}{2}-\binom{15-5}{2}-\binom{15-6}{2}-\cdots-\binom{15-18}{2}$$
The last term is zero, and the rest give $$\frac{15\times14 - 10\times9 -9\times8 - 8\times7 + 4\times3 + 3\times2 + 2\times1}{2}\\
= \frac{210-90-72-56+12+6+2}{2} = 6$$
</s>