34
$\begingroup$

You are playing a game in which you have $100$ jellybeans, $10$ of them are poisonous (You eat one, you die). Now you have to pick $10$ at random to eat.
Question: What is the probability of dying?

How I tried to solve it:

Each jellybean has a $\frac{1}{10}$ chance of being poisonous. Since you need to take $10$ of them, I multiply it by $10$ which gave $1$ (Guaranteed death).

How other people tried to solve it:

Each jellybean is picked out separately. The first jellybean has a $\frac{10}{100}$ chance of being poisonous, the second -- $\frac{10}{99}$, the third -- $\frac{10}{98}$ and so on.. which gives a sum of roughly $\sim 1.04$ (More than guaranteed death!)

Both these results make no sense since there are obviously multiple possibilities were you survive since there are $90$ jellybeans to pick out of.

Can someone explain this to me?

$\endgroup$
  • 15
    $\begingroup$ You've asked a question and shown what you have tried. That's pretty much all we ask. $\endgroup$ – Graham Kemp May 26 '16 at 22:57
  • $\begingroup$ It is a bit like the probability of two people sharing a birthday in the same room is over 50% with just 23 people. The chance of the opposite being true is very improbable as you move forward so the chance of being true is increasingly likely. Surviving 10 jellybeans is increasingly unlikely as you eat unpoisoned jellybeans. $\endgroup$ – Neil May 27 '16 at 7:59
  • 1
    $\begingroup$ Are you allowed to lick a jellybean before eating it? $\endgroup$ – Noctis Skytower May 27 '16 at 20:47
  • $\begingroup$ @NoctisSkytower If you're into that I suppose.. Not going to grant you much though. $\endgroup$ – Slava Knyazev May 27 '16 at 23:19
  • $\begingroup$ @GrahamKemp and yet the title is really vague and clickbaity. $\endgroup$ – John Dvorak May 28 '16 at 18:20
36
$\begingroup$

So you live if you do not choose a deadly jellybean :)
And we die if we select at least one deadly bean, so I think it goes as follows $$P(\text{Die}) = 1-P(\text{Live}) = 1-\frac{\binom{10}{0}\binom{90}{10}}{\binom{100}{10}}=0.6695237889.$$

In this case, we literally have good beans and bad beans, and we select without replacement. Then the number of bad beans selected follows a hypergeometric distribution. So for completeness, there are $\binom{10}{0}$ ways to choose a zero bad beans, $\binom{90}{10}$ ways to choose 10 good beans, and finally $\binom{100}{10}$ ways to choose 10 beans from the total.

Note: $\binom nk = \frac{n!}{k!(n-k)!}$, the binomial coefficient.

$\endgroup$
  • 3
    $\begingroup$ "there are $\binom{10}{0}$ ways to choose 10 good beans". To the beginner, it's not obvious why this term is necessary. If we change the problem slightly to "what's the probability of picking exactly 2 bad beans" (the answer for which would be $\frac{\binom{10}{2}\binom{90}{8}}{\binom{100}{10}}$), it becomes a little more obvious why that term is necessary. $\endgroup$ – Ben Thul May 28 '16 at 13:08
41
$\begingroup$

Both probablyme and carmichael561 have given a good approach to the problem, but I thought I'd point out why the solutions given by you and your classmates (?) are erroneous.

The problem common to both approaches is that they neglect the probability that you die from earlier jelly beans. You take the first jelly bean, and you have a $1/10$ probability of dying; that is all right. But although your classmates are almost right (and you are not) that the second jelly bean has a $10/99$ chance of killing you, that is only true if the first jelly bean didn't already kill you.

In other words, the probability that you are killed by the first jelly bean is $1/10$, and the probability that you survive to eat a second jelly bean and it kills you is $9/10 \times 10/99 = 1/11$. Each succeeding jelly bean does, in truth, have a higher probability of killing you if you survive to eat it, but the decreasing probability that you do in fact survive conspires to make its overall effect smaller, so the numbers do not add up to anywhere near $1$, complete certainty.

It is possible to continue along in a similar vein: You can add $1/10+1/11 = 21/110$ to obtain the probability that the first two jelly beans kill you; the remainder, $89/110$, is the probability that you survive to eat the third jelly bean, which kills you with probability $10/98$. Your probability of surviving the first two jelly beans only to be killed by the third is then $89/110 \times 10/98 = 89/1078$. You would then have to add up $1/10+1/11+89/1078$ to find the probability that the first three jelly beans kill you, etc.

