Tuesday, 19 February 2019

probability - Random distribution of colored balls into boxes.



This is an abstraction of a real problem I have:




I have a large number of balls that are either Red or Blue ($n = 9*10^7$) and a bunch of containers ($c = 3*10^7$). I've calculated that the probability of a Red ball occurring $p_r=0.12$.



Next, I place three balls in each container randomly. I need to find out the number of containers on average that contain at least one Red ball. But I need to find out a formula that will work for any number of containers and any number of balls per container.



Even better, I have a set of Boxes as well ($b = 10^7$), and I place three containers in each Box. If a container has at least one red Ball, then it is a red Container, and if a Box has at least one red Container, then it is a red Box. How many red Boxes should I have?


Answer



For $i=1$ to $c$, define random variable $X_i$ by $X_i=1$ if container $i$ contains at least one red ball, and by $X_i=0$ otherwise. Let $Y=\sum X_i$. We want $E(\sum X_i)$, which by the linearity of expectation is $\sum E(X_i)$.



We can calculate $\Pr(X_i=1)$, that is, $E(X_i)$ either approximately or exactly. Since $c$ is large, approximately is good enough. Place the balls one at a time in container $i$. The probability of no red is approximately $(0.88)^3$, and therefore an excellent approximation to $E(X_i)$ is $1-(0.88)^3$. for the expectation of $Y$, multiply by $c$.




The expected number of red boxes is calculated using a similar strategy.


No comments:

Post a Comment

real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...