Suppose the Cookie Monster has two (distinguishable) jars of cookies, each of which initially contains cookies. The Monster then starts to eat the cookies one at a time such that each time he takes a cookie from a jar chosen uniformly at random.
Now the Cookie Monster never looks into the jars, so he never knows how many cookies are left in either jar until he reaches in to one and finds that that jar is empty. When he first discovers that one of the jars is in fact empty, the probability that there are (strictly) fewer than cookies in the other jar is
Find .
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.
In general, let there initially be n cookies in each jar. We want to find the probability that, after the Monster discovers that one of the jars is empty, there are k cookies left in the other jar, where k can be any value from 0 to n . (Note that it could be the case that he has taken the last cookie from each jar, so that when he next reaches into either one of the jars he find that jar to be empty, but in fact both are empty, i.e., k can equal 0 .)
Now this "event" can happen in one of two ways;
(i) for the first 2 n − k cookies taken (and consumed) the Monster has reached into one jar, call it jar A , n times and into the other jar, call it jar B , n − k times. For the ( 2 n − k + 1 ) th cookie he reaches into jar A , only to find no cookies;
(ii) same as (i) except for the roles of jars A and B being reversed.
Both scenarios then have a probability of ( n 2 n − k ) ∗ 2 2 n − k 1 ∗ 2 1 of happening, and so the probability P ( k ) that the "other" jar has k cookies left in it is
P ( k ) = ( n 2 n − k ) ∗ 2 2 n − k 1 .
So with n = 2 0 and k = 0 , 1 , 2 we have that
S = k = 0 ∑ 2 ( 2 0 4 0 − k ) ∗ 2 4 0 − k 1 = 0 . 3 7 2 8 9 7 4 2 9 . . . . ,
and so ⌊ 1 0 0 0 ∗ S ⌋ = 3 7 2 .