GeeksforGeeks » Interview Questions
Amazon Interview Question for Software Engineer/Developer about Puzzle
(4 posts)-
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?
-
place 1 red ball in urn A and rest of the red balls in urn B.
-
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 -
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.