# A problem on balls of different colors randomly selected from a box.

I got this problem:

Given a 20 balls in a box such that 5 of them are green, 5 are yellow, 5 are red and 5 are blue, We randomly choose ball after ball until we choose the first ball that its color is different from the color of the first randomly chosen ball.

Let $X$ be a discrete random variable that denotes the number of balls chosen in the experiment (from its start to its end).

(1) Find $P\{X=4\}$ when each ball is chosen only once?

(2) Find $P\{X=4\}$ when we can chose each ball more than once?

I got stuck and I don't know how to proceed.
What I got is this:

The probability distribution of (1) seems to be something like the hyper-geometric distribution
And the probability distribution of (2) seems to be something like the geometric distribution

Thanks for any hint/help.

• Did you try setting recurrence relations?
– gar
Commented Dec 8, 2014 at 11:15
• No. But I tried to do something like this: $X=Y+1$ where $Y$ is another discrete random variable. Commented Dec 8, 2014 at 11:22

(1) Each ball is drawn without replacement.

Suppose we continue to draw until all balls are drawn. After the first ball is drawn, there are 19 remaining draws to extract the 4 balls of that same colour. Calculate the probability that no such are drawn before draw $X$, one on draw number $X$, and that the remaining $3$ are drawn in the last $20-X$ draws.

(2) Each ball is drawn with replacement.

Calculate the probability that draws numbered $2$ to $X-1$ are each of a different colour to, and draw numbered $X$ is of the same colour as, the first ball drawn.

Now if we got a green ball on the first selection we can define a geometric random variable $Y$ with parameter $p=\frac{15}{20}=\frac{3}{4}$ (since we have $15$ non-green balls)
And we get $\forall n\in\{1,2,3...\}, P\{Y=n\}=(1-p)^{n-1}p=(\frac{1}{4})^n\frac{3}{4}$.
Now since there are four ways to choose the first ball, we have to multiply that result by $4$.
And we get that $4\times P\{Y=3\}=4\times\frac{3}{64}=\frac{12}{64}$
And so $P\{X=4\}=4\times P\{Y=3\}=\frac{12}{64}$ which is the required probability.