The number of ways in which 12 identical balls can be grouped in four marked non-empty sets $P, Q, R, S$ such that $n(P) < n(Q)$ is?
The answer to the above problem is the number of positive integral solutions of the expression $$P + Q + R + S = 12$$ when $P<Q$. I know that with no conditions imposed, the number of solutions is $^{12-1}C_{4-1} = ^{11}C_3$. How would one account for the condition when $P<Q$? Please explain the concept in detail in addition to providing a solution to the problem (which is given just as an example).
Let $a,b,c,d\ge0$. Then set $|P|=a+1$, $|Q|=a+b+2$, $|R|=c+1$, $|S|=d+1$ where $2a+b+c+d+5=12$. We want to count the non-negative solutions to $$ 2a+b+c+d=7\tag1 $$ Considering the coefficients of $x^n$ in $$ \overbrace{\left(1+x^2+x^4+x^6+\dots\right)\vphantom{{x^2}^3}}^a\overbrace{\left(1+x+x^2+x^3+\dots\right)^3}^{b,c,d}\tag2 $$ $(1)$ gives a generating function of $$ \begin{align} &\frac1{1-x^2}\left(\frac1{1-x}\right)^3\\ &=\frac1{1+x}\left(\frac1{1-x}\right)^4\\ &=\frac12\left(\frac1{1-x}+\frac1{1+x}\right)\left(\frac1{1-x}\right)^3\\ &=\frac12\left(\frac1{1-x}\right)^4+\frac14\left(\frac1{1-x}+\frac1{1+x}\right)\left(\frac1{1-x}\right)^2\\ &=\frac12\left(\frac1{1-x}\right)^4+\frac14\left(\frac1{1-x}\right)^3+\frac18\left(\frac1{1-x}+\frac1{1+x}\right)\frac1{1-x}\\ &=\frac12\left(\frac1{1-x}\right)^4+\frac14\left(\frac1{1-x}\right)^3+\frac18\left(\frac1{1-x}\right)^2+\frac1{16}\left(\frac1{1-x}+\frac1{1+x}\right)\tag3 \end{align} $$ Therefore, $$ \begin{align} &\left[x^n\right]\frac1{1-x^2}\left(\frac1{1-x}\right)^3\\[3pt] &=\textstyle\frac12(-1)^n\binom{-4}{n}+\frac14(-1)^n\binom{-3}{n}+\frac18(-1)^n\binom{-2}{n}+\frac1{16}(-1)^n\binom{-1}{n}+\frac1{16}\binom{-1}{n}\\[3pt] &=\frac12\binom{n+3}{n}+\frac14\binom{n+2}{n}+\frac18\binom{n+1}{n}+\frac1{16}+\frac1{16}(-1)^n\\ &=\frac{4(n+3)(n+2)(n+1)+6(n+2)(n+1)+6(n+1)+3+3(-1)^n}{48}\\ &=\frac{(4n+14)(n+3)(n+1)+3\left(1+(-1)^n\right)}{48}\tag4 \end{align} $$ For $n=7$, we get $$ \frac{42\cdot10\cdot8}{48}=70\tag5 $$