# Expected number of different colors of balls obtained before getting the first red ball

An urn contains red, green, and blue balls. Balls are chosen randomly with replacement (each time, the color is noted and then the ball is put back). Let $r,\ g,\ b$ be the probabilities of drawing a red, green, blue ball, respectively $(r + g + b = 1)$.

(a) Find the expected number of balls chosen before obtaining the first red ball, not including the red ball itself.
(b) Find the expected number of different colors of balls obtained before getting the first red ball.
(c) Find the probability that at least $2$ of $n$ balls drawn are red, given that at least $1$ is red.

I could solve (a) (Geom$(r)$) and (c) (Bin$(n,r)$), but not be able to know where to start in (b). I don't even know what the number of different colors refer to. Isn't it the same like (a)? I found this question but it's very general and abstract. May you help?

For (b)

• the probability of seeing blue before red is $\frac{b}{b+r}$
• the probability of seeing green before red is $\frac{g}{g+r}$

so the expected number of distinct colours seen before red is simply $\frac{b}{b+r}+\frac{g}{g+r}$

• Thanks for your answer :). Actually I'm still confused what distinct colors refer to. Like, every 1 green and 1 blue is considered 1 distinct color? – Abdu Magdy Apr 5 '18 at 14:09
• Or is it like if we obtain 5 green balls and 2 blue balls before the first red, then we have two distinct colors before the first red? – Abdu Magdy Apr 5 '18 at 14:12
• @AbduMagdy: the second of your two comments – Henry Apr 5 '18 at 14:36

If $D$ denotes the number of different colors of balls contained before getting the first red ball then $D$ takes values in $\{0,1,2\}$.

Then: $$\mathsf ED=\mathsf P(D=1)+2\mathsf P(D=2)=\mathsf P(D=1)+2(1-\mathsf P(D=0)-\mathsf P(D=1))=$$$$2-2\mathsf P(D=0)-\mathsf P(D=1)=2-2r-\mathsf P(D=1)$$

Can you find $\mathsf P(D=1)$ yourself?

• Thanks for your answer :). Is $P(D=1)=(1-r)$? – Abdu Magdy Apr 5 '18 at 14:06
• Why do you think so? It is $gr+ggr+gggr+\cdots+br+bbr+bbbr+\dots$. Do you see why? – drhab Apr 5 '18 at 17:23
• Yes I see. Because all of these are disjoint events and they all represent 1 distinct color before the 1st red ball, right? – Abdu Magdy Apr 6 '18 at 5:05
• That is correct. – drhab Apr 6 '18 at 6:38