# Finding the minimum number of selections .

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 .

-

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.

-