I have a bag of 10 jelly beans. There are two each of five different colors. These jelly beans taste extra delicious if you eat two of different colors at the same time. So here's how I will eat them:

I will pick two at random without looking into the bag. If they are the same color, I will put them back and pick again until they don't match. If they are different colors, I will eat them (yum!).

If I continue to eat them in this way, what is the probability that the last pair of jelly beans will be different colors?

If the probability can be expressed as $\dfrac ab$ , where $a$ and $b$ are coprime positive integers, submit your answer as $a+b$ .

The answer is 21519.

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

Call the starting situation $5d0s$ for the 5 pairs of duplicate colors and 0 single colors. The number of s is always even. We seek to arrive at $0d2s$ and not $1d0s$ .

The probability of 'winning' for some simpler situations: $P(2d0s)=1$ because we won't eat two of the same color. $P(0d[2n]s)=1$ because if they are all different colors we will always win.

$P(3d0s)=P(1d2s)=\frac{4}{5}$ because we start with 4 jelly beans. There are 6 ways of choosing 2, but 1 will be rejected. We win as long as we don't pick the matching pair and do pick one of the 4 unmatched pairs.

$P(4d0s)=P(2d2s)$ is harder. There are 6 jelly beans and 15 ways of picking 2, but 2 of these will be rejected as a matching pair, leaving 13 possible outcomes.

1 of these (picking the two singles) brings us to $2d0s$ . $\frac{1}{13}*1=\frac{1}{13}$

8 of these (picking a single and one of a double) bring us to $1d2s$ which we found above. $\frac{8}{13}*\frac{4}{5}=\frac{32}{65}$

4 of these (picking one of each of the remaining doubles) bring us to $0d4s$ . $\frac{4}{13}*1=\frac{4}{13}$

So the total $P(4d0s)=\frac{1}{13}+\frac{32}{65}+\frac{4}{13}=\frac{57}{65}$

We will also need $P(1d4s)$ . I'll just give the calculation: $\frac{8}{14}*1+\frac{6}{14}*\frac{4}{5}=\frac{32}{35}$

Now to tackle the answer. The first pick from $5d0s$ must bring us to $3d2s$ which is 8 jelly beans. The next pull can happen in $8C2-3=25$ ways.

1 of these (picking the two singles) brings us to $3d0s$ . $\frac{1}{25}*\frac{4}{5}=\frac{4}{125}$

12 of these (picking a single and one of a double) brings us to $2d2s$ . $\frac{12}{25}*\frac{57}{65}=\frac{684}{1625}$

12 of these (picking one each of the remaining doubles) brings us to $1d4s$ . $\frac{12}{25}*\frac{32}{35}=\frac{384}{875}$

So the total $P(5d0s)=\frac{4}{125}+\frac{684}{1625}+\frac{384}{875}=\frac{10144}{11375}$ and so the answer is $10144+11375=\boxed{21519}$