Solution
Three Logicians and Five Hats
Show the problem again
A bag holds five hats: two red and three blue. Alice, Bob and Carol, all perfect and truthful logicians, each draw one hat at random without looking and put it on, so each sees the other two hats but not their own. The remaining two hats stay hidden. All of this is common knowledge. A referee then asks them in turn, Alice, Bob, Carol, Alice, Bob, Carol, and so on: "Do you know the colour of your own hat?" Every answer is heard by all, and the questioning stops at the first "yes". What is the expected number of questions asked, counting the one answered "yes"? Give your answer as a reduced fraction.
Worked solution
The answer is 5/2. Write each assignment as (Alice, Bob, Carol). At most two hats are red, so every assignment except (R, R, R) can occur. Nobody can ever know they are red from the hats alone: whatever a player sees, blue is still available, and the logic below only ever rules red out. Question 1. Alice knows only if she sees two red hats, since then she must be blue: assignment (B, R, R). Question 2. Hearing Alice's "no", Bob knows he is blue if he sees red on both others (three reds are impossible), assignment (R, B, R), or if he sees blue on Alice and red on Carol, because his red alternative (B, R, R) was just eliminated: assignment (B, B, R). In every other case both of his options are still alive. Question 3. The four assignments left are (R, R, B), (R, B, B), (B, R, B) and (B, B, B), and Carol is blue in all of them: whatever she sees, her red alternative is either impossible or already eliminated. So Carol always answers "yes" at question 3 if it is reached. The assignments are not equally likely, because the hats are drawn without replacement. P(B, R, R) = (3/5)(2/4)(1/3) = 1/10. P(R, B, R) = (2/5)(3/4)(1/3) = 1/10 and P(B, B, R) = (3/5)(2/4)(2/3) = 1/5, so question 2 ends the game with probability 3/10. The remaining probability, 6/10, goes to question 3. The expected number of questions is 1(1/10) + 2(3/10) + 3(6/10) = 25/10 = 5/2. (Checked by simulating the public announcements over all assignments with exact draw probabilities.)
Source: Classic "wise men and hats" puzzle in wide circulation, here with a modified colour split and an expectation question; no traceable original source. Statement written for AxiomIQ.