I think you can see that the solutions provided by the other answerers are much more straightforward; this way of approaching the problem by considering its inverse is a common tactic when there are multiple ways to satisfy the conditions of the problem, but only one way to violate them.

$\endgroup$
  • 9
    $\begingroup$ Incidentally, one might reasonably point out that this explanation invokes a time dependency that might not exist in certain presentations; for instance, you might eat all ten jelly beans at once. In that case, the explanation is that the ten might include multiple jelly beans, and eating two or three or even more poisonous jelly beans doesn't kill you any more than eating one does. $\endgroup$ – Brian Tung May 26 '16 at 23:49
  • 1
    $\begingroup$ I was thinking of it as all at once, yes. Otherwise +1 for very helpful explanation. $\endgroup$ – Slava Knyazev May 26 '16 at 23:59
  • 2
    $\begingroup$ (Multiple poisonous jelly beans is what I meant, by the way. Sorry about the omission.) $\endgroup$ – Brian Tung May 27 '16 at 4:43
  • 2
    $\begingroup$ Very nice explanation, I like how you actually go into the "why" instead of just the "how". $\endgroup$ – jeremy radcliff May 27 '16 at 7:48
  • 1
    $\begingroup$ And thanks to @SlavaKnyazev too. Incidentally, your approach of adding the probabilities works perfectly well if you want to know the average number of poisoned jelly beans you eat. $\endgroup$ – Brian Tung May 27 '16 at 17:02
19
$\begingroup$

It's easier to find the complementary probability; i.e. the probability that all $10$ jellybeans are safe. There are ${90\choose 10}$ ways to choose $10$ safe jellybeans, and ${100\choose 10}$ to choose any $10$ jellybeans, so the probability that you survive is $$ \frac{{90\choose 10}}{{100\choose 10}}=\frac{90\cdot 89\cdots 81}{100\cdot 99\cdots 91}$$

The probability that you die is therefore $$ 1-\frac{90\cdot 89\cdots 81}{100\cdot 99\cdots 91}\approx 0.67$$

$\endgroup$
  • 3
    $\begingroup$ For further reading, what is the 90 above the 10 thing called? $\endgroup$ – Slava Knyazev May 26 '16 at 22:47
  • 3
    $\begingroup$ It's called a binomial coefficient. ${n\choose k}=\frac{n!}{k!(n-k)!}$ counts the number of ways to choose $k$ elements out of $n$. $\endgroup$ – carmichael561 May 26 '16 at 22:48
  • $\begingroup$ This approach does not need to use any binomial coefficients at all. Just multiplying the probabilities that you survive eating each of the successive beans gives you your survival chance (second term in final formula). $\endgroup$ – Marc van Leeuwen May 27 '16 at 5:09
  • $\begingroup$ @Marc van Leeuwen: true, though I don't think using binomial coefficients is any slower. $\endgroup$ – carmichael561 May 27 '16 at 5:16
  • $\begingroup$ For fun I computed the rational approximations to the probability of surviving: 1/3, 38/115, 39/118, 77/233, 270/817, 347/1050, 15191/45967, 61111/184918, 137413/415803, 198524/600721, 1328557/4020129, 1527081/4620850, 2855638/8640979, 7238357/21902808, 24570709/74349403, 80950484/244951017, 186471677/564251437, 1013308869/3066208202, 2213089415/6696667841, 3226398284/9762876043, 5439487699/16459543884, 14105373682/42681963811, 19544861381/59141507695, 92284819206/279247994591, 111829680587/338389502286, 204114499793/617637496877, 520058680173/1573664496040 $\endgroup$ – Anton Sherwood May 31 '16 at 19:06
7
$\begingroup$

The other answers are great, but with a slightly different approach from your attempt (I presume you edited in your attempts after some of the answers are posted). I'd like to point out some important things in your post:

"And" vs. "Or"

One fundamental flaw in both approaches is that you are adding probabilities instead of multiplying them.

When you are looking for either of a set of independent events, you can add their probabilities. For example, suppose that you roll a die. The probability for a 1 is 1/6, for a 2 is 1/6, etc. The probability that you roll an even number is the probability of either 2 or 4 or 6 so you can add the probability for these events: 1/6 + 1/6 + 1/6 = 1/2. This probably corresponds to you intuition: half of the possible outcomes are even.

Now suppose you throw a single die three times (or three dice at once). What is the probability that all rolls are even? We just saw that the probability for any of them to be even is 1/2. But if you try 1/2 + 1/2 + 1/2 = 3/2 > 1. Clearly this cannot be right. Indeed, what you are after is a combination of events: you want the first roll to be even and the second to be even and the third. What you need to do is multiply the probabilities: 1/2 * 1/2 * 1/2 = 1/8. You can check this by writing out all possible outcomes: let E denote even and O denote odd, then all possibilities for three dice rolls are

EEE                  - 1 with only evens
EEO, EOE, OEE,       - 3 with 2 evens, 1 odd
EOO, OEO, EOO        - 3 with 1 even, 2 odds
OOO                  - 1 with only odds

Do this systematically, and you will find 8 possible outcomes, of which only one is EEE -- 1/8.

With vs without replacement

There is a difference whether you pick with replacement or without replacement. Suppose you pick a marble from an urn with 5 white and 5 black marbles. Clearly the probability of drawing a white marble is 1/2. Now what is the probability that the next one will be white again? Well, this depends on what you do with the first one! If you put it back in the urn after you draw it, the probability that the second one is white is 1/2 again! But if you don't put it back, then you only have 4 out of 9 whites left, so the probability is 4/9 -- less than 1/2!

In your example with the jelly beans, you are eating them, so it is an experiment without replacement. Once you had a non-poisonous one (with probability 90/100), the chances that the next one also won't kill you are not 90/100 anymore, they are 89/99.

All possibilities or complement rule?

There are now two ways to arrive at your answer:

  1. Enumerate all the possibilities. You are asked for the probability of dying. There are a number of ways this can happen: either the first bean kills you, or (it doesn't and the second one kills you), or (the first two don't kill you but the third one does), or ....

Note how I emphasized "or" and "and"? Replace them by + and x as explained above, and you will get a long calculation:

P(first kills you) + P(first doesn't kill you) * P(second kills you) + P(first doesn't kill you) * P(second doesn't kill you) * P(third kills you) + ....

Plugging in the numbers, keeping in mind you are working without replacement, you get

10/100
  + 90/100 * 10/99
  + 90/100 * 89/99 * 10/98
  + ...
  1. Use the complement rule. Sometimes it is easier to calculate the probability of the event you are not interested in. You know that either the 10 beans kill you or they don't, so

    P(you die) + P(you live) = 1

hence

P(you die) = 1 - P(you live).

We have seen that P(you die) is a long calculation, but P(you live) is easier:

P(you live) = P(the first one doesn't kill you) 
                 * P(the second one doesn't kill you)
                 * P(the third one doesn't kill you)
                 * ...

Note that I used multiplication, convince yourself why (is there an implicit "and")?

Now I suggest you complete both calculations (1) and (2) and check that they give the same answer. It will be a lot of work but it will give you confidence that the basic rules I laid out work, and that there is not one right way.

$\endgroup$
  • 3
    $\begingroup$ Nice answer. Although...I think if they carry out calculations (1) and (2) for up to four jelly beans, that will be enough to confirm that they both yield the correct result. Doing it for ten seems like a lot of work for very little additional gain... $\endgroup$ – Brian Tung May 27 '16 at 17:04
  • 1
    $\begingroup$ Adding probabilities is the way if events are disjoint. Otherwise, you must use the inclusion-exclusion principle to compute the UNION of two events. That would probably cause neural network failure in this student. $\endgroup$ – richard1941 Jun 1 '16 at 4:34
0
$\begingroup$

This answer looks at population probabilities and uses an iterative procedure to find the probability of living. Calculation of permutations and combinations are not used.

// multiply the probability of being alive at the start (P=1)
// by the probability of picking a non fatal jelly bean from
// the remaining jellybean population 10 times.
//
// at each iteration the initial jelly bean population (100)
// and the non fatal jelly bean population (90) both reduce by 1:
//

var P = 1;
for( var n = 0; n < 10; n = n+1)
   P = P * (90-n)/(100-n);

// complement the probability of living to get P of dying:
P = 1 - P;

// display P to eight decimal places: 0.66952379

Basically posted to show calculating the result is not difficult.

$\endgroup$
0
$\begingroup$

The solutions mentioned above are absolutely correct but here is an alternative approach. We have to choose 10 balls, there are (100x99x98x97x96x95x94x93x92x91) ways to do that but if you have to choose the non-poisonous balls there are (90x89x88x87x86x85x84x83x82x81) ways to do that. Dividing the terms, you get the probability of living which comes out to be 0.33 thus probability of dying being close to 0.67

$\endgroup$
0
$\begingroup$

Another way to look at it, from the point of view of a dumb engineer who is not wise in mathematics is that a ballpark approximation to living is (1-1/10)^10. This looks a lot like 1/e. So a crude guess of the probability of dying might be 1-1/e = 0.632. Yeah, that's sorta in the ballpark.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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