Solving a word problem using a generating function Question: We want to divide 60 A students,20 B students and 20 C students in two tutorial groups of equal size(50), so that in each group we have at least 20 and at most 35 A students, at least 5 B students, and at least 5 C students.
How many different compositions are there to form a tutorial group? (Using a generating function)
How many different ways are there to divide the students among the tutorial groups?
My solution far:
The coefficient is $x^{50}$
$f(x) = (x^{25}+...+x^{35})(x^{5}+...+x^{15})^{2}$
$= x^{25}(1+...+x^{10})*x^{5}*x^{5}(1+...+x^{10})^{2}$
$=x^{35}(1+...+x^{10})(1+...+x^{10})^{2}$
 A: It is practical to "symmetrize" the constraints first. The $A$-students have to be partitioned in two groups with cardinality $\in[20,35]$, which actually means two groups with cardinality $\in[25,35]$. Similarly the $B$-students have to be partitioned in two groups with cardinality $\in[5,15]$ and the same holds for the $C$-students. The group to be sent to Tutor $1$ can be chosen in 
$$ \sum_{\substack{a\in[25,35]\\ b,c\in[5,15] \\ a+b+c=50}}\binom{60}{a}\binom{20}{b}\binom{20}{c} $$
ways, reasonably assuming that two different students with the same scores are distinguishable$^{(*)}$. By Vandermonde's identity
$$ \sum_{b+c=k}\binom{20}{b}\binom{20}{c}=\binom{40}{k}$$
hence the previous sum can be written as
$$ \sum_{a=25}^{35}\binom{60}{a}\left[\binom{40}{50-a}-\!\!\!\!\!\!\!\sum_{\substack{b+c=50-a\\ b<5\vee c<5\vee b>16\vee c>16}}\!\!\!\!\binom{20}{b}\binom{20}{c}\right] $$
etcetera. For sure it is better to approach the question through exponential generating functions, rather then ordinary generating functions, due to $(*)$.
