Can we solve this using stars and bars? The number of ways of distributing 12 identical oranges among 4 children so that every child gets at least one and no child more than 4 is 31.
My try: First of all give each child 1 orange and we are left with 8 oranges.
Then 
3 3 2 0
3 3 1 1
3 2 2 1
2 2 2 2
and permuting each, we get total 31. But can we solve this using stars and bars?
 A: As SandeepThilakan said in the comments above, the coefficient of $x^{12}$ in the expansion of the polynomial $(x^1+x^2+x^3+x^4)^4$ counts the way that between 1 to 4 objects distributed to 4 groups gives a total of 12 objects.
Using the binomial expansion theorem:
$$(x+x^2+x^3+x^4)^4 \\ = ((x+x^2)+x^2(x+x^2))^4 \\ = x^4(1+x)^4(1+x^2)^4 \\ = x^4 \left(\sum\limits_{i=0}^4 {4\choose i}x^i \right)\left(\sum\limits_{j=0}^4 {4\choose j}x^{2j} \right) \\= x^4 \sum\limits_{i=0}^4 \sum\limits_{j=0}^4 {4 \choose i}{4 \choose j} x^{i+2j}$$
So the coefficients of $x^{12}$ must be $${4 \choose 0}{4 \choose 4}+{4 \choose 2}{4 \choose 3}+{4 \choose 4}{4 \choose 2} = 31$$
A: A simple solution by generating functions, ellipses cover terms that don't influence the result:
\begin{align}
[z^{12}] (z + z^2 + z^3 + z^4)^4
  &= [z^{12}] \left( \frac{z (1 - z^4)}{1 - z} \right)^4 \\
  &= [z^8] (1 - z^4)^4 (1 - z)^{-4} \\
  &= [z^8] (1 - 4 z^4 + 6 z^8 - \cdots)
              \sum_{n \ge 0} \binom{-4}{n} (-1)^n z^n \\
  &= [z^8] (1 - 4 z^4 + 6 z^8 - \cdots) 
              \sum_{n \ge 0} \binom{n + 4 - 1}{4 - 1} z^n \\
  &= \binom{11}{3} - 4 \binom{7}{3} + 6 \binom{3}{3} \\
  &= 31
\end{align}
A: Since you specifically refer to stars and bars, yes, it can be applied by first preassigning 1 orange to each child, and then applying inclusion-exclusion to exclude cases where one or more child gets 4 or more oranges.
With only the pre-assignment, the answer would be ${8+4-1 \choose 4-1}$ = ${11\choose 3}$
Applying inclusion to take care of the restrictions,
${11\choose 3} - {4\choose1}*{7\choose 3} + {4\choose2}*{3\choose3}$ = 31 
