Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Lets assume I have three boxes that contains only apples, only oranges and a mix of apples and oranges respectively and all of them are mislabelled . What is the minimum number of selections that I need to make so that I can be certain which box contains what fruits assuming I can pick one fruit at a time from any of the boxes ?

P.S: It is not a homework task . So don't put that tag in here . I was asked this in an interview. I was looking for a interview tag but couldn't find one .

share|cite|improve this question
up vote 6 down vote accepted

You can do it by picking one fruit from the box labelled Mixed.

Since the box labelled Mixed is mislabelled, it actually contains either all apples or all oranges, and you’ll know which as soon as you pick one fruit from it. Suppose that you pick an apple. (The other case is similar.) Then one of the remaining boxes contains only oranges, and the other is mixed. They bear the labels Apples and Oranges, and both are mislabelled, so the one labelled Oranges must contain mixed fruit, and the one labelled Apples must contain oranges.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.