Tuesday, August 22, 2017

logical deduction - A modified version of apples and oranges logic


Question: You have 3 baskets, one with apples, one with oranges and one with both apples and oranges mixed. Each basket is closed and is labeled with ‘Apples’, ‘Oranges’ and ‘Apples and Oranges’. However, each of these labels is always placed incorrectly. How would you pick only one fruit from a basket to place the labels correctly on all the baskets? This happens to be usually the basic version of the problem Modification: What if no basket is labelled can we still label all the baskets. And if so how?


Analysis: Well its easy to label one of the 3 baskets as apples or oranges after 3 picks one each from one basket. But now we have a dilemma how to chose which is the random basket and which is the specific one(apples or oranges) from the two remaining baskets. And in the worst case all our picks will result in the same output. So I was wondering if there is any way we could label them and if not the worst case can we at least get a relation based on the distribution and probability of the apples and oranges in the random basket.



Answer



Well, as you have said, there is a risk to pick always the same fruit from the "apples and oranges" basket. So there is no certain answer, except if you pick all fruits from one basket.


If you pick one fruit from each basket, you must have one of one fruit and 2 of the other. Let's say you pick 1 apple and 2 oranges. The apple comes from the "apples only" basket. You cannot identify the 2 remaining baskets where you picked an orange.


We need to do some assumptions. We can safely assume that the mixed basket is either of the unidentified baskets with equal probability. But what is the distribution of the quantity of each fruit in the mixed basket? I will assume the mixed basket contains N fruits, each of them having equal probability to be an orange or an apple. Then it is simple. If at any time you pick an apple from the 2 remaining baskets, you have found the mixed basket and you can identify all baskets. If not, the more oranges you pick from a basket the more unlikely it is that it is the mixed basket. If you pick $a$ oranges from basket A and $b$ oranges from basket b, the probability that A is the mixed basket is ${1/2^a\over 1/2^a + 1/2^b} = {2^b\over 2^a+2^b}$ .



But the distribution can be different. If for instance the mixed basket contains an equal number of oranges and apples, then the exact probability will depend on how many fruits there were to begin with.


But regardless of the distribution, the rule still holds that the more of the same fruit you pick from a basket, the more unlikely it is to be the mixed basket.


No comments:

Post a Comment

classical mechanics - Moment of a force about a given axis (Torque) - Scalar or vectorial?

I am studying Statics and saw that: The moment of a force about a given axis (or Torque) is defined by the equation: $M_X = (\vec r \times \...