Jump to content
BrainDen.com - Brain Teasers
  • 0


Guest
 Share

Question

I have 100 candies in a jar. 90 are lemon and 10 are mint. every day I take a candy out. If it is lemon, I eat it, but if it is mint, I put it back and take out another candy. If the new candy is also mint, then I eat it. What is the probability that the last candy I eat is a mint?

Link to comment
Share on other sites

19 answers to this question

Recommended Posts

  • 0

The probability is 56/61.

Wow, that's ridiculously close. did you write a computer program to solve this and then estimated the fraction? you are less than .001 away from the exact answer. After spending a little time solving it with pencil and paper, I wrote a python program that gives you the exact fraction. I think if you adapted your program to do the same, you would come up with the exact answer. (this, of course, is assuming that you used a computer program)

Link to comment
Share on other sites

  • 0

a small bug fixed gives 45/49. But, then again, there still may be other bugs.

Wow, that's ridiculously close. did you write a computer program to solve this and then estimated the fraction? you are less than .001 away from the exact answer. After spending a little time solving it with pencil and paper, I wrote a python program that gives you the exact fraction. I think if you adapted your program to do the same, you would come up with the exact answer. (this, of course, is assuming that you used a computer program)

Link to comment
Share on other sites

  • 0

Probability of eating the mint candy = probability of drawing 2 consecutive mint candies = 90c2 / 100c2 = 90*89 / 100*99 = 89/110

Probability of eating a lemon candy = probability of drawing a lemon candy = 1/10

Probability of last candy eaten being mint = P(M) / [P(M) + P(L)] = 89/100

Link to comment
Share on other sites

  • 0

Excellent job k-man. That's right.

first of all, if you are using a recursive algorithm, you can stop when there are zero of either candy.

I don't want to give it away completely, but consider the probability to be f(a,b) where a is the number of lemon candies and b is the number of mints. Then try to find how to define the function mathematically. It will probably help to use your computer program to list the first couple values. I originally solved it by having my program return all the values for f(a,b)for all a and b <=100. The pattern, however, became clear after examining only a few. From there it is not hard to work out the reasoning

Link to comment
Share on other sites

  • 0

Excellent job k-man. That's right.

first of all, if you are using a recursive algorithm, you can stop when there are zero of either candy.

I don't want to give it away completely, but consider the probability to be f(a,b) where a is the number of lemon candies and b is the number of mints. Then try to find how to define the function mathematically. It will probably help to use your computer program to list the first couple values. I originally solved it by having my program return all the values for f(a,b)for all a and b <=100. The pattern, however, became clear after examining only a few. From there it is not hard to work out the reasoning

"first of all, if you are using a recursive algorithm, you can stop when there are zero of either candy."

Surely this can't be true. What if I stopped at 90 lemons and 0 mints? In any case, you answered my

question: you had no *aha!* solution -- you were able to get a closed form for f(a,b).

Link to comment
Share on other sites

  • 0

Interesting puzzle. B))

It's very hard to eat the last mint.

The number of lemons must be very small.

Say there are even 3 lemons left and 1 mint.

.

  1. Chances of eating the mint next [assuming you've just eaten a lemon] are 1/16.
    So probably you eat another lemon
    .
  2. Chances of eating a mint next are still only 1/9.
    So you probably eat another lemon. Now there's 1 of each.
    .
  3. Still your chances of eating the mint next is just 1/4.
    .
So even with an overwhelming preponderance of lemons initially, the mints hang around until the end.

Especially that last one.

Link to comment
Share on other sites

  • 0

This is a rich problem with all kinds of interesting variations like:

I have N+10 candies in a jar. N are lemon and 10 are mint. Every day I take a candy out.

If it is lemon, I eat it, but if it is mint, I put it back and take out another candy.

If the new candy is also mint, then I eat it. As N approaches infinity, what is the

probability that the last candy I eat is a mint?

10/11

Edited by superprismatic
Link to comment
Share on other sites

  • 0

"first of all, if you are using a recursive algorithm, you can stop when there are zero of either candy."

Surely this can't be true. What if I stopped at 90 lemons and 0 mints? In any case, you answered my

question: you had no *aha!* solution -- you were able to get a closed form for f(a,b).

I considered it a success if there were 0 lemons left and a failure if there were 0 mints left.

Link to comment
Share on other sites

  • 0

I considered it a success if there were 0 lemons left and a failure if there were 0 mints left.

We may be talking at cross purposes. What I meant to point out is that there are many

ways to succeed or fail. In order to find the probability of success or failure one

needs to compute something equivalent to the sum of probabilities of all possible

paths leading to either failure or success. From what you have said, you must have done

this analytically. I just directly summed the probabilities of all the paths to success.

Anyway, thanks for the nice problem. I really would like to see an explanation of your

analytic method. I can't seem to come up with one. But we agree on the solution!

Link to comment
Share on other sites

  • 0

Interesting puzzle. B))

It's very hard to eat the last mint.

The number of lemons must be very small.

Say there are even 3 lemons left and 1 mint.

.

  1. Chances of eating the mint next [assuming you've just eaten a lemon] are 1/16.
    So probably you eat another lemon
    .
  2. Chances of eating a mint next are still only 1/9.
    So you probably eat another lemon. Now there's 1 of each.
    .
  3. Still your chances of eating the mint next is just 1/4.
    .
So even with an overwhelming preponderance of lemons initially, the mints hang around until the end.

Especially that last one.

Bonanova - you made it much easier for me to think about when you proposed only 1 mint being in the bowl.

If you start with only 1 mint then the probability of eating a mint last is the same probability that you eat a lemon every time until they're gone. For 3 lemons it's 15/16*8/9*3/4 =.625 or 5/8.

But say you start with N lemons and 1 mint. As N approaches infinity, what is the probability that the last one you eat is a mint?

I think it would be 1/2. But I don't know why. I just noticed it got closer and closer to .5 as I upped the number of lemons. [3/4*8/9*15/16*24/25*...*(N2-1)/N2]

It does lend itself to a pattern though. I'm guessing for N lemons and M mints, the odds of the last being a mint as N approaches infinity would be M/(M+1). But why?

Link to comment
Share on other sites

  • 0

Bonanova - you made it much easier for me to think about when you proposed only 1 mint being in the bowl.

If you start with only 1 mint then the probability of eating a mint last is the same probability that you eat a lemon every time until they're gone. For 3 lemons it's 15/16*8/9*3/4 =.625 or 5/8.

But say you start with N lemons and 1 mint. As N approaches infinity, what is the probability that the last one you eat is a mint?

I think it would be 1/2. But I don't know why. I just noticed it got closer and closer to .5 as I upped the number of lemons. [3/4*8/9*15/16*24/25*...*(N2-1)/N2]

It does lend itself to a pattern though. I'm guessing for N lemons and M mints, the odds of the last being a mint as N approaches infinity would be M/(M+1). But why?

you are right that the probability becomes one half and here is why:

the product from N=2 to infinity of (N2-1)/N2) is equal to:

e raised to the power of the sum from N=2 to infinity of ln(N+1)+ln(N-1)-2ln(N). This can be shown to be a telescoping sum with a value of -ln(2). finally, e-ln(2)=1/2.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...