# Expectation of a Sum of Random Variables

An urn contains n+m balls of which n are red and m are black. They are withdrawn from the urn one at a time and without replacement. Let $X$ be the number of red balls removed before the first black ball is chosen. We are interested in determining the $E[X]$. To obtain this quantity, number the red balls from 1 to n. Define the random variables $X_i$ $(i=1,2...,n)$ by

$$X_i = \begin{cases} 1 \quad & : \text{if red ball labeled (i) is taken before any black ball is chosen}\\ 0 \quad & : \text{otherwise} \end{cases}$$

1. Express $X$ in terms of $X_i$s and find $E[X]$.

the probability Red Ball $i$ is drawn before any black is $\frac{1}{m+1}$.

The Bernoulli random variable $X_i$ takes on value $1$ with probability $\frac{1}{m+1}$, and therefore $E(X_i)=\frac{1}{m+1}$.

By the linearity of expectation we then have $E(X)=E(X_1)+\cdots+E(X_n)=\frac{n}{m+1}$.

1. Now let $Y$ denote the number of red balls chosen after the first but before the second black ball has been chosen. Compute the new $E[Y]$

The main problem here is computing the probability that the red ball is chosen after and before the black ball. I am thinking that event is equivalent to selecting a red ball given we chose a black ball first. Hence equal to $\frac{1}{m} \frac{1}{m}$ as we are selecting one red from $m$ left black balls.

For each red ball, the $m+1$ balls consisting of that red ball and the $m$ black balls are equally likely to be arranged in any of their $(m+1)!$ permutations. Thus, the red ball has equal probability $\frac1{m+1}$ to be in any of the possible $m+1$ positions among these $m+1$ balls. Thus, the probability for $2$) is the same as for $1$).
• But haven't we already pick a black ball? Thus we are left with $m-1$ black balls.
• @Note: I'm not sure which point of the process you're referring to. I wasn't referring to any point in the process where some balls have been drawn and others haven't. I was referring to the overall order of the one red and $m$ black balls. The red ball has the same probability to be in any of the $m+1$ positions in this order, so in particular it has the same probability to be in the second position (i.e. after the first black ball and before the second black ball) as it has to be in the first position (before the first black ball). Sep 3, 2018 at 23:30
• Thanks man. I truly appreciate you taking the time to break this down for me. I guess I was interpreting the problem as computing the probability of selecting a red ball conditional of selecting a black ball. $i.e \ P[choosing \ RB | BB \ is \ chosen]$.