Fabio's Can Dilemma

Chef Fabio went to the store and bought 2 cans of beans, 2 cans of tomatoes, and 2 cans of tuna, all of which were the same shape and size. On his way home, it rained hard and the labels became soaked and fell off the cans. He wants to make a dish using one can of each type, and begins to open the cans one at a time. The expected number of cans he will have to open to get one can of each type can be expressed as a b \frac{a}{b} , where a a and b b are coprime positive integers. What is the value of a + b a + b ?


The answer is 24.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

8 solutions

Eric Xu
May 20, 2014

Note that he must open at least three cans and at most five cans to guarantee that he has one of each type. We first calculate the probability that he must open n n cans to get one of each type, where n = 3 , 4 , 5 n=3,4,5 .

We can assume that the two cans of beans are distinct, the two cans of tomatoes are distinct, and the two cans of tuna are distinct because we are calculating probabilities and the overcounting is canceled out. Let A , B , C A,B,C denote the three types of cans.

If n = 3 n=3 , he must open A , B , C A,B,C in some order. There are 3 ! 3! ways for the ordering, and 2 3 2^3 ways to pick which can of each type. There are 6 5 4 6*5*4 ways total to open three cans, so the probability is 3 ! 2 3 6 5 4 = 2 5 \frac{3!*2^3}{6*5*4}=\frac{2}{5} .

If n = 4 n=4 , he opens two cans of one type, and one can for each of the other two types. Also, the second can of one type he opens cannot be the last can he opens. WLOG, let type A A be opened twice, so we must have A A B C AABC or A A C B AACB , where the first three letters can be permutated. There are 2 3 ! 2*3! ways to determine the order, 3 3 ways to choose which can will appear twice, and 2 2 2^2 ways to choose the specific cans for the types that appear once. Since there are 6 5 4 3 6*5*4*3 ways to choose four cans total, the probability is 2 3 ! 3 2 2 6 5 4 3 = 2 5 \frac{2*3!*3*2^2}{6*5*4*3}=\frac{2}{5} .

For n = 5 n=5 , two types must appear twice. WLOG, let A , B A,B be the types that appear twice. Then we must have the ordering A A B B C AABBC , where the first four letters can be permutated (the last type must be opened last). There are 3 3 ways to choose which type does not appear twice, 4 ! 4! ways to order the opening of the cans, and 2 2 ways to choose which can of type C C is opened. There are 6 5 4 3 2 6*5*4*3*2 ways to open 5 5 cans, so the probability is 3 4 ! 2 6 5 4 3 2 = 1 5 \frac{3*4!*2}{6*5*4*3*2}=\frac{1}{5} .

It follows that the expected value is 2 5 3 + 2 5 4 + 1 5 5 = 19 5 , \frac{2}{5}*3+\frac{2}{5}*4+\frac{1}{5}*5=\frac{19}{5}, so the answer is 24 \boxed{24} .

Since we only have 3 event, we know that P ( n = 3 ) + P ( n = 4 ) + P ( n = 5 ) = 1 P (n=3) + P(n=4) + P(n=5) = 1 . This allows us to save on calculating the probability of 1 event. We can approach P ( n = 4 ) = 1 P ( n = 3 ) P ( n = 5 ) P(n=4) = 1 - P(n=3) - P(n=5) , since the other 2 values are easily calculated.

Calvin Lin Staff - 7 years ago
Karan Theron
May 20, 2014

Three different cases are possible:-

i) When Fabio gets one can of each by opening just three cans ABCABC, both ABC can be permuted in 3! ways, so 3!*3! = 36 ways

ii) When Fabio get one can of each by opening exactly 4 cans. Then last two cans should be of different type and 3rd last can should be same as one of last two cans. Now first three can be permuted in 3 ways So, no of ways = 3 2 2*3 = 36 ways

iii) When Fabio gets one can of each only by opening 5 cans. Then last two cans should be of same type and first 4 cans can be permuted in 4!/(2!2!) = 6 ways So, 3*6 = 18 ways

Expected no of cans to be open = 3(36/90) + 4(36/90) + 5(18/90) = 19/5

