Balls in Two Boxes Optimization

Reported in interviews at Jane Street Two Sigma

Problem statement

You have 100 red balls and 100 blue balls, and two boxes. You must distribute all 200 balls into the two boxes, with each box containing at least one ball.

A box is chosen uniformly at random, and then a ball is drawn uniformly at random from that box. Maximize the probability that the drawn ball is red.

Show hint

How does the chance of red depend on each box's contents when a box is picked first with equal odds?

Relevant roles: Data Scientist, Applied Scientist, Research Scientist and ML Engineer.

Related free problems