## Yahoo Interview Question

Developer Program Engineers**Country:**India

Yes...you can exchange the balls before you are blindfolded..but after you are blindfolded the might shuffle the jars

but after you are blindfold you don't know which jar will have 1 red ball... if you pick other jar then your probability of picking red ball is less than 50 i.e.. 49/99 < 50%

@irraju: in that case I'll just leave one red ball in one of the bins, and use touch to know which bin has only one ball. I'll pick that one. 100% success rate!

with the blindfold ,how can you assure that you are moving 49 red balls form jar1 to jar2.

This is the correct answer. I had read this one elsewhere before with the same answer. The wording in the problem has to be changed. You are allowed to move balls between jars before being blindfolded.

Nope, dc360. They want to know your approach. Its a test of how simply you can understand a given problem with only that much info.

The approach is - pick up 1 ball from each jars. If you do this, the chances that you have a red ball is 100%. 100% is greater than 50%.

It can't get simpler than this. Every problem should not be just solved with textual mathematical knowledge :)

Very well if you could change the composition of jars - I would throw all blue balls and add some red balls in this jar from first one ... now its a sure/certain event (100% Probability) ... howzatt?

Nope, dc360. They want to know your approach. Its a test of how simply you can understand a given problem with only that much info.

The approach is - pick up 1 ball from each jars. If you do this, the chances that you have a red ball is 100%. 100% is greater than 50%.

It can't get simpler than this. Every problem should not be just solved with textual mathematical knowledge.

place 1Red ball in one jar and 49R+50B balls in second jar... and get one common balance and place these jars on both sides of balance... now blindfold, pick one that is on upper side of the common balance with lesser weight...

like this, need an indication to identify which jar we need to pick to get >50% probability

Are we allowed to move balls between the jars?

- Aashish July 24, 2012Edit: Fresh Solution

Let P(1) is probability of choosing jar 1,

P(2) is probability of choosing jar 2,

X is the probability of choosing a red ball in jar1.

Y is the probability of choosing a red ball in jar2.

Total probability= P(1)*X + P(2)*Y

Where P(1)=P(2)=1/2

What is the maximum number of balls a jar can have??

If its 100, move 49 red balls from jar1 to jar2.

Now, jar 1 contains 1 red ball & jar 2 contains 50 blue balls & 49 red balls.

Total probability of drawing a red ball is 1/2 + 0.5*49/99= 74/99=74.74%