let say I have $90 balls$
- $S_{1} = $ green balls
- $S_{2} = $ orange balls
- $S_{3} = $ red balls
I have the following limitations:
- No limit
- Choose at most 60 balls from each color
- choose even number of red balls
- the number of the selected balls ( from each color ) are divide by 3.
what I did so far is:
for the $1.$ I look on it as $S_{1}+S_{2}+S_{3} = 90$ so we can calculate it as D$(3,90)$ its like to choose $3$ from $90$ so it will give as $\binom{92}{2}$
for the $2.$ I mose restrict ($S_{1},S_{2},S{3}$) to be $0\leq S_{i} \leq 60 $ so how it will be with generating functions ( I think I dont have another way to do that)? $\rightarrow$ $(1+S+S^2+\dots +S^n)^3$ and then it will be $\frac{1}{(1-x)^{3}}$?(fix me if I am wrong ).
for the $3.$ for $S_{1}$ and $S_{2}$ I have not limitations they can be $0\leq$ but for the red it have to be $\{0,2,4,6,\dots\}$? how I can convert it for generating functions?
for the last one I would like to get some hints.
Thanks!
The general idea is that if the number of (say) purple balls has to come from the set $A$, then the generating function involves $$\sum_{n{\rm\ in\ }A}x^n$$ So for example for your last question the set $A$ is the set $\{\,0,3,6,9,\dots\,\}$ of multiples of 3, and the generating function will involve $x^0+x^3+x^6+\dots$. Since you have three colors, each with the same restriction, your overall generating function will be the 3rd power of this series, that is, $$(1+x^3+x^6+x^9+\cdots)^3$$ Now to make use of this generating function, you have to see that there's a geometric series there, so you can rewrite it as $$(1-x^3)^{-3}$$ and then you get to apply the binomial theorem to expand that out in a power series in $x$. Why not give it a go, and report back when you have worked out all the details?