we have 22 balls (5 red, 7 green and 10 blue).
i wrote this as an anwser to the question : what is the probability to get 3 colors when picking 8 balls at once ?
$$\frac{C_5^1 * C_7^1 * C_{10}^1*C_{19}^5}{C_{22}^8} $$
it appears that this is wrong. anyone help understand why? for me i can choose a ball from each color and then choose the rest.
I also tried :
$$1-\frac{C_{12}^8 + C_{15}^8 + C_{17}^8}{C_{22}^8}$$
thinking that we can take the event having one or two colors. Also this appears not to be true. Anyone can help?
There are many duplicates in your answer: if you switch the first three with three of the $C_{19}^5$ remaining balls (when there are three of them of different colors, but it's frequent), then you count the same sample twice. Therefore, you numerator is much larger than the denominator ($4\ 069\ 800/319\ 770$).
Actually, you have to decide how many of each color you will get, given that you must pick $8$ balls.
Let $i,j,k$ be respectively the number of red, green and blue balls.
Then, for each $i$ in $\{1,2,3,4,5,6\}$, you have to count the number of possibilities for green and blue balls. For each such $i$, there remains $8-i$ balls to choose among the $17$ of remaining colors. Then for each $j$ in $\{1,\dots,7-i\}$, you get $k=8-i-j$, and the number of possibilities for this choice of $(i,j,k)$ is simply
$${5 \choose i}{7 \choose j}{10 \choose k}$$
That is, the total number of possibilities is
$$n=\sum_{i=1}^6\sum_{j=1}^{7-i}{5 \choose i}{7 \choose j}{10 \choose 8-i-j}$$
Then, your probability is $\dfrac nN$ with $N={22\choose8}$.
Notice I didn't remove the case $i=6$ from the sum, though it's impossible to get $6$ out of $5$ red balls. This is not a problem, since ${5\choose6}=0$.
There are not that many possibilities for $(i,j,k)$, actually there are $21$ of them. With the help of a calculator, you will find $n=288\ 575$ and $N=319\ 770$. And the probability is approximately $0.902$.
Answer to the comment.
You numerator means: choose one ball of each color, and choose $5$ balls among the remaining. I give numbers to the balls to show what's wrong.
With this method, suppose
you first choose $\{R_1,G_1,B_1\}$, then $\{R_2,G_2,B_2,R_3,R_4\}$.
you first choose $\{R_2,G_2,B_2\}$ then $\{R_1,G_1,B_1,R_3,R_4\}$.
They correspond to two different choices with your method. However they represent exactly the same sample of $8$ balls (the order does not matter here).
Answer to the other comment: the balls are taken one at a time and replaced before taking the next.
There are $N=22^8$ possible tuples of balls.
To choose a tuple with at least one of each color, choose the number of each color: $(i,j,k)$ as above.
Then, for each $(i,j,k)$, choose the positions of the red ones and then the green ones, and finally the blue ones will be the remaining places. There are $8\choose i\;\;j\;\;k$ possibilities. This is a multinomial coefficient, defined to be ${8\choose i}{8-i \choose j}{8-i-j \choose k}$. Notice the last binomial coefficient is actually $1$ (it's because once you have chosen the positions of the red and green balls, there is nothing to choose for the blue balls).
For each choice of positions, choose now the balls. For the red ones, $5^i$ possibilities, and likewise $7^j$ and $10^k$ for the other colors.
All in all the numerator is now
$$n=\sum_{i=1}^6\sum_{j=1}^{7-i} {8\choose i}{8-i \choose j}5^i7^j10^{8-i-j}$$
Numerically, you will find $n=45\ 013\ 399\ 200$ and $N=54\ 875\ 873\ 536$, and the probability is approximately $0.820$.
It is interesting to see how joriki's answer would translate to the "replacement" situation. Using the same inclusion-exclusion principle, you would find
$$p=1-\frac{12^8+15^8+17^8-5^8-7^8-10^8}{22^8}$$