Muhammad Al Kahfi
May 20, 2014

It's easy to see that, the can that should fabio open are between 3 and 5 (include). Because, if fabio open 1 1 or 2 2 can, it's impossible to get can that at least one can each type, as we know that, there are 3 3 type of can. And, if we open 6 6 can, definitely when he open the 5 5 ^th can, he had open at least one can each type.

So, Assume that, for the easiest writing, the type of can is A A , B B , and C C . Where A , B , C A, B, C can be permutated each other (then, we should multiple them by 3 ! = 6 3! = 6 ) for this case :

Case 1 : We only open 3 3 can ABC, so the probability is 3 ! ( 2 6 . 2 5 . 2 4 ) = 2 5 3! (\frac{2}{6}. \frac{2}{5}. \frac{2}{4}) = \frac{2}{5}

Case 2 : We only open 4 4 can. The possibilities are A A B C , A B B C , A B A C AABC, ABBC, ABAC , so the probability are : 3 ( 6 ) ( 2.2.2.1 6.5.4.3 ) = 2 5 3( 6) (\frac{2. 2. 2. 1}{6. 5. 4. 3} ) = \frac{2}{5}

Case 3 : We only open 5 5 can. The possibilities are A A B B C , A B B A C , A B A B C AABBC, ABBAC, ABABC , so the probability are : 3 ( 6 ) ( 2.2.2.1.1 6.5.4.3.2 ) = 1 5 3( 6) (\frac{2. 2. 2. 1. 1}{6. 5. 4. 3. 2} ) = \frac{1}{5}

Then, the ecpectation number can that he should open is :

3 ( 2 5 ) + 4 ( 2 5 ) + 5 ( 1 5 ) = 19 5 3 ( \frac{2}{5}) + 4( \frac{2}{5}) + 5 (\frac{1}{5}) = \frac{19}{5} ,

then, a + b = 19 + 5 = 24 a + b = 19 + 5 = \boxed{24}

Andy Hayes
May 20, 2014

Fabio picks cans one at a time, and when he opens them, he sees which type the can is. He needs to open one can of each type, and he will stop opening them if he gets all three. If he opens two cans of the same type, then the second one doesn't matter. (Hopefully he'll store it away in the fridge to use later.)

The process that I solved this involves calculating the probability of mutually exclusive events:

  1. Fabio gets the third type of can on the third pick
  2. Fabio gets the third type of can on the fourth pick
  3. Fabio gets the third type of can on the fifth pick

He won't need to pick 6 times, because he is guaranteed to get the third type on the fifth pick if he had not already.

The minimum number of cans he needs to open is 3. If he gets lucky, then he will get a different can each time, and he won't need to open any more. Disregarding the order in which he picks the cans, there are 2 cans of each type, so the number of different ways he can pick 3 different cans is 2 × 2 × 2 = 8 2 \times 2 \times 2 = 8 . The order in which he picks does matter, so the number of different permutations of each of these ways is 3 × 2 × 1 = 6 3 \times 2 \times 1 = 6 .

Thus, the number of ways he can get all three cans on the first three tries is 8 × 6 = 48 8 \times 6 = 48 .

There are 6 cans, so the total number of ways he can pick three cans is 6 × 5 × 4 = 120 6 \times 5 \times 4 = 120 .

Thus, the probability that he will get all three different types of cans on the first three tries is 48 120 \frac {48}{120} , or 2 5 \frac {2}{5} .

It's possible for Fabio to open 4 cans before he gets the 3 different types. To do this, he needs to open 2 cans of the same type and another can of a different type before he opens the fourth can of the third type.

Let's first calculate the number of ways he can open beans and tomatoes before he opens tuna. There are 4 cans that are either beans or tomatoes and he needs to pick 3 of them, so the number of different ways he can pick 3 cans of beans or tomatoes is 4 × 3 × 2 = 24 4 \times 3 \times 2 = 24 . He will then pick a can of tuna, of which there are 2, so the number of ways he can open beans and tomatoes before he opens tuna is 24 × 2 = 48 24 \times 2 = 48 .

