# Probability of an event indicator, black and white balls

I hope this is the right place to ask a probability related question. In any case, this is the question i'm stumped with: There are $n$ white balls and $m$ black balls in a box. Someone randomly takes out a ball one after the other without returning. Let $X_1$ be the number of white balls which were taken out before the first black ball was taken out. I need to find $E[X_1]$.

I figured out its a sum of $m$ indicator random variables, and then with the linear property of the expected value its possible to get the answer. Thing is, I cannot figure out the probability of every indicator. Every indicator counts whether a white ball has been taken out given that no black ball was taken out, but shouldn't another condition be the number of white balls which were taken out? For example if $X_1 = \sum Y_i$ then shouldn't $P( Y_{20} = 1 ) > P( Y_{40} = 1 )$ because there are less white balls to pick from?

I have been told that this can definitely be solved with indicators, but I just don't see how, any help will be greatly appreciated.

Personally, I would consider the sum of indicators $X_1 = \sum_{k=1}^\infty \mathbf{1}_{X_1 \geq k}$ since the probability $P(X_1 \geq k)$ is easily computed for each $k \geq 1$.

Indeed $P(X_1 \geq k)$ is the probability that the first $k$ balls are white, which is?

• I'm sorry, I don't understand why the sum you wrote goes to inifinity, the number of balls is finite. The probability you speak of looks like its hypergeometric, sampling $k$ balls from a total of $m+n$ balls where there are $m$ special ones( white ). But I don't understand how will that help me. – Xsy Jun 14 '14 at 15:10
• @Xsy: The indicators are all zero for $k > n$ so the sum is actually finite. What is the probability that the first ball is white? what is the probability that the second ball is white given that the first is white? etc. – Siméon Jun 14 '14 at 16:01
• Took me a while but I got it, thank's a lot! – Xsy Jun 14 '14 at 17:34

@Xsy

There is a distribution that is designed for these type problems it is called the Negative Hypergeometric distribution. So solving the problem just means knowing a formula and plugging in.

$$E(X_1)=(number of black you want)\frac{total-numberofblack}{numberofblack+1}+(number of black you want)$$

$$E(X_1)=1 \cdot \frac{n+m-m}{m+1}+1$$

$$E(X_1)=\frac{n+m+1}{m+1}$$

Let $f_a$ be the expected no. of white balls taken out before a black ball when there are $a$ white balls and $b$ black balls, which can be written as:
Solving the recurrence for $a=n$ and $b=m$ gives \begin{align*} \mathbb{E}\left[X_1\right] &= \frac{m+n+1}{m+1} \end{align*}