<s>[INST] Generating Functions for collection of balls 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.
 [/INST] 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.


*

*Red balls even: $1 + z^2 + \ldots = \frac{1}{1 - z^2}$

*Yellow balls odd: $z + z^3 + \ldots = \frac{z}{1 - z^2}$

*Any number of green balls: $1 + z + z^2 + \ldots = \frac{1}{1 - z}$


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:


*

*Red balls  even, others arbitrary: 
$\frac{1}{1 - z^2} \cdot \frac{1}{(1 - z)^2}$

*Yellow balls odd, others arbitrary:
$\frac{z}{1 - z^2} \cdot \frac{1}{(1 - z)^2}$

*Red even, yellow odd:
$\frac{z}{(1 - z^2)^2} \cdot \frac{1}{1 - z}$


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}
</s>