Welcome to MindCipher, a social repository of the world's greatest brain teasers, logic puzzles and mental challenges.

Death by drawing?

You are a prisoner in a strange foreign land, and a random drawing will decide your fate. You are given 2 bags, 10 white marbles, and 10 black marbles. You are to place the marbles in the bags in any arrangement you choose, as long as all marbles are placed and neither bag is left empty. A blindfolded official will then randomly choose one of the bags and randomly remove a marble from it. If the marble is white, you will be released. If it is black, you will be executed. How should you arrange the marbles to maximize your chance of going free?

Place one white marble in one bag, and all the rest in the other. This gives you about a 73.7% chance of being released.

I found the easiest way of solving this was trial and error. I used Excel to check all possible values. Let B and W respectively be the number of black or white balls placed in one bag. The odds of being freed are then 0.5 * (W/(W+B)+(10-W)/(20-W-B)). Here the mathematics gets too messy for me. To maximize this function's value, I'm guessing you differentiate and set it equal to zero. But my calculus is way too rusty, since there are two variables to deal with. Partial derivatives? I'm sure someone can answer this.



Bag 1 contains only 1 white and rest in another bag . This arrangment maximizes the probability of a ball being white when a ball is drawn randomly out of two bags.



Nikhil Barodiya

Spoiler: #LateralThinking

Put all the black marbles in one bag. All the white marbles in the other. Put the bag with white marbles into the bag with black marbles. 100% survival!

Guy Lawley

Isn't this independent probability based. In which case i'd go with you have an equal 1/2 chance either way.


1 white marble in a bag all the rest in the other.

1/2 * (1 + 9/19)

we want to maximize 1/2 * [w1/(w1+b1) + (10-w1)/(20-w1-b1)] over the integers w=0..5 and b=0..10 and also w+b can not equal 0, which prevents empty bags.

so we want to maximize the average probability of being saved.

we can imagine starting with a distribution like all white in 1 bag and all black in the other and then imagine how to improve the average.

We start with 1/2 * (10/10 + 0/10) = 1/2.

We only have 2 choices either move a white to the black or vice versa. Moving white to black improves the odds because the white marbles are wasted being together with no blacks. By symmetry moving a black to the white bag can only worsen odds by diluting white success and leaving the black failure chance still at zero.

This gives us an intuitive argument for why you want 1 white marble alone which is the minimal number for certain salvation and then a maximally diluted failure bag.

We can also just brute force the maximization over the 65 lattice points which is trivial to implement.


Yeah, the math is a bit messy, but you're finding the max of this. I'm not sure how to treat the b and w variables as whole numbers in Wolfram Alpha, but under the assumption that w > 0, where w is the number of marbles in the first bag, you're answer of 73.7% makes sense. I think this should solve it, but free Wolfram Alpha is telling me I exceeded standard computation time and need to pay for more :(.

Harshal Mehta

I would put just one white marble in first bag and all the other (white and black) marbles in the second bag. There are 50/50 chances of any one bag to be selected. If the first bag gets selected, BINGO. However if the second bag gets selected, I'd still have 9/19 chances of survival.

Check out other puzzles:

Like this? You might also like:
Cracking the Safe
Clock Works - Google Interview Question
What Number Is It?
Submitted by
almost 6 years ago
Difficulty 4.4 ?