How many jelly beans will be left

Steven G

Elite Member
Joined
Dec 30, 2014
Messages
14,362
In a giant bin, we stir together 2019 red jelly beans and 2019 green jelly beans. We pull 3 jelly beans out of the bin at a time. There are two possibilities – they are all the same color or there are 2 of one color (and one of the other). In the first case (3 of the same color), we eat all 3 jelly beans. In the second case (2 of one color), we put 1 jelly bean back of the majority color and eat the other 2.

If we repeat this process until there are fewer than 3 jelly beans left in the bin, there are these possibilities

1. No jelly beans.

2. One red jelly bean.

3. One green jelly bean.

4. Two red jelly beans.

5. Two green jelly beans.

6. One red and one green jelly bean

Which of these outcomes is most likely? Which is least likely?

I would suspect that no jelly beans will be left most of the times and one of each very infrequently. I do see that choices 2-5 are symmetric. I've never seen a problem like this and don't know how to attack it. A hint will be nice.
 
In a giant bin, we stir together 2019 red jelly beans and 2019 green jelly beans. We pull 3 jelly beans out of the bin at a time. There are two possibilities – they are all the same color or there are 2 of one color (and one of the other). In the first case (3 of the same color), we eat all 3 jelly beans. In the second case (2 of one color), we put 1 jelly bean back of the majority color and eat the other 2.

If we repeat this process until there are fewer than 3 jelly beans left in the bin, there are these possibilities

1. No jelly beans.

2. One red jelly bean.

3. One green jelly bean.

4. Two red jelly beans.

5. Two green jelly beans.

6. One red and one green jelly bean

Which of these outcomes is most likely? Which is least likely?

I would suspect that no jelly beans will be left most of the times and one of each very infrequently. I do see that choices 2-5 are symmetric. I've never seen a problem like this and don't know how to attack it. A hint will be nice.
Most likely (almost surely) outcome would be a terrible stomach-ache (after eating ~ 4000 jelly beans)
 
I am reminded of puzzles like this where only one final situation is possible, and it is proved by finding a quantity that is unchanged by any step.

I suspect that is the case here, and at least some of the possibilities are eliminated by considering the effect of each step on the difference in the number of reds and greens. Take that as a hint, though I (intentionally) haven't fully analyzed the problem.
 
Here is what I have so far. I think that I made nice progress.

Proposition 1: It is impossible to end up with 2 jellybeans of the same color if we start with equal numbers of red and green jellybeans.

Proof: Let (r, g) = how many of each color jellybean is in the jar. We start with N green and N red jellybeans.
Let a = how many times we get 3 red jellybeans in a sample;
b = how many times we get 3 green jellybeans in a sample;
and c = how many times we get both colors in a sample.

So, (r, g) will be given by:
r = N - 3a - c
g = N - 3b - c

To end up with 2 red jellybeans we need to find non negative integers a, b, and c such that:
2 = N - 3a - c
0 = N - 3b - c
This has a solution of b-a = 2/3 which is not possible since a and b are integers.
The proof of the impossibility of ending up with 2 green jellybeans is identical.

Proposition 2: It is impossible to end up with 1 jellybean of the same color if we start with equal numbers of red and green jellybeans.
Let (r, g) = how many of each color jellybean is in the jar. We start with N green and N red jellybeans.

Let a = how many times we get 3 red jellybeans in a sample;
b = how many times we get 3 green jellybeans in a sample;
and c = how many times we get both colors in a sample.

So, (r, g) will be given by:
r = N - 3a - c
g = N - 3b - c
To end up with 1 red jelly we need to find non negative integers a, b, and c such that:
1 = N - 3a - c
0 = N - 3b - c
This has a solution of b-a = 1/3 which is not possible since a and b are integers.
The proof of the impossibility of ending up with 1 green jellybean is identical.


I still need to find the P(No Jelly Beans) and P(1 red and 1 Green) (maybe I need to use some ideas from proof of the binomial theorem??)
I also need to show that B commutes with R and G
Any ideas would be helpful!
Thanks.

Update: I just proved that P(RG | (r,g)) = P(GR | (r,g))
 
Last edited:
The quick way I saw to eliminate all but two cases is that the difference between the number of red and greens always changes by a multiple of 3 (that is, either 0 or 3), and it starts at 0, so it must always be a multiple of 3. (That is, it is invariant, mod 3.) It can never be 1 or 2.

I haven't pursued the remaining question.
 
I think that maybe you missed something in the problem. If you take out 3 jellybeans and there is both colors, then you discard one of each color. Unless I am missing something, if you get both colors then you are not discarding colors in multiples of 3.
 
I didn't say the number of each remains a multiple of 3; I said the difference remains a multiple of 3. If you discard (or eat) one of each, the difference doesn't change.
 
I didn't say the number of each remains a multiple of 3; I said the difference remains a multiple of 3. If you discard (or eat) one of each, the difference doesn't change.
OK, thanks for the response
 
Top