Tuesday, June 14, 2011

Interview Questions - Puzzle

A person has 50 Red Balls, 50 Blue Balls and two empty Jars with the capacity of 200 balls. This guy has to distribute following balls in the jars available to him.

Distribute the balls such that probability of withdrawing the red ball is maximum.

Assumptions:

  • Person can pick any ball from any of the jars.
  • Jars need not to have number of balls.
  • It is not possible to place all the red balls on top of blue balls (This ordering will not work.) Person can shake the jars before withdrawing the ball.
In case of any doubts regarding the question, please comment.

1 comment:

  1. To maximize the chances of retrieving Red Ball, it is mandatory to reduce the chances of retrieving Blue ball.

    To reduce the chances.

    1. It is possible to put all the black ball in one jar. It will reduce the probability of retrieving black ball to half.

    2. Now to reduce the probability of withdrawing Blue balls, need to maximize number of red balls in the jar with blue balls. Maximum red balls we have is 50.

    So based on above 2 points...

    one jar can have 1 Red ball, and other will contain rest 99 balls.

    So probability of choosing red ball is
    (Probability of Choosing Jar 1)*(Probability of Choosing Red Ball From jar 1) + (Probability of Choosing Jar 2)*(Probability of Choosing Red Ball From jar 2)

    (1/2)*(1) + (1/2)(49/99)

    ReplyDelete