There are 3 different ways he could pick 3 cans of 2 types before he picks a 4th can of the third type:

  1. beans and tomatoes then tuna
  2. beans and tuna then tomatoes
  3. tomatoes and tuna then beans

Thus, the total number of ways he could get the third type of can on the 4th pick is 48 × 3 = 144 48 \times 3 = 144

Now, the total number of ways he can pick 4 cans is 6 × 5 × 4 × 3 = 360 6 \times 5 \times 4 \times 3 = 360 .

Thus, the probability that he will get the third type of can on the fourth pick is 144 360 \frac {144}{360} , or 2 5 \frac {2}{5} .

If he had not received the third type of can by the fourth pick, then he is certain to get the third type of can on the fifth pick. Thus, the probability that he gets the third type of can on the fifth pick is 1 2 5 2 5 = 1 5 1 - \frac {2}{5} - \frac {2}{5} = \frac {1}{5} .

To calculate the expected value for the number of picks, we calculate the sum of the products of the number of picks and their respective probabilities:

3 ( 2 5 ) + 4 ( 2 5 ) + 5 ( 1 5 ) = 19 5 3(\frac {2}{5}) + 4(\frac {2}{5}) + 5(\frac {1}{5}) = \frac {19}{5}

Thus, a = 19 a = 19 and b = 5 b = 5 , and a + b = 24 a + b = 24

Victor Chaves
May 20, 2014

There are only 3 possible cases for us to see:

  1. Fabio need to take 3 cans
  2. Fabio need to take 4 cans
  3. Fabio need to take 5 cans (certainly will get one of each type, by the Pigenhole Principle)

In the first case, the probability of success (taking one of each type) is:

(choose a type) * (take that type) * (choose another type) * (take this type) * (choose last type) * (take last type)

In numbers, we have: 3 * (2/6) * 2 * (2/5) * 1 * (2/4) = 2/5

In the second case, Fabio will get one type twice. There are tree ways: AABC , ABAC, BAAC

AABC:

(choose a type) * (take that type) * (take that type again) * (choose another type) * (take this type) * (choose last type) * (take last type) In numbers: 3 * (2/6) * (1/5) * 2 * (2/4) * 1 * (2/3) = (2/15)

BAAC:

(choose a type) * (take that type) * (choose another type) * (take this type) * (take this type again) * (choose last type) * (take last type) In numbers: 3 * (2/6) * 2 * (2/5) * (1/4) * (2/3) = (2/15)

ABAC:

(choose a type) * (take that type)* (choose another type) * (take this type) * (choose last type) * (take first type again) * (take last type) In numbers: 3 * (2/6) * 2 * (2/5) * (1/4) * (2/3) = (2/15)

Total: 6/15 = 2/5

In the last case, there also 3 ways: AABBC, ABABC, ABBAC:

AABBC:

(choose a type) * (take that type) * (take that type again) * (choose another type) * (take this type) * (take this type again) * (choose last type) * (take last type)

In numbers: 3 * (2/6) * (1/5) * 2 * (2/4) * (1/3) * (2/2) = (1/15)

ABBAC:

(choose a type) * (take that type) * (choose another type) * (take this type) * (take this type again) * (take first type) * (choose last type) * (take last type)

In numbers: 3 * (2/6) * 2 * (2/5) * (1/4) * (1/3) * (2/2) = (1/15)

ABABC:

(choose a type) * (take that type) * (choose another type) * (take this type) * (take first type again) * (take second type again) * (choose last type) * (take last type)

In numbers: 3 * (2/6) * 2 * (2/5) * (1/4) * (1/3) * (2/2) = (1/15)

Total: 3/15 = 1/5

Now, the Expected Value is: 3 (2/5) + 4 (2/5) + 5*(1/5) = 19/5

19 + 5 = 24

Shobhit Gautam
May 20, 2014

An expectation value is given by the sum of the products of all possible random variables and their probabilities, i.e. summation x*px

Here our random variable is the number of cans he opens before he has one of each kind. The possible values are 3, 4 and 5. If it's less than 3, he cannot have all kinds because there are 3 kinds of cans. Pidgeon-hole-principle-type logic demands that 5 cans must contain at least one of each type.

