Visit our sponsor Five Planet Juices  
Home
Microsoft Interview Process
Microsoft HR Questions
Technical Questions
Puzzles/Riddles
Resume Tips and Template
Discuss
Question to Interviewer
Interview Tips
Term Of Use
Site Feedback


Bucket of Jelly Beans

You have a bucket of jelly beans. Some are red, some are blue, and some green. With your eyes closed, pick out 2 of a like color. How many do you have to grab to be sure you have 2 of the same?

 

Add your possible solutions in a comment, I will put the one which will convience me here


Comments:

solution to jelly beans problem
By kollol on Sunday, August 20, 2006 (UMST)
four

Reply to this Comment

mmm... beans
By gryyn on Monday, February 05, 2007 (UMST)

The maximum amount of grabs needed is two grabs.

At the first time, you either get two similar beans (problem solved) or you get two beans with different colours.

Now during the next grab you can get two similar beans (problem solver) or you get a colour you didnt have before and a colour you already had. Since there is no fourth colour the second bean on the second pick has to be the colour you already have.

Reply to this Comment

solve by probability
By nguyen_a on Saturday, May 05, 2007 (UMST)

Well, if the beans are placed into the bucket one layer at a time then it takes 1 draw to have 2 beans of the same of color.  But assuming that the beans are evenly distributed, then let n = number of beans of a color, m = total number of beans in the bucket, the probability of getting 2 beans of same color is:

(n * (n-1) ) / (m * (m-1))

Now, plug in an example: n = 3 beans of a color, m = 10 total number of beans, the probability of getting 2 beans of same color is= 3*2 / 10*9 = 6/90 or 1/15.  So 15 draws are needed.

Reply to this Comment

question
By SantiagoICanepa on Friday, May 25, 2007 (UMST)
How do you know you pick two of a like color if the eyes are closed?

Reply to this Comment

4
By markz on Wednesday, June 06, 2007 (UMST)
i concur. 4 is the answer. Worst case is 3 beans pulled at random will be red, blue and green. At this point forth bean will make a pair with one of the three.

Reply to this Comment

4 jelly beans
By monty on Sunday, September 16, 2007 (UMST)
worst case... you might pick red then blue then green in 3 attempts... in the 4th attempt you will pick any of the 3 (R/G/B) jelly bean... so you will get a pair of like coloured jelly bean! therefore 4 attempts are required...

Reply to this Comment

correct
By vinodhsen on Monday, November 19, 2007 (UMST)

Hi All,

 

this is the correct one .

 

regards

vinodhsen

Reply to this Comment

it's four either way, but...
By insidi0us on Monday, May 19, 2008 (UMST)
isn't the question asking: "how many jelly beans must you grab in ONE ATTEMPT to be certain that two of them are of the same color?"? every answer i see here is interpreting the question as if it's asking "how many times must you draw one jelly bean before you can be certain you have two of the same color?" the answer would obviously be four, but i don't think the question is asking that. read it again: "how many do you have to grab to be sure you have 2 of the same?"... is simply asking how many do u need to pick up with ONE grab... if interpreting it this way, it would depend on how the jelly beans were distributed... if in layers, then just 2. if randomly, then four. if you never knew what the distribution looked like, and your eyes were closed, then the answer remains at four.

Reply to this Comment

Answer
By Cibert on Tuesday, July 08, 2008 (UMST)
Huuum If The Question its exactly like there, Then The answer is 4, But Maybe They are thinking about, how many jellys i need to grab to be sure of have 2 of the same LIKED jelly ???, If That I think the only way to be sure of that its to grab all of them =S. But If not 4 Its Ok.

Reply to this Comment

Add Your Comment

New Articles
  • Phone screen from MICROSOFT Denmark for SDET
    Technical Phone screen after Escreen

  • Please post some non-tech qs for User Experience and Business Analyst job

    I am a CS Grad applied in non-tech position.Please help!


  • Combinations in a character array.
    Write a program that takes input a char array and outputs all the combinations of the characters in the character array.
    Example: consier char array {'a','b','c'}
    the output shouold be abc,cab,bac,acb,cba,bca that is all the combinations of characters 'a','b','c'.


  •  

    Most Popular Articles
  • Crazy Guy On The Airplane
    A line of 100 airline passengers is waiting to board a plane. they each hold a ticket to one of the 100 seats on that flight.

  • What are your greatest weaknesses
    Beware - this is an eliminator question, designed to shorten the candidate list. Any admission of a weakness or fault will earn you an “A” for honesty, but an “F” for the interview.

  • Question: Tell me about yourself.
    Many candidates, unprepared for the question, skewer themselves by rambling, recapping their life story, delving into ancient work history or personal matters.

  •  

    New Posts

  • male enhancment buy viagra tramadol online
    Posted by SurojattSit on 2008年9月30日 (UMST)

  • penis enlargement viagra cheap tramadol
    Posted by BobeCrobChext on 2008年9月30日 (UMST)

  • penis viagra online Tramadol
    Posted by BobeCrobChext on 2008年9月30日 (UMST)



  •