A basket has $10$ green, $10$ blue, and $10$ red balls. In how many ways can $10$ balls be selected from the basket if the number of red balls is odd? I tried to learn generating functions, but I am a way out of it.
And I know a way to solve problems like that by $S_0 - S_1 + S_2 +\cdots$
Please show me in this way because I don't know GF.
The question is:

A basket has $10$ green balls, $10$ blues and $10$ reds. In how many ways can $10$ balls be selected from the basket so that the number of red balls is odd?

Here is a picture of what I tried to do and obviously I'm getting negative number of solutions. 

 A: Let $b$, $g$, and $r$ represent, respectively, the number of blue, green, and red balls that are selected from the basket.  We know that 
$$b + g + r = 10$$
However, we require that $r$ is odd, so there are five cases.
$r = 1$:  Then 
\begin{align*}
b + g + 1 & = 10\\
b + g & = 9
\end{align*}
which is an equation in the nonnegative integers.  The number of solutions of the equation $b + g = 9$ in the nonnegative integers is 
$$\binom{9 + 2 - 1}{2 - 1} = \binom{10}{1} = 10$$
More generally, the number of solutions of the equation
$$b + g = n$$
in the nonnegative integers is 
$$\binom{n + 2 - 1}{2 - 1} = \binom{n + 1}{1} = n + 1$$
$r = 3$:  Then
\begin{align*}
b + g + 3 & = 10\\
b + g & = 7
\end{align*}
which is an equation in the nonnegative integers with $7 + 1 = 8$ solutions.
$r = 5$:  Then
\begin{align*}
b + g + 5 & = 10\\
b + g & = 5
\end{align*}
which is an equation in the nonnegative integers with $5 + 1 = 6$ solutions.
$r = 7$:  Then
\begin{align*}
b + g + 7 & = 10\\
b + g & = 3
\end{align*}
which is an equation in the nonnegative integers with $3 + 1 = 4$ solutions.
$r = 9$:  Then
\begin{align*}
b + g + 9 & = 10\\
b + g & = 1
\end{align*}
which is an equation in the nonnegative integers with $1 + 1 = 2$ solutions.
Total:  Since the above cases are mutually exclusive and exhaustive, the number of ways of selecting $10$ balls from the basket if the number of red balls is odd is 
$$10 + 8 + 6 + 4 + 2 = 30$$
Notice that fixing the value of $r$ reduces the number of variables by $1$, which is where you made your mistake in calculating $S_1$.  Also, the problem asks you calculate what you are calling $S_1$.  There is no need to apply the Inclusion-Exclusion Principle here.
A: Here there is no need to apply the Inclusion-Exclusion Principle (your $S_0 - S_1 + S_2 +\cdots$)
We simply count the number of non-negative integer solutions $(x_1,x_2)$ (with no further constraints) of
$$x_1+x_2=10-x_3=10-(2k-1)\qquad \text{ with $k=1,2,3,4,5$.}$$
They are 
$$\binom{10-(2k-1)+1}{1}=10-(2k-1)+1=10-2k+2=12-2k.$$ 
Hence we have to evaluate
$$\sum_{k=1}^5(12-2k)=10+8+6+4+2=\boxed{30}.$$
A: According to me there is another quite simple way to solve problem is, to consider two basket , one containing 10 red balls and other containing remaining 20 balls. Now we have to select x(odd number between 0 to 10) red balls from first basket and 10-x from second basket, so number of remaining red balls is always odd. 
By using combination formula we get answer: 
$$\binom{10}{1}\binom{20}{9}+\binom{10}{3}\binom{20}{7}+\binom{10}{5}\binom{20}{5}+\binom{10}{7}\binom{20}{3}+\binom{10}{9}\binom{20}{1}.$$
(https://i.stack.imgur.com/vF0ZA.jpg)
