Hacker News new | ask | show | jobs
by garganzol 2223 days ago
This is quite good question with an intuitive answer (at least to me): 50%/50% marble distribution maximizes the chances of getting specific color with a random selection.
6 comments

Unless you are allowed to ask questions or gain some prior knowledge, isn't the outcome of picking a black marble (given that you have to put all marbles into the bags) 50%?

~50/50 -> .5x(2/5) + .5x(3/5) = .5

~0/1 -> .5x0 + .5x1 = .5

You can’t do that though. There are only 5 marbles of each colour so there’s no way to split them so that both bags have the same distribution. Thus your closest to 50/50 would be 2 black and 2 white in one bag, 3 black and 3 white in the other, giving you a 0.5 probability of guessing correctly.

You’re better off putting one black marble into one bag and all of the rest of the marbles into the other. That way if you pick the bag with just one marble you win by default and if you pick the other bag you have a 4/9 probability of getting a black one. This gives you a total probability of 13/18 = 0.72.

I suck at these riddles but can you choose what color you want and is a difference in size of the bags evident?

If so I would put all of one color in one bag, all of other color and 2 of the first color in other bag.

Now I have two different size bags one with all one color and one with very little of that color.

If I can pick bag and color I want I pick the small bag and say I want that color.

If I can't pick bag but I can pick color when they choose bag I choose whatever color is most likely to be in bag.

If I have no choice in anything I would always have the 50% chance of whatever color was assigned to me, this makes me assume I have some choice.

on edit: obviously distribution is an example, probably smartest distribution is one in one bag, rest in other bag.

on edit2: realized I described separation of colors poorly.

This type of question is like magic trick. The questions sets up a "familiar stage" or 'context' to limit your thinking. It's up to you to do the magic trick.

There is obvious answer.

Hmm, I think 50/50 is the worst you could do. What if you put 1 black marble in 1 bag and the other marbles in the other bag. Then even a random choice would get you .5 * 100% + .5 * 4/9 = 72.2%

And also, if you can look at or touch the bag before picking it, then just pick the one the looks like it has only 1 vs. 9 marbles!

You can definitely do worse than 50/50: just flip your solution and put a single white marble in one of the bags. By the way, your solution--single black marble in one bag, all other marbles in the other bag--is optimal; do you know of a way to prove it? Besides just exhaustive enumeration, that is.
Exhaustive enumeration is a proof even if it's not very satisfying :-). For example, a big part of the Four colour theorem is a big enumeration of all configurations.
wouldn't putting one black marble in one bag and all the others into the second bag give you the highest chance of being able to draw a black marble? .5 * 1 + .5 * 4/9 = .72