I have $k_1$ red balls and $k_2$ blue balls in a box. Randomly select $n$ balls in the box without replacement. How to find expected number of red (or blue) balls.

This is my solution

The probability to get r red balls from $k_1+k_2$ balls in the box (event X): $$P_1(X)=\frac{\binom{k_1}{r}\binom{k_2}{n-r}}{\binom{k_1+k_2}{r}}$$

The $r$ can be from $0 $ to $k_1$ balls, so the prob. of the event is $$P_2(X)=\sum_{r=0}^{k_1}\frac{\binom{k_1}{r}\binom{k_2}{n-r}}{\binom{k_1+k_2}{n}}$$

Finally, we got the expected value as $$E(X)= \sum_{r=0}^{k_1} r\times \frac{\binom{k_1}{r}\binom{k_2}{n-r}}{\binom{k_1+k_2}{n}}$$

Is it right?

  • $\begingroup$ What do you mean with "in $k$ trails"? It seems to me that $k_1,k_2,n$ are determining and there is no place for an extra parameter $k$. $\endgroup$ – drhab Aug 23 '16 at 8:25
  • $\begingroup$ $k$ is number of trails and it given. For example, I draw 100 times and count the expected value $\endgroup$ – Jame Aug 23 '16 at 8:27
  • $\begingroup$ But what is the function of $n$? Aren't you talking about randomly selecting $n=100$ balls here? $\endgroup$ – drhab Aug 23 '16 at 8:29
  • $\begingroup$ $n$ is number of balls in each drawn times $\endgroup$ – Jame Aug 23 '16 at 8:30
  • $\begingroup$ Still unclear to me. Can you describe what happens if e.g. $n=2$ and $k=3$? $\endgroup$ – drhab Aug 23 '16 at 8:33

For $i=1,\dots,n$ let $R_i$ take value $1$ if trial $i$ results in a red ball, and let it take value $0$ otherwise.

Then $$R:=R_1+\cdots+ R_n$$ stands for the number of red balls.

With linearity of expectation and symmetry we find:$$\mathbb ER=n\mathbb ER_1=\frac{nk_1}{k_1+k_2}$$

edit for explanation:

As described in your question we will randomly select $n$ of the $k_1+k_2$ balls, but in order to create clarity before doing so we first reserve $n$ spots that are labeled by the numbers $1,2,\dots,n$. The first ball selected is placed on spot $1$, the second on spot $2$, et cetera.

Then event $\{R_i=1\}$ can be recognized as the event that a red ball will be placed on spot $i$.

Essential is here that at the stage of the beginning of the selection all balls have equal chance to become the one that will be placed on spot $i$.

There are $k_1+k_2$ balls in total, so that chance must be $\frac{1}{k_1+k_2}$.

Further $k_1$ of the balls are red, so the probability that a red ball will be placed on spot $i$ equals: $$\frac{k_1}{k_1+k_2}$$

If that is not clear enough yet then number the red balls with $1,2,\dots,k_1$ and let $A_j$ denote the event that ball $j$ will be placed on spot $i$.

Then the event that a red ball is placed on spot $i$ is $$A_1\cup\cdots\cup A_{k_1}$$ and its probability is: $$P(A_1\cup\cdots\cup A_{k_1})=\sum_{j=1}^{k_1}P(A_j)=\sum_{j=1}^{k_1}\frac1{k_1+k_2}=\frac{k_1}{k_1+k_2}$$

  • $\begingroup$ Since the R_i are not i.i.d, how does the linearity of expectation apply here? The expected value of, e. g. R_17 is not obvious to me at least. $\endgroup$ – Zach Boyd Mar 25 at 20:00
  • $\begingroup$ 1) linearity of expectation can always be applied. You don't need i.i.d. for that. 2) Here the $R_i$ are not independent but have equal distribution. I assure you that e.g. balls 1 and 17 have equal chances to be red. This makes it possible to use symmetry in the sense that $R_1$ and $R_{17}$ have the same expectation. $\endgroup$ – drhab Mar 25 at 21:01
  • $\begingroup$ Agreed on the linearity. Is there an easy way to see why the distributions are equal? $\endgroup$ – Zach Boyd Mar 25 at 21:13
  • 1
    $\begingroup$ Compare it with this: blindfolded you grab $n$ balls and then you place them on spots that are labeled with the numbers $1,2,\dots,n$. Can you think of any reason why e.g. the probability that spot $4$ receives a red ball will be different than the probability that spot $12$ receives a red ball?...I am telling you there is none! This situation does not essentially differ from picking out balls one by one saying: "you are the first, you are the second.." et cetera. $\endgroup$ – drhab Mar 26 at 9:08
  • $\begingroup$ That is pretty slick. Do you know if there is a way to translate that into a rigorous argument? The assertion essentially seems to be that there is a symmetry in the problem. $\endgroup$ – Zach Boyd Mar 26 at 13:17

The probability to draw $\ell$ red balls out of $r$ total draws is $$ \frac{\binom{k_1}{\ell}\binom{k_2}{r-\ell}}{\binom{k_1+k_2}{r}}. $$ This follows a hypergeometric distibution, and thus has expectation $$ r\frac{k_1}{k_1+k_2}. $$ Note that, similarly, the expected value of drawn blue balls equals $$ r\frac{k_2}{k_1+k_2} $$ and thus that the sum equals $r$.

  • $\begingroup$ I have updated my equation. Your equation is look like me. Could you check it again. I think it must be summation $\endgroup$ – Jame Aug 23 '16 at 8:19
  • $\begingroup$ Your formula for the expectation in the form of a sum is indeed correct. A closed form for this sum is the fraction I gave in the answer. $\endgroup$ – Marc Aug 23 '16 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.