2
$\begingroup$

For the following problem:

There are two boxes $A$ and $B$. Box $A$ contains $3$ red, $8$ white and $13$ green spheres, while box $B$ contains $5$ red, $7$ white and $6$ green spheres. If we pick one sphere from each box at random, what is the probability that they have the same color?

I followed this way of thinking:

I assume the following events:

  • $A_1:=\{ \text{Sphere from box A is red} \}, \quad \quad B_1:=\{ \text{Sphere from box B is red} \} $
  • $A_2:=\{ \text{Sphere from box A is white} \}, \quad B_2:=\{ \text{Sphere from box B is white} \} $
  • $A_3:=\{ \text{Sphere from box A is green} \}, \quad B_3:=\{ \text{Sphere from box B is green} \} $

Then the probability that they have the same color will be: \begin{equation} P[(A_1 \cap B_1)\cup (A_2 \cap B_2)\cup (A_3 \cap B_3)] \end{equation} But those events are both independent and mutually exclusive therefore for two events $A$ and $B$ it generally holds: \begin{equation} P(A\cup B)=P(A)+P(B), \quad P(A \cap B)=P(A)P(B) \end{equation} So our equation above is rewritten as: \begin{equation} P[(A_1 \cap B_1)\cup (A_2 \cap B_2)\cup (A_3 \cap B_3)]=P(A_1)P(B_1)+P(A_2)P(B_2)+P(A_3)P(B_3) \end{equation} which now is just a matter of arithmetics.

Anyway, my question is the following:

Is my thinking above correct? And if yes, I am pretty sure there is a faster way to go with this one. Any ideas?

Thank you!

$\endgroup$
10
  • 2
    $\begingroup$ "But those events are both independent and mutually exclusive" is technically incorrect, and the displayed formula below that uses new undefined names. That part of the answer should be omitted. (If $A$ and $B$ mean what I think they mean, the formula for $\Pr(A\cup B)$ is not right.) The final formula is correct. $\endgroup$ Commented Jan 25, 2016 at 20:17
  • 1
    $\begingroup$ $A_1$ and $B_1$ are independent. They are not mutually exclusive. In all but trivial cases, independent and mutually exclusive are incompatible. If $C$ and $D$ are independent, knowing that $C$ occurred tells us nothing about $D$. If they are mutually exclusive, knowing that $C$ occurred tells us $D$ did not. $\endgroup$ Commented Jan 25, 2016 at 20:31
  • 3
    $\begingroup$ The three events "both red", "both white", and "both green" are mutually exclusive. That justifies the final addition. $\endgroup$ Commented Jan 25, 2016 at 20:39
  • 1
    $\begingroup$ @Mitscaype: Faster than just multiplying three pairs of fractions and adding? How could computing a hypergeometric distribution be faster than that? $\endgroup$
    – Brian Tung
    Commented Jan 25, 2016 at 20:52
  • 2
    $\begingroup$ Faster would be to leave out the formulas. It should be clear that the answer is probability of red red plus probability of white white plus $\dots$. $\endgroup$ Commented Jan 25, 2016 at 20:59

1 Answer 1

0
$\begingroup$

Comment: From your final formula, approved by @AndreNicholas, I get a probability of 0.3449.

In the following simulation in R of a million such experiments, I used numbers 1, 2, and 3, for the three respective colors. Results are as follows:

 box.a = c(rep(1,3),rep(2,8),rep(3,13))
 box.b = c(rep(1,5),rep(2,7),rep(3,6))
 m = 10^6
 a =sample(box.a, m, repl=T)  # vector of draws from Box A
 b =sample(box.b, m, repl=T)  # vector of draws from Box B
 mean(a==b)                   # proportion of matches
 ## 0.344875

Agreement to about three places is within the margin of simulation error. So your formula does indeed seem to work. You should make sure you resolve the difficulties in the derivation of your formula. I'm not sure there is a simpler formula or a basically simpler way to get the formula.

$\endgroup$
2
  • $\begingroup$ Yeap, I also think that that's it. I was just curious first of all to see if I was right about the original formula and secondly, to check if anyone has any better solution. And by better, perhaps a faster one. Seems like there is not. Nevertheless thank you for taking time to verify it. :) $\endgroup$
    – Bazinga
    Commented Jan 25, 2016 at 22:27
  • $\begingroup$ Glad it's settled. Elementary, but interesting question. $\endgroup$
    – BruceET
    Commented Jan 25, 2016 at 22:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .