Red and Blue Marbles

Question: You have 50 red marbles, 50 blue marbles and 2 jars. One of the jars is chosen at random and then one marble will be chosen from that jar at random. How would you maximize the chance of drawing a red marble? What is the probability of doing so? All 100 marbles should be placed in the jars.

Answer: Seems tricky at first right? Given that the number of red and blue marbles are the same, you would tend to think that the odds are 50-50. You would try different combinations, such as 25 of each colored marble in a jar or putting all red marbles in one jar and all the blue in the other. You would still end up with a chance of 50%.

So lets think of a better way to distribute the marbles. What if you put a single red marble in one jar and the rest of the marbles in the other jar? This way, you are guaranteed at least a 50% chance of getting a red marble (since one marble picked at random, doesn’t leave any room for choice).  Now that you have 49 red marbles left in the other jar, you have a nearly even chance of picking a red marble (49 out of 99).

So let’s calculate the total probability.

P( red marble ) = P( Jar 1 ) * P( red marble in Jar 1 ) + P( Jar 2 ) * P( red marble in Jar 2 )
P( red marble ) = 0.5 * 1 + 0.5 * 49/99
P( red marble ) = 0.7474

Thus, we end up with ~75% chance of picking a red marble.

Have a better solution? Let us know through the comments section!

Get a free subscription to Oracle magazine published by Oracle Corp.
 Powered by Max Banner Ads 

Related posts:

  1. Pick a Random Byte
  2. 10 Google Interview Puzzles
  3. Probability of a Car Passing By
  4. Bulb Or No Bulb?
  5. What’s Your Eye Color?

3 Responses

  1. John S. says:

    I would put one red marble in jar 1, 49 red marbles in jar 2, and the blue marbles in the trash. The probability of picking a red marble is now 1.

    I don’t see anything in the problem statement that prevents this, so I win.

  2. jason says:

    I believe this is the best result we can achieve

  3. Aswin says:

    Hey John, smart answer but it clears says in the problem that “All 100 marbles should be placed in the jars”. I guess you have to think again now :)

Leave a Reply

Using Gravatars in the comments - get your own and be recognized!

XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>