Suppose we have an urn containing c yellow balls and d green balls. We draw k balls, without replacement, from the urn. Find the expected number of yellow balls drawn. Hint: Write the number of yellow balls drawn as the sum of c random variables.
I initially thought the solution is the sum of a hypergeometric distribution:
$$E(X) = \sum_{x = 0}^{k}x\frac{\binom{c}{x}\binom{d}{k-x}}{\binom{c+d}{k}}$$
The issue is that this doesn't work for any value of $k$ (for example, what if $k > c$ or $k-x > d$), it also doesn't fit with the hint given in the question. Is there a way to generate a more general solution for $1<k<c+d$?
All you need to do is replace $k$ with $min(k,c)$. So the expression would become :
$E(X) = \sum_{x = 0}^{min(k,c)}x\frac{\binom{c}{x}\binom{d}{k-x}}{\binom{c+d}{k}}$