Problem: Another term for the same problem is Jelly Beans Problem. Mostly asked in Interview as Puzzle. Suppose you have three jars. One jar contains Apple, another jar contains Orange and third jar contains mixture of both the fruits. You have to fix the labels of jars by picking up as many fruits as you want from each jar. What is the minimum number of fruits that you have to pick and from which jars to correctly label them ? Solution: As all jars are labeled incorrectly. So, if you pick one fruit from jar label Apple+Oranges, then whatever fruit comes be it Apple or Orange, then label that jar with the name of that fruit. Lets say orange come out of it, then label jar with Orange which was initially labelled as Apple+Orange. Now, jar labeled with Orange can be jar of either apples or mixture of fruits and jar labeled with Apple can be jar of either apples or mixture of fruits but jar labeled with Apple can't be labeled with Apple so it has to be jar of Apple+Orange. ...
Comments
Post a Comment