Say that we have $k$ red balls and $n-k$ blacks balls for $n$ balls total. Then, say we partition the balls into equal sized groups of size $m$. What is the expected number of groups with a red ball?
It seems clear that I should use linearity of expectation of some sort. I tried calculating the probability that any one group has at least one red ball, but I can't seem to get my equation to match my code simulation result.
Any help would be appreciated
Let $X_i$ be an indicator random variable $=1$ if the $i^{th}$ group has a red ball, and $=0$ otherwise.
Then $P[i^{th}$ group has a red ball] $= \left[1 - \dfrac{\binom{n-k}{m}}{\binom{n}{m}}\right]$
Now the expectation of an indicator r.v. is just the probability of the event it indicates, so $E[X_i] = \left[1 - \dfrac{\binom{n-k}{m}}{\binom{n}{m}}\right]$
By linearity of expectation we have expectation of sum = sum of expectations,
$E[\sum{(X_i)}] = \sum{E(X_i)} = \dfrac{n}{m}\left[1 - \dfrac{\binom{n-k}{m}}{\binom{n}{m}}\right]$