Drawing balls without replacement until three of a color are drawn

720 Views Asked by At

This problem came up in a game I was playing. It's surely a standard combinatorics problem, but I'm having trouble searching for an exact match.

Suppose an urn contains $B$ blue balls, $R$ red balls, and $G$ green balls. Balls are drawn without replacement until you've drawn three balls of any one color (not necessarily consecutively). What's the probability of ending with three blue balls?

My reasoning is as follows: the number of ways to stop after drawing three blue balls is equal to the number of ways of drawing exactly two blue and at most two red and green balls (in any order), times the number of blue balls ending the sequence. This suggests that the number of ways of ending with blue is

$$E_B = \sum_{i=0}^2 \sum_{j=0}^2 (B-2)(2+i+j)!\binom{B}{2}\binom{R}{i}\binom{G}{j}$$

where the binomial terms select which balls are drawn and the factorial enumerates all permutations, for the sequence of balls excluding the last ball. The probability of ending with three blue balls is then $$\frac{E_B}{E_B+E_R+E_G}$$ for $E_R$ and $E_G$ computed analogously.

Is this approach correct?

EDIT: Proposed recursive solutions to the problem (e.g. Blatter's answer below) are practical if one just cares about computing a number, but I'm particularly interested in an answer to this question that 1) explains why the above formula is incorrect, and 2) salvages the formula.

3

There are 3 best solutions below

1
On

The following is a full solution of the problem, but the final formula gives no insight.

Note that the game ends after at most $7$ moves. It is played on the vertices and grid lines of the lattice cube $[0..2]^3$, hence has $27$ nonterminal states.

Denote by $p(x,y,z)$ the probability that the game ends with three drawn blue balls, given that we already have drawn $x$ blue, $y$ red, and $z$ green balls. This function satisfies $$p(3,y,z)=1,\quad p(x,3,z)=0,\quad p(x,y,3)=0\qquad \bigl(x,\>y,\>z\in[0..2]\bigr)$$ and the backwards recursion $$p(x,y,z)={b-x\over n-j}\>p(x+1,y,z)+{r-y\over n-j}\>p(x,y+1,z)+{g-z\over n-j}\>p(x,y,z+1)\ ,$$ whereby $n:=b+r+g$ and $j:=x+y+z$.

The quantity $t:=p(0,0,0)$ then is the probability you are looking for. Here is a Mathematica implementation of this approach, together with a numerical example:

enter image description here

2
On

There aren't all that many possibilities.

If $(r,g,b)$ is the ending state with $r$ red balls, $g$ green balls, and $b$ blue balls, then the possibilities for $(r,g,b)$ ending with three blue balls are (0,0,3), (0,1,3), (1,0,3), (0,2,3), (2,0,3), (1,1,3), (1,2,3), (2,1,3), and (2,2,3). The probability of each case can be computed from a hypergeometric distribution. Work out all nine cases and add up the probabilities.

1
On

As was mentioned in the comments, you cannot just count the number of sequences ending in three blues and divide by the total number. Not all sequences are equally likely (the longer the sequence, the less likely it is).

To fix your method, you need to add up probabilities instead of numbers. For each $0\le i\le 2$ and $0\le j\le 2$, you need to compute the probability of getting your third blue ball after getting $i$ red and $j$ green balls, then sum. The result is $$ \sum_{i=0}^2\sum_{j=0}^2\frac{\binom{B}2\binom{R}i\binom{G}j}{\binom{B+R+G}{2+i+j}}\cdot \frac{B-2}{(R-i)+(G-j)+(B-2)} $$ The first factor is the probability that the first $i+j+2$ balls consist of $i$ reds, $j$ greens and $2$ blues. The next factor is the probability that the subsequent ball is blue.