Sign in to track progress, unlock prep layers, and browse your pipeline.Sign in
Optimize red-ball draw probability, prove optimality
Two-Box Ball Allocation to Maximize Probability of Drawing Red
Setup:
- You have 2 boxes and two colors of balls: red and blue.
- Initially, you have 100 red balls and 100 blue balls.
- A box is chosen uniformly at random (probability 1/2 for each box).
- Then, one ball is drawn uniformly at random from the chosen box.
Tasks:
- Given 100 red and 100 blue balls, how should you distribute the balls between the two boxes to maximize the probability of drawing a red ball? Compute this maximum probability.
- Prove that your proposed distribution is optimal.
- Generalize the problem: For R red and B blue balls (where R, B ≥ 1), characterize the optimal allocation and provide the maximal probability of drawing a red ball as a function of R and B.
AI interview prep
Core dilemma
Balancing the probability of drawing red from one box against the risk of drawing blue from the other, by strategically creating a high-probability box and a lower-probability but still viable box.
Mid-level signals3
Senior signals3
Red flags3
2 tradeoffs and 2 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Optimize red-ball draw probability, prove optimality
Two-Box Ball Allocation to Maximize Probability of Drawing Red
Setup:
- You have 2 boxes and two colors of balls: red and blue.
- Initially, you have 100 red balls and 100 blue balls.
- A box is chosen uniformly at random (probability 1/2 for each box).
- Then, one ball is drawn uniformly at random from the chosen box.
Tasks:
- Given 100 red and 100 blue balls, how should you distribute the balls between the two boxes to maximize the probability of drawing a red ball? Compute this maximum probability.
- Prove that your proposed distribution is optimal.
- Generalize the problem: For R red and B blue balls (where R, B ≥ 1), characterize the optimal allocation and provide the maximal probability of drawing a red ball as a function of R and B.