14
$\begingroup$

Olivia loves cookies so much that Dad promises to buy her two cookie jars on one condition: that she only eats one cookie per day.

Olivia agrees, and now two black, large cookie jars rest on the kitchen table. The jars are completely opaque, but on the label it says very clearly: each jar contains exactly 100 cookies.

So every morning Olivia wakes up, randomly selects one of the cookie jars, opens it and takes one cookie. Yum. Nobody else in the house eats cookies, so she's in for a long time treat.

After some time though, the inevitable happens: when Olivia opens the randomly selected jar that morning, she finds that the jar is empty. Quickly she glances worried to the other jar and the question pops into her mind:

What is the probability that the other jar is also empty?

EDIT: For clarification, Olivia does not realise that a jar is empty when taking the last cookie from it.

$\endgroup$
2
  • $\begingroup$ I believe the answer will be around rot13(svir cbvag gjb bar frira creprag) but I'm having trouble proving it $\endgroup$
    – SteveV
    Dec 2, 2018 at 16:01
  • $\begingroup$ This is the restatement of Banach matchbox problem, en.wikipedia.org/wiki/Banach%27s_matchbox_problem $\endgroup$
    – Roah
    Dec 2, 2018 at 21:31

5 Answers 5

11
$\begingroup$

There is a

5.63%

chance that the other jar is empty. This puzzle is asking the equivalent of

What is the probability of getting exactly 100 heads and 100 tails when flipping a fair coin 200 times?

which can be calculated by

$0.5^{100}\times(1-0.5)^{(200-100)}\times\binom{200}{100} = 0.0563 =$ 5.63%

$\endgroup$
4
  • $\begingroup$ This should be it. I left out the fact that it doesnt matter which jar Olivia chooses at the 201th pick. $\endgroup$
    – Kryesec
    Dec 2, 2018 at 15:27
  • $\begingroup$ Hi and welcome to Puzzling.SE! Nice answer. However when I run simulations, it comes out a different answer, so I wonder if they are exactly equivalent. $\endgroup$
    – SteveV
    Dec 2, 2018 at 15:31
  • 4
    $\begingroup$ @Kryesec I think the discrepancy comes from the fact that you are assuming that there are always 200 attempts. But this is not true. There could be fewer attempts if there is a failure and these have to be removed from the probability you calculated $\endgroup$
    – SteveV
    Dec 2, 2018 at 15:46
  • $\begingroup$ @SteveV: When I run a simulation it does give me this answer. $\endgroup$ Dec 3, 2018 at 7:07
4
$\begingroup$

Is it

zero

because this is the first time she's found a jar to be empty, so

the other jar has never been empty

$\endgroup$
7
  • $\begingroup$ hello! This was my first thought too for a straightforward answer. But I was thinking that the discovery that it is empty is actually on the 101th reach into the jar. Nevertheless, this is the most logical solution in normal situation (: $\endgroup$
    – Kryesec
    Dec 2, 2018 at 9:54
  • 1
    $\begingroup$ Hm. This is probably close, but rot13(vfa'g gurer n fznyy punapr gung fur'f ba qnl gjb uhaqerq, jura obgu wnef ner rzcgl naq fur unf nyjnlf pubfra n aba-rzcgl bar orsber)? $\endgroup$
    – M Oehm
    Dec 2, 2018 at 9:55
  • 1
    $\begingroup$ @Kryesec: Not necessarily. That discovery could be on any day between 101 and 200. $\endgroup$
    – M Oehm
    Dec 2, 2018 at 9:56
  • 1
    $\begingroup$ @MOehm agreed, but I was referring to the 101th reach into the jar in question (meaning that Olivia doesnt know that she is emptying the jar when she takes the last cookie) $\endgroup$
    – Kryesec
    Dec 2, 2018 at 9:57
  • 1
    $\begingroup$ Oh, I see, the 101st time she reaches into that particular jar. I mistook "reach into the jar" for "reach into a jar". $\endgroup$
    – M Oehm
    Dec 2, 2018 at 10:01
2
$\begingroup$

The probability is

(Edit: kudos to @SHaze for noting the prior mistake I had on 201th run) 5.63%

Some basic assumptions:

1. Assuming that this is the first occurrence which is discovered that the jar is empty (Noting that this is the 101th time Olivia reach into the jar, discovered that there is 0 cookies inside)
2. This is a simple scenario of comparing 2 binomial distributions:



i.e. A - Number of times Olivia select Jar A ; &
B - Number of times Olivia select Jar B

Therefore:

This problem is a
$P(A=101 OR B=101|B=100) =(0.5+0.5) * \binom{200}{100}0.5^{100}(1-0.5)^{200-100} $ = 5.63%

$\endgroup$
3
  • $\begingroup$ All I can say right now is that the answer is wrong... $\endgroup$ Dec 2, 2018 at 12:13
  • $\begingroup$ @BogdanAlexandru looks like back to the drawing board it is .__. $\endgroup$
    – Kryesec
    Dec 2, 2018 at 15:15
  • $\begingroup$ Better :) just a factor of two was missing. $\endgroup$ Dec 3, 2018 at 8:05
1
$\begingroup$

The problem means that when she took 100 of one jar she must not take from this jar until she has also taken 100 from the other jar.

So the problem is equivalent to

ending in the middle bin of a Galton Board with 200 rows. When you take 1 of one kind too much, you can't end in the middle bin of the last row anymore.

The probability therefor is:

$\binom{n}{k}\times p^{k} \times (1-p)^{n-k}$ Source Wikipedia

In our case:

$\binom{200}{100} \times 0.5^{100} \times (1-0.5)^{200-100}$

So the result is

$0.056348...$ or $5.63%$

$\endgroup$
1
  • 1
    $\begingroup$ Hello, I've rendered your LaTeX properly and trimmed the decimal in the answer. $\endgroup$
    – Quintec
    Dec 2, 2018 at 22:42
-1
$\begingroup$

I think the probability that the second jar is also empty is:

50%

Because:

Some other answers liken this problem to "the probability of getting exactly 100 heads and 100 tails when flipping a fair coin 200 times", and that might be the case if the question were "What are the chances of Olivia taking exactly 100 cookies from each jar over 200 days". But that isn't the question - the question is entirely about one of the cookie jars after we know the other is already empty.

Olivia has been "randomly" selecting a cookie jar each morning. If it were truly random, say for example she did toss a coin to decide which one to pick, then each day, the probability of Jar A or Jar B being selected would be 50% on any given day. Sure, the probability of the coin toss landing the same every day over a given period of time would be calculable, but on any individual day the probability in isolation is 50%. Olivia's own method of selection is probably far less random. If she made a "conscious" random selection she may have been very close to precise alternation between the two cookie jars and the number of remaining cookies in the other jar would probably be quite close to 1 or 0; whereas if it was entirely without thought she will almost certainly have subconsciously favoured one of the jars. In the latter case, her 'favoured' jar would be empty first and the other almost certainly contains some cookies, but I do not believe that number would be calculable.

One jar is now confirmed as empty. The question is, does the other jar have any cookies in, or not? It may have none - or any other number of cookies. It's 50-50.

I haven't approached this as a mathematics problem. Humans have been shown to randomly select numbers evenly across a range. With a choice of only two jars, the odds would be on Olivia alternating between them fairly evenly.

$\endgroup$
6
  • $\begingroup$ I'm either going to win the lottery or not. So that's a 50-50 chance. $\endgroup$
    – Kruga
    Dec 3, 2018 at 9:04
  • $\begingroup$ @Kruga Not the same, because millions of other people are playing too AND you have to win on a sequence of numbers. If the lottery involved you and two numbers, yes it would be. $\endgroup$
    – Astralbee
    Dec 3, 2018 at 9:10
  • $\begingroup$ It just sounds like that's the kind logic you are using. $\endgroup$
    – Kruga
    Dec 3, 2018 at 10:04
  • $\begingroup$ @Kruga Then I would have to say that you haven't read and understood my first paragraph correctly. I haven't used the logic for calculating a sequence of events because that is not the question. Why not make an answer yourself using the logic you believe to be correct? $\endgroup$
    – Astralbee
    Dec 3, 2018 at 10:11
  • $\begingroup$ @astralbee But with your example there is the possibility that there is none, or there is some. But there could be 1 cookie left, 2 cookies left... until 100 cookies left. this all have the exact same probability as there being 0 cookies left. $\endgroup$ Dec 3, 2018 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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