So, this is the problem

You have an urn with balls of two different colors and you take two without replacement. The probability of getting two of the same color is the same as getting one from each color. How many balls from each color if we know that in total we have 31?

What I do is (X,Y denote the different colors, index denotes different drawings)

$P(X_2|X_1) = P(Y_2|X_1) = P(X_2\cap X_1)/P(X_1) = P(Y_2\cap X_1)/P(X_1) \\ P(X_2\cap X_1) = P(Y_2\cap X_1) \rightarrow\\ \frac{X-1}{29}\frac{X}{30} = \frac{Y}{29}\frac{X}{30} \rightarrow\\ X-1=Y \rightarrow X= 16, Y=15 $

Is this correct ? I am worried, that one could choose instead of $P(Y_2\cap X_1)/P(X_1)$ to have $P(X_2\cap Y_1)/P(Y_1)$ and then maybe my solution would not hold...

  • $\begingroup$ It does not work. Did you try to use your answer to check whether it gives the same probability? In fact $31$ balls may not have any solution, with or without replacement. $\endgroup$
    – Math Lover
    Commented May 11, 2021 at 21:52
  • $\begingroup$ any hints on how to actually solve it ? $\endgroup$ Commented May 11, 2021 at 21:53
  • $\begingroup$ This isn't really a Bayes Theorem problem. Such a problem would involve events $E,F$, where you calculate $p(E|F) = \frac{p(EF)}{p(F)}.$ Here, the straightforward way of calculating it is just as Math Lover's answer indicated. More formally, the number of ways of picking 2 from the first color are $$\frac{(x)(x-1)}{(31)(30)}.$$ Math Lover used the shortcut of recognizing that the denominator $(31)(30)$ pertained through out, and so dismissed it, and just focused on enumerating the pertinent numerators. $\endgroup$ Commented May 11, 2021 at 22:42

2 Answers 2


Two of the same colour is the event: $(X_1\cap X_2)\cup(Y_1\cap Y_2)$.

One from each colour is the event: $(X_1\cap Y_2)\cup(Y_1\cap X_2)$

Remember that there are $x$ balls of one colour and $31-x$ of the other.


If there is $x$ of one color, there is $(31-x)$ of other.

Number of ways of picking balls of the same color,

$ \displaystyle x(x-1) + (31-x) (30-x)$

Number of ways of picking one ball of each color,

$= 2 x (31-x)$

If you equate the two, you get $ \displaystyle x = \frac{31 \pm \sqrt {31}}{2}$.

So there is in fact no way to have $31$ balls in total of two different colors such that the probability of picking two balls of same color is same as probability of picking one ball of each color (without replacement).

  • $\begingroup$ this is great! Could you help me understand what is wrong with the logic I followed with conditional probabilities ? $\endgroup$ Commented May 11, 2021 at 22:04
  • $\begingroup$ sure, thanks, I appreciate it. $\endgroup$ Commented May 11, 2021 at 22:13
  • $\begingroup$ It is the part that you were worried about. As you mentioned in the end, $P(X_2 \cap Y_1)$ is not considered on right hand side in your answer. Also on the left hand side, $P(Y_2 \cap Y_1)$ is not considered. $\endgroup$
    – Math Lover
    Commented May 12, 2021 at 4:21
  • 1
    $\begingroup$ So you should have $P(X_2 \cap X_1) + P(Y_2 \cap Y_1) = P(X_2 \cap Y_1) + P(Y_2 \cap X_1)$. $\endgroup$
    – Math Lover
    Commented May 12, 2021 at 5:09

You must log in to answer this question.

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