Now, the probability of getting it in 3 cans is : P(1st can beans) x P(2nd can tuna) x P(3rd can tomatoes) = 2/6 x 2/5 x 2/4. If we include the 6 possible permutations, we have 6 x 2/6 x 2/5 x 2/4 = 2/5.

The probability of getting it in 4 cans is : P(1st can beans) x P(2nd can tuna) x P(3rd can tuna) x P(4th can tomatoes). Here, keep the following in mind : one of the three is repeated. The repeated type cannot be the last can (otherwise the first three cans would satisfy one-of-each-kind property). Thus, the probability is 3(choice of repeated can) x 6(permutations given repeated cannot be last) x 2/6 x 1/5 x 2/4 x 2/3 = 2/5

The probability of getting 5 cans is P(1st can beans) x P(2nd can tuna) x P(3rd can tuna) x P(4th can beans) x P(5th can tomatoes). Keep in mind : There is only one non-repeated can. The non-repeated can must come last. Thus, the probability is 3(choice of non-repeated can) x 6(permutations with non-repeated can last) x 2/6 x 1/5 x 2/4 x 1/3 = 1/5 expectation= 3 2/5+4 2/5+5*1/5 = 19/5. hence, a+b =24

Calvin Lin Staff
May 13, 2014

Notice that if Fabio opens 5 cans he will have to have opened at least one of each type, and if he opens 2 cans, he clearly cannot have opened one of each. Thus, he will either open 3, 4, or 5 cans. We count the probability that each case will occur. If he only needs to open 3 cans, then the first can can be anything. The probability that the second can is different is 4 5 \frac{4}{5} and the probability that the third can is also different is 2 4 \frac{2}{4} , so the probability that the first 3 cans are different is 2 5 \frac{2}{5} . If he needs to open 5 cans, then there will be one can which is not opened, which would have to be the same type as the 5th can that he opened. This occurs with probability 1 5 \frac{1}{5} . Since there are only 3 possibilities, the probability that he opens 4 cans is 1 2 5 1 5 = 2 5 1 - \frac{2}{5} - \frac{1}{5} = \frac{2}{5} . Thus, the expected number of cans he opens is 2 5 ( 3 ) + 2 5 ( 4 ) + 1 5 ( 5 ) = 19 5 \frac{2}{5}(3) + \frac{2}{5}(4) + \frac{1}{5}(5) = \frac{19}{5} . So a + b = 19 + 5 = 24 a + b = 19 + 5 = 24 .

Hadia Qadir
Sep 7, 2015

An expectation value is given by the sum of the products of all possible random variables and their probabilities, i.e. summation x px Here our random variable is the number of cans he opens before he has one of each kind. The possible values are 3, 4 and 5. If it's less than 3, he cannot have all kinds because there are 3 kinds of cans. Pidgeon-hole-principle-type logic demands that 5 cans must contain at least one of each type. Now, the probability of getting it in 3 cans is : P(1st can beans) x P(2nd can tuna) x P(3rd can tomatoes) = 2/6 x 2/5 x 2/4. If we include the 6 possible permutations, we have 6 x 2/6 x 2/5 x 2/4 = 2/5. The probability of getting it in 4 cans is : P(1st can beans) x P(2nd can tuna) x P(3rd can tuna) x P(4th can tomatoes). Here, keep the following in mind : one of the three is repeated. The repeated type cannot be the last can (otherwise the first three cans would satisfy one-of-each-kind property). Thus, the probability is 3(choice of repeated can) x 6(permutations given repeated cannot be last) x 2/6 x 1/5 x 2/4 x 2/3 = 2/5 The probability of getting 5 cans is P(1st can beans) x P(2nd can tuna) x P(3rd can tuna) x P(4th can beans) x P(5th can tomatoes). Keep in mind : There is only one non-repeated can. The non-repeated can must come last. Thus, the probability is 3(choice of non-repeated can) x 6(permutations with non-repeated can last) x 2/6 x 1/5 x 2/4 x 1/3 = 1/5 expectation= 32/5+42/5+5 1/5 = 19/5. hence, a+b =24

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...