So this is how it goes. In a pack of cards there're 3 red cards and 2 yellow cards. In each step we take out cards one by one (without returning) until we firstly get one of each color. Find out the Expected value and the Variance.
This is what I did, but I get some unclear results:
- Let's mark X as the number of cards taken out, then $X\in \{2,3,4\}$
- $P(X=2)=\frac{\binom{3}{1}\binom{2}{1}}{\frac{5!}{3!2!}}$
- $P(X=4)=\frac{\binom{2}{1}}{\frac{5!}{3!2!}}$
So $P(X=3)=1-P(X=2)-P(X=4)=\frac{2}{10}$, but when I calculate $P(X=3)$ I get another result! what am I doing wrong? thank you
Your value for $Pr(X=4)$ is incorrect.
To make calculations easier, we may temporarily assume that each card has a number on it which makes it distinguishable from the others. I.e., we have a "red1", a "red2", etc...
What it appears that you did was to count the number of ways in which you can pull four cards where order doesn't matter so that you get all three of the red cards and one of the yellow cards. There are indeed $\binom{2}{1}=2$ ways this can occur.
You then proceeded to divide by $\binom{5}{3}=\frac{5!}{3!2!}=\binom{5}{2}$ which is the number of ways in which you could have pulled three (or two) cards out of the deck where order doesn't matter.
Your value is incorrect for two reasons. First, we are pulling four cards, not three or two, so dividing by $\binom{5}{3}$ is not going to help us. Fixing that, $\frac{\binom{2}{1}}{\binom{5}{4}} = \frac{2}{5}$ is indeed the probability that if you draw four cards that you get three red and one yellow where order doesn't matter.
However: that would have included situations like red,red,yellow,red or yellow,red,red,red, or other arrangements of the colors. We would have stopped as soon as we had both colors and not continued pulling cards. We see that the only scenario above that counts is if it was in the order red,red,red,yellow. Of the four arrangements, only one is valid. Dividing by four fixes this: $\frac{2}{5} \cdot \frac{1}{4} = \frac{1}{10}$.
As mentioned in the comments above, an easier way to see this is by noting the only way to get $X=4$ is to have pulled the three red cards in the first three draws, which occurs with probability $\frac{3}{5}\cdot \frac{2}{4}\cdot \frac{1}{3} = \frac{1}{10}$