# Prove that the expectation of the number of black balls preceding the first white ball is $\frac {b}{w+1}$

Balls are taken one by one out of an urn containing $$w$$ white and $$b$$ black balls until the first white ball is drawn. Prove that the expectation of the number of black balls preceding the first white ball is $$\frac {b}{w+1}$$

Attempt: Let $$X_i$$ be the random variable that denotes the number of black balls that are drawn at the $$i_{th}$$ step before a white ball is drawn.

Then, the total number of such balls $$X= X_1 + \cdots+X_n \implies E(X)=\sum E(X_i).$$

$$E(X_i)= 1 \cdot \dfrac {^bC_i}{^{b+w}Cr}\cdot \dfrac {^wC_1}{^{b+w-r}C_1}$$

Thus, $$\sum E(X_i) = \sum_{i=1}^{b} ~ 1 \cdot \dfrac {^bC_i}{^{b+w}Ci}\cdot \dfrac {^wC_1}{^{b+w-i}C_1}$$

Could someone please tell me if I attempted this correctly? Because I get a very complicated answer in the end after evaluating the above.

Thanks a lot!

• Please do not cross-post across sites. Oct 22, 2019 at 17:23
• @StubbornAtom I will take care. Have been stuck for long on this problem. Could you give me a direction please? Oct 22, 2019 at 17:24
• You're working too hard. By considering how things change when a black ball is withdrawn, it suffices to check that the formula is correct when $b=0$ and to verify that otherwise $$e_w(b) = \frac{b}{b+w}\left(1+e_w(b-1)\right)$$ where $e_w(b) = b/(w+1).$
– whuber
Oct 22, 2019 at 17:37
• @whuber I am a bit confused because of one conceptual problem. Does, the probability of finding a black ball at the $ith$ step remain the same as at every step? Shouldn't it change because at the $i-1~th$ step, a black ball could have been recovered? Thanks Oct 22, 2019 at 18:04
• That's right, which is why "$e_w(b-1)$" appears in the recursion.
– whuber
Oct 22, 2019 at 19:38

Mathematical induction. It is easy to do @whuber's proof by mathematical induction to show that with $$w$$ white balls and $$b$$ black ones in the urn, the number $$X$$ of black balls drawn before the first white one has $$E(X) = \frac{b}{w+1}.$$ [Start the induction step with $$1 + e_w(b-1) = \frac{w+1}{w+1} + \frac{b-1}{w+1}.]$$

Simple case with seven balls in the urn. Also, in the specific case where $$w=2$$ and $$b = 5,$$ simple combinatorial arguments show that $$P(X = k) = \frac{6-k}{21},$$ for $$k = 0, 1, \dots, 5.$$ [For example, $$P(X = 1) = \frac{2 \cdot 5}{7\cdot 6} = \frac{5}{21}.$$]

Then you can use a calculator to find $$E(X) = \sum_{k=0}^5 k\frac{6-k}{21} = \frac{b}{w+1} = \frac{5}{3} = 1.6667.$$

k = 0:5; sum(k*(6-k)/21)
[1] 1.666667


Simulation of specific case. A simulation in R of a million such experiments (drawing without replacement and counting the draws before getting a white ball) approximates the distribution of $$X.$$ [The R function match finds the draw with the first white ball (1). The sample function draws all the balls in sequence without replacement.]

set.seed(1022)
b = 5;  w = 2
balls = c(rep(0,b),rep(1,w))  # 0 for black, 1 for white
x = replicate(10^6, match(1,sample(balls))-1)
mean(x)
[1] 1.66686
b/(w+1)
[1] 1.666667
table(x)/10^6
x
0        1        2        3        4        5
0.286038 0.238137 0.189911 0.142529 0.095611 0.047774


These simulated probabilities are accurate to a couple of decimal places as shown in the histogram below. Histogram bars show simulated probabilities and dots show exact ones.

Note; If balls were drawn with replacement, then $$X$$ would have a geometric distribution.