An urn contains b blue balls ,r red balls and y yellow balls. Balls (red and yellow) are removed at random without replacement until the first blue ball is drawn. What is the expectation of the total number of balls drawn?
[Math] Expectation of number of trials before success in an urn problem without replacement
probability
Related Solutions
First of all, for clarity, I will use the following variables: $r$ for the number of red balls, $y$ for yellow, $g$ for green, and $b$ for blue. I will denote the total number of balls by $n$.
Out of the total number of permutations of 9 balls selected from the $n$ total, we only want to consider certain permutations. We want at least one of the first seven selections to be yellow, one of the remaining seven selections (one is taken by the yellow ball) to be green, three of the remaining seven selections to be red, and one of the 4 still remaining selections to be blue. The remaining four unspecified selections could be anything.
There are ${{y}\choose{1}}\cdot{{7}\choose{1}}$ ways of a yellow ball taking one of the first seven positions.
There are ${{g}\choose{1}}\cdot{{7}\choose{1}}$ ways of a green ball taking one of the first eight positions, after one has already been specified as yellow.
EDIT: There are ${{r}\choose{3}}\cdot{{b}\choose{1}}\cdot{{7}\choose{4}}\cdot{{4}\choose{1}}$ ways of three red balls and one blue taking four of the remaining seven positions. (And we choose one of the four positions to be taken by the blue ball.)
There are still three positions left, and we have already placed six balls, leaving us ${_{n-6}}P_3$ possible ways to fill the remaining positions.
Thus the total number of possible permutations that satisfy the requirements is ${{y}\choose{1}}\cdot{{7}\choose{1}}\cdot{{g}\choose{1}}\cdot{{7}\choose{1}}\cdot{{r}\choose{3}}\cdot{{b}\choose{1}}\cdot{{7}\choose{4}}\cdot{{4}\choose{1}}\cdot{_{n-6}}P_3$ out of a total of ${_n}P_9$ permutations.
$1.$ With replacement: There are three ways this can happen, red, red, red; blue, blue, blue; and green, green, green.
The probability of red, red, red is $\left(\dfrac{5}{19}\right)^3$. Find similar expressions for the other two colurs, and add up.
$2.$ Without Replacement: The probability of red, red, red is $\left(\dfrac{5}{19}\right)\left(\dfrac{4}{18}\right)\left(\dfrac{3}{17}\right)$. Find similar expressions for the other two colours, and add up.
Remark: We could also do the problem by a counting argument. Let's look at the first problem. Put labels on the balls to make them distinct. Then for with replacement, there are $19^3$ strings of length $3$ of our objects. (The three objects in the string are not necessarily distinct.) All of these $19^3$ strings are equally likely.
There are $5^3$ all red strings, $11^3$ all blue, and $8^3$ all green. This gives probability $\dfrac{5^3+6^3+8^3}{19^3}$.
One can do a similar calculation for the without replacement case.
For without replacement, there is a third approach. We can choose $3$ objects from $19$ in $\dbinom{19}{3}$ ways. And we can choose $3$ of the same colour in $\dbinom{5}{3}+\dbinom{6}{3}+\dbinom{8}{3}$ ways.
Best Answer
Number the red and yellow balls from $1$ to $n$, where $n=r+y$. Don't bother to number the blue balls.
Let $X_i=1$ if the $i$-th numbered ball is drawn before any blue ball, and let $X_i=0$ otherwise. Then the total number of draws is $1+(X_1+\cdots+X_n)$. It follows that the expected number of draws is $$1+E(X_1+\cdots+X_n).$$ By the linearity of expectation, this is $$1+E(X_1)+\cdots +E(X_n).$$ All the $X_i$ have the same expectation. so let us find $E(X_1)$.
The probability that ball with label $1$ comes before any blue ball is $\frac{1}{b+1}$. This is because all orderings of ball $1$ and the blue balls are equally likely. So $E(X_1)=\frac{1}{b+1}$.
It follows that the number of draws has mean $$1+\frac{n}{b+1}.$$
Remark: We used the powerful tool of indicator random variables. One can alternately find the probability distribution of the number of draws, and then find the mean by using the standard formula, and a manipulation of binomial coefficients. That is substantially more messy. It is useful to know that in many cases the expectation of a random variable $Y$ can be computed without explicit knowledge of the probability distribution function of $Y$.