GeeksforGeeks » Interview Questions

Amazon Interview Question for Software Engineer/Developer about Puzzle

(4 posts)
  1. abhi
    guest
    Posted 1 year ago #

    There are two urns A and B and an equal number of red balls and blue balls.How do u place the balls in the urns such that the probability of picking up the red ball is greater?

  2. ajaym
    Member
    Posted 1 year ago #

    place 1 red ball in urn A and rest of the red balls in urn B.

  3. tapan.k.avasthi
    Member
    Posted 9 months ago #

    I agree with the answer. Here is an explanation in my understanding.
    Let the number of blue and red balls each be n.
    Total balls=2n
    P(x) be the probability of picking a single ball from one of the urns.
    P(x=R) be the probability that the picked ball is red.
    P(x=B) be the probability that the picked ball is blue.
    Then,
    P(x=R)= 1/2 (1 + (n-1)/(2n-1)) = 1/2. ((3n-2)/(2n-1))
    P(x=B)= 1/2(0 + n/(2n-1))= 1/2(n/(2n-1))

    Now, the claim is that P(x=R)>0.5 i.e 3n-2/2n-1 >1
    as 3n-2>2n-1 => n>1 which is true
    P(x=B) = 1-P(x=R)
    so, P(x=B)<0.5

  4. Adam Chu
    guest
    Posted 6 months ago #

    Why need math? You have 1 red ball in urn A, that's 50% chance already. And red ball's chance in urn B is more than zero.


Reply

You must log in to post.

RSS feed for this topic