I've tried searching for this question but couldn't find it on stackexchange. This is a common type of interview question; I ran into it doing brain teasers on a probability puzzles app, and if you fine people agree with my logic, I will inform the app developer that his/her answers are incorrect.
The problem is essentially this:
You are sentenced to death for thievery. The King is magnanimous and decides to put your fate in the hands of chance. You are given $100$ white marbles and 100 black marbles, and $2$ urns. The king will choose an urn at random and pull out a single marble at random; if the marble is white, you live, if its black, you die. If you place the marbles in the best way possible, what is your probability of survival?
I started with the base case: $100$ white marbles in one urn, $100$ black marbles in the other. This comes down to a $50$-$50$ chance of survival. I then worked my way to deciding that placing $1$ white marble in one urn and $99$ white marbles + $100$ black marbles in the other urn would be the "best way possible", which yields the following:
$$P(\text{Survival}) = \frac{1}{2}(1+\frac{99}{199}) \approx .749$$
Selecting $1$ of $2$ urns at random gives $\frac{1}{2}$, the urn containing $1$ marble gives $1$, and the other that contains $99$ white marbles and $100$ black marbles gives $\frac{99}{199}$ because there are $99$ possible white marbles to select out of $199$ total marbles.
The app claims that the correct answer is $\frac{1}{2}(1+\frac{99}{200}) \approx .748$
I see where the $200$ comes from, but I do not think it is right to say that there are $200$ marbles in the other urn. Who is correct?
Best Answer
If you want a proof that your solution is optimal, consider the following:
Clearly, if you put an equal number of black balls and white balls in each urn, the probability of survival is $\frac{1}{2}$.
Thus, in the optimal solution, one of the urns will have more white balls, and the other will have more black balls. The urn with more white balls can't give you a chance of survival of more than $1$, and the urn with more black balls can't give you a chance of survival of more than $99/199$.