Expected Value of a Hypergeometric Random Variable

The linearity of expectation is the simple way to approach this problem. It is a very powerful technique that enables us to find the expectation of many random variables $X$ even when it is extremely difficult to find the distribution of $X$.

But if you really want to avoid using the linearity of expectation, it can be done in this case. The calculation will take a while: its length can be considered a proof of the fact we should use the linearity of expectation! By the general formula for expectation in the discrete case, when the distribution of $X$ is known, the expectation of the number of red balls $X$ is $$\sum_{k=0}^r kP(X=k).$$
The probability that $X=k$ is, as you know, $$\frac{\binom{r}{k}\binom{w}{n-k}}{\binom{r+w}{n}},$$ and therefore $$E(X)=\sum_{k=1}^r k \frac{\binom{r}{k}\binom{w}{n-k}}{\binom{r+w}{n}}. \tag {$\ast$} $$ We are summing from $k=1$ on because the $k=0$ term makes no contribution to the expectation, and could cause some headaches later.

We use the following result:

Lemma: The binomial coefficient $\binom{q}{p}$ is equal to $\frac{q}{p}\binom{q-1}{p-1}$.

The lemma is easy to prove, either combinatorially or by manipulation. For a manipulational proof, note that $\tfrac{q}{p}\tbinom{q-1}{p-1}=\tfrac{q}{p}\tfrac{(q-1)!}{(p-1)!(q-p)!}=\tfrac{q!}{p!(q-p)!}=\tbinom{q}{p}. \hspace{1cm}\Box$

Using the lemma, we can see that $$\binom{r+w}{n}=\frac{r+w}{n}\binom{r+w-1}{n-1}.\tag {$\ast\ast$}$$ We also need some information about $k\binom{r}{k}$. By the lemma, or otherwise, $$k\binom{r}{k}=r\binom{r-1}{k-1}.\tag {$\ast\ast\ast$}$$ Substituting the values obtained in $(\ast\ast)$ and $(\ast\ast\ast)$ for the terms in the formula $(\ast)$ for the expectation of $X$, we obtain $$E(X)=\frac{rn}{r+w}\sum_{k=1}^r \frac{\binom{r-1}{k-1}\binom{w}{n-k}}{\binom{r+w-1}{n-1}}.$$ Make the change of variable $j=k-1$. Then the above formula for $E(X)$ becomes$$E(X)=\frac{rn}{r+w}\sum_{j=0}^{r-1} \frac{\binom{r-1}{j}\binom{w}{n-j-1}}{\binom{r+w-1}{n-1}}.$$

Note that $\frac{\binom{r-1}{j}\binom{w}{n-j-1}}{\binom{r+w-1}{n-1}}$ is the probability that when you draw $n-1$ balls from an urn that contains $r-1$ red and $w$ white, you will get exactly $j$ red balls. When we sum this from $j=0$ to $r-1$, we are adding up all the probabilities, so the complicated-looking sum is equal to $1$. We conclude that $$E(X)=\frac{rn}{r+w}\sum_{j=0}^{r-1} \frac{\binom{r-1}{j}\binom{w}{n-j-1}}{\binom{r+w-1}{n-1}}=\frac{rn}{r+w}. \hspace{1cm} \Box$$

Remark: Although the linearity approach is the smoothest, there are other properties of expectation that one can use for a proof. For example, let $E(n,x,y)$ be the expected number of red balls when we draw from $x$ red and $y$ white. On the first pick, we get a red with probability $\frac{r}{r+w}$, and a white with probability $\frac{w}{w+r}$. If we get a red on the first pic, then our expected number of reds is $1$ plus the expected number of reds from the remaining picks. If we get a white, then our expected number of reds is simply the expected number of reds from the remaining picks. So we obtain $$E(n,r,w)=\frac{r}{r+w}(1+E(n-1,r-1,w))+\frac{w}{r+w}E(n-1,r,w-1).$$ Using this formula, and a simple induction on $n$, we can prove that $E(n,x,y)=\frac{nx}{x+y}$.


Use linearity of expectation. For each red ball, the probability of being drawn, and thus the expected number of successes produced by that ball, is $n/(r+w)$. By linearity of expectation, the expected number of successes is just the sum of the contributions from all $r$ red balls, i.e. $r\cdot n/(r+w)$.