We are given:
- An urn contains ( n + m ) balls, with ( n ) red and ( m ) black.
- Balls are drawn without replacement, one at a time.
- Let ( X ) be the number of red balls drawn before the first black ball is drawn.
Part (a): Express ( X ) in terms of the indicator variables ( X_i )
Let’s define indicator random variables as follows:
[
X_i =
\begin{cases}
1, & \text{if the } i\text{th ball drawn is red and occurs before the first black}\
0, & \text{otherwise}
\end{cases}
]
Since ( X ) counts the number of red balls drawn before the first black, it can be written as a sum of indicator variables—specifically, up to the position of the first black ball.
But the number of red balls before the first black is determined by the position of the first black ball.
Let’s define random variable ( B ): the position of the first black ball, i.e., the number of draws until a black appears.
Then ( X ) is simply the number of red balls drawn in the first ( B-1 ) positions.
So, define:
[
X_i =
\begin{cases}
1, & \text{if the } i\text{th ball is red} \
0, & \text{otherwise}
\end{cases}
]
Then we can write:
[
X = \sum_{i=1}^{B-1} X_i
]
So ( X ) is the count of red balls among the first ( B-1 ) draws.
Alternatively, we can write ( X ) as:
[
X = \text{Position of the first black} - 1 = B - 1
]
Thus, if ( B ) is the position of the first black ball (within the uniformly random permutation of all balls), then:
[
X = B - 1
]
Part (b): Compute ( \mathbb{E}[X] )
We'll compute ( \mathbb{E}[X] ), the expected number of red balls before the first black one is drawn.
As in part (a), since the drawing is without replacement, all ( \binom{n+m}{n} ) permutations of red and black balls are equally likely.
Let’s define ( X = # ) of red balls before the first black is drawn.
Consider that in any random permutation of the ( n + m ) balls, the probability that the first black ball appears in position ( k+1 ) is equal to the probability that the first ( k ) balls are all red, and the ( (k+1) )st is black.
So, to compute ( \mathbb{E}[X] ), consider this approach:
Let’s define the probability that the first black ball appears in position ( i ). Then ( X = i - 1 ), and:
[
\mathbb{E}[X] = \sum_{i=1}^{n+m} (i - 1) \cdot \mathbb{P}(\text{first black appears at position } i)
]
So we need the probability that the first black ball is in position ( i ). This implies that: