There are 10000 identical red balls, 10000 identical yellow balls and 10000 identical green balls. In how many different ways can we select 2005 balls so that the number of red balls is even or the number of yellow balls is odd?
in this question, being even or odd affects to what. As a result, the numbers of balls with different colors are same. I did not get it.
You are asking for generating functions.
First of all, the total number of balls available is irrelevant, as long as it is enough to fill all slots. For simplicity, take infinite number of balls.
Now you have to consider (red even) + (yellow odd) - (red even and yellow odd), as the last case was considered twice in the first two collections:
In summary, you are interested in: $$ [z^{2005}] \left( \frac{1}{(1 - z^2) (1 - z)^2} + \frac{z}{(1 - z^2) (1 - z)^2} - \frac{z}{(1 - z^2)^2 (1 - z)} \right) $$ You can get the result by expanding in partial fractions and handle the resulting terms: $$ - \frac{1}{16 (1 + z)} - \frac{1}{8 (1 + z)^2} - \frac{1}{16 (1 - z)} + \frac{4}{5 (1 - z)^3} $$ Geometric series or the generalized binomial theorem with negative integer exponent finishes this off: \begin{align} (1 + u)^{-m} &= \sum_{k \ge 0} \binom{-m}{k} u^k \\ &= \sum_{k \ge 0} (-1)^k \binom{k + m - 1}{m - 1} u^k \end{align}