P4344 link reply
elchanan-juggle.jpg
Elchanan first presented a certain puzzle to his probability class a couple of years ago, when he was giving examples of conditional expectation computation. On the spot, he came up with a problem and derived the solution. “Then I looked at it and asked if it made sense. It did not, as my intuition very strongly warned me that the answer I derived was off. It took me some time to recover and figure out why my intuition was wrong.” And the answer has stumped many since it was presented on Gil Kalai’s blog “Combinatorics and More.” “I am somewhat surprised that it got so popular,” Elchanan added.

Test your intuition:

You roll a die until you get 6. What is the expected number of rolls (including the roll giving 6) conditioned on the event that all rolls gave even numbers?

The expected number of throws:

a. 1 b. 3/2 c. 2 d. 5/2 e. 3 f. 7/2 g. 4
P4345 link reply
Are you sure d's value is what it is?
P4346 link reply
P4345
tfw small number of simulations, I guess.
P4347 link reply
P4344
P(6 in N rolls|N even rolls) =
= P(N even rolls && 6 in N rolls) / P(N even rolls) =
= ((1/3)^(N-1) * 1/6) / ((1/2)^N) = (2/3)^(N-1) * 1/3
This is an geometric distribution with p=1/3 so E(N) = 1/p = 3 so the answer is (e).
Did I make a mistake? How is this supposed to be surprising?
P4348 link reply
P4347
While we're waiting for the big brained op to reveal the secrets, can you tell me where I am going wrong in this naieve simulation:

(defun rolls (&optional (length 0))
(let ((x (1+ (random 5))))
(cond
((= x 3) (list (1+ length)))
((< x 3) nil)
(t (rolls (1+ length))))))

(defvar *rolls* (list))
(loop while (< (length *rolls*) 1000)
do (setq *rolls* (nconc *rolls* (rolls)))
finally (print (/ (reduce '+ *rolls*) (length *rolls*) 1.0)))

But I just find what I secretly thought the answer would be anyway: 1/6 + 1/2/3 and that's not even an option.
P4349 link reply
P4348 Posting while tired, cautionary tales. s/(< x 3)/(< 3 x)/
P4351 link reply
P4348
What your simulation is producing might be E_N(6 in N rolls && N even rolls) instead of E_N(6 in N rolls|N even rolls).
Though idk if it's even producing that. Not familiar with lisp.
If what you are doing is rolling in [1..6] and dropping if odd, adding to sample if 6, then you are calculating E_N(6 in N rolls && N even rolls).
Based on some searching found https://math.stackexchange.com/questions/2463768/understanding-the-math-behind-elchanan-mossel-s-dice-paradox and https://www.yichijin.com/files/elchanan.pdf and it looks like this is just some jewish word games, and what Elchanan is asking for is E_N(6 in N rolls && N even rolls) instead of E_N(6 in N rolls|N even rolls) which is more consistent with the problem statement.
P4352 link reply
P4351
I guess so, it's been years since I thought about combinatorics. Also when I rewrote what I thought my lisp was doing into C, my C gets about 1.5 as an answer, which seems to be what they want.
P4360 link reply
P4352
Looking again I think if we just imagine a Markov chain. The relative weight of the nth shortest path to the exit is (1/3)^n, n in N. For a trials, but normed by a, the answer is the geometric series for 1/3. I'm just trying to build my intuition.
P4362 link reply
P4347
The condition is any series of even rolls ending in a 6.

P(n even rolls ending in a 6) = (1/3)^(n-1) * (1/6)

P(even rolls ending in a 6)
= P(1 even roll ending in 6) + P(2 even rolls ending in 6) + P(3 even rolls ending in 6) + ...
= 1/6 + 1/3 * 1/6 + (1/3)^2 * 1/6 + ...
= 1/4

P(n even rolls ending in a 6 | even rolls ending in a 6)
= P(n even rolls ending in a 6) / P(even rolls ending in a 6)
= (1/3)^(n-1) * (2/3)

E(number of rolls | even rolls ending in a 6)
= 1 * P(1 even roll ending in a 6 | even rolls ending in a 6) + 2 * P(2 even rolls ending in a 6 | even rolls ending in a 6) + ...
= 1 * (2/3) + 2 * (2/9) + 3 * (2/27) + ...
= 3/2
P4363 link reply
P4351
>Then afterwards explains that this problem has the same answer to,
>"What is the expected number of times you can roll only 2’s or 4’s until you roll any other number?"

I like this way of looking at it.
P4364 link reply
P4363
>the expected number of times you can roll only 2’s or 4’s until you roll any other number
A bit badly stated though, makes it sound like the final roll isn't included. It should say the expected number of rolls needed to get a number that isn't 2 or 4.
P4389 link reply
The answer is e. 3

The problem is equivalent to rolling (n-1) 2 or 4s then a 6, knowing that we can only get even numbers.
That is P(n) = (2/3)^(n-1)×(1/3) is the probability to get a 6 for the first time on the n-th throw, knowing that all rolls were even.

Now, E = (1/3)×sum_(n=1)^(infty)(n (2/3)^n) = (1/3)×(1/(1-(2/3))²)=3

How is that surprising? This was my first intuition that the result would be similar to using a three-sided dice
P4391 link reply
P4389
That's the first wrong answer everyone gets.

>The problem is equivalent to rolling (n-1) 2 or 4s then a 6, knowing that we can only get even numbers.

It isn't because the ratio of the probability of getting 6 on the first roll to the probability of rolling 2 then 6 is 3:1 in the reformulated problem but 6:1 in the original problem.
P4393 link reply
>It isn't because the ratio of the probability of getting 6 on the first roll to the probability of rolling 2 then 6 is 3:1 in the reformulated problem but 6:1 in the original problem.
Is it? Doesn't
>conditioned on the event that all rolls gave even numbers?
mean that we do not count the events in which we would roll a 1, 3 or 5?

I tried another way.
Let X be the number of rolls required to get a first 6. Let A_n be the event "all n have been even numbers".
P(X=n|A_n)=(P(X=n)P(A_n|X=n))/P(A_n) according to Bayes' formula.
P(X=n) = 5^(n-1)/6^n;
P(A) = 1/2^n;
P(A|X=n) = (2/5)^(n-1) (we can get 2 or 4 out of {1,2,3,4,5} for n-1 rolls, then 6 is even)
Then, P(X=n|A)=1/3×(2/3)^(n-1)
Which is the same result as before.
P4394 link reply
>"all n have been even numbers"
<"all n rolls have been even numbers"
P4402 link reply
P4393
P4394
>all n rolls have been even numbers
The problem is this is not the right condition. Your condition says that exactly n rolls have been even numbers, but the original condition says however many rolls it takes to hit a 6 will be even numbers.
x