A bag with 3 black balls and 33 white balls, find expected number of pulls

combinatoricsexpected valueprobability

So I stumbled upon this question:
I got a bag with 36 balls: 3 black and 33 white. I need to calculate the expected amount of pulls without putting the pulled ball back into the bag before I get:

(a) 1 black ball

(b) all 3 black balls

So, for (a): I used straight definition of expected value, which says, that the result is equal to:
$1*\frac{3}{36} + 2 * \frac{33}{36}*\frac{3}{35} + 3 * \frac{33}{36}*\frac{32}{35}*\frac{3}{34} + …$

But I couldn't come up with a closed form for this so I've left it at that, for now, trying to find a better way.

For (b) I tried the same approach but for probabilities I tried to use combinatorics. For example, the total amount of ways to take 3 balls out of 36 is (36 choose 3) = 7140.

Now then, there is only 1 setup for a success with 3 attempts aka 1st ball, 2nd ball and 3rd ball

For 4 attempts, last attempt is locked for the 3rd ball and then I got 3 choose 2 ways = 3 ways to distribute 2 remaining balls between first 3 attempts

For 5 attempts, same logic, but now I got 4 choose 2 ways = 6 ways to distribute 2 remaining balls between first 4 attempts.

And so on and on

Then I calculate the probability by dividing the number of ways by 7140 and then calculate the expectation. I got 27.75 there, with Excel.

But here is the problem. I decided to randomly simulate this process using Python with 10000000 runs and my answers simply don't match the simulation outcome, which is 8 for 1 ball and 24 for 3 balls. I can only imagine that my math is wrong, so … I seek help.

Best Answer

Let the number of white balls before the first black ball, between the first and second black balls, between the second and third black ball, and after the last black ball be denoted by $x_{1},x_{2},x_{3},x_{4}$ respectively.

$$ x_{1}+x_{2}+x_{3}+x_{4}=33 $$

Because of symmetry, we get the following identity for expectation of $x_{i}$:

$$ \begin{align} E(x_{1})=E(x_{2})=E(x_{3})=E(x_{4})&=\frac{1}{4}E(x_{1}+x_{2}+x_{3}+x_{4})\\ \\ &=\frac{33}{4} \end{align} $$

  1. The expected number of draw for the first black ball is $E(x_{1})+1=\frac{37}{4}$
  2. The expected number of draws for the last black ball is $E(x_{1})+E(x_{2})+E(x_{3})+3=\frac{111}{4}$
Related Question