Choosing beads without replacement - probability I am not good with these combination questions but was wondering if someone could help me figure out this question:
A bag contains:
5 blue beads
6 red beads
9 green beads
20 yellow beads
so 40 beads in total.
A person draws the beads in succession until they get 5 matching colored beads (order does not matter). For instance, if they draw 1 red, then 1 blue, 1 red, 1 red, 1 green, 1 red, 1 red then they have got 5 matching reds so the game finishes. They must continue to draw until 5 matching colours are made.
I am wondering how to calculate the probability that they draw 5 blue beads or 5 red beads. I assume I can calculate the probability of each separately then add up?
Now does anyone have any ideas how to calculate that probability for 5 blue?
I am not sure how to deal with the fact that it has to be 5 blue balls with none of the others being at 5.
 A: Let's say $p(i,j,k)$ is the probability that the 5th blue bead is drawn immediately after drawing $i$ red beads, $j$ green beads, and $k$ yellow beads where $0 \le i,j,k \le 4$.  After the previous draw, just before drawing the 5th blue bead, we must have drawn exactly $4$ blue beads; then, with $36-i-j-k$ beads remaining in the bag, we must draw the final blue bead.  So
$$p(i,j,k) = \frac{\binom{5}{4} \binom{6}{i} \binom{9}{j} \binom{20}{k}}{\binom{40}{4+i+j+k}} \cdot \frac{1}{36-i-j-k}$$
The probability that 5 blue beads are drawn before 5 of any other color is then
$$ \sum_{i=0}^4 \sum_{j=0}^4 \sum_{k=0}^4 p(i,j,k) = 0.00194347 $$
A similar computation for the case of drawing 5 red beads before 5 of any other color yields a probability of $ 0.00824479$. So the probability drawing 5 blue or 5 red beads before 5 of any other color is $0.00194347 + 0.00824479 = 0.0101883$.
A: Here's a recursive approach.  Let $p(b,r,g,y)$ be the probability of drawing 5 red or 5 blue before 5 green or 5 yellow when there are $b$ blue, $r$ red, $g$ green, and $y$ yellow beads in the bag.  Then conditioning on the next bead drawn yields
$$p(b,r,g,y) =
\begin{cases}
1 &\text{if $b \le 5-5$ or $r \le 6-5$} \\
0 &\text{if $g \le 9-5$ or $y \le 20-5$}\\
\frac{b\cdot p(b-1,r,g,y) + r\cdot p(b,r-1,g,y) + g\cdot p(b,r,g-1,y) + y\cdot p(b,r,g,y-1)}{b+r+g+y} &\text{otherwise}
\end{cases}
$$
The desired probability is $p(5,6,9,20)=0.01018825880621$.
