# Ernest does not know the color of his hat (2)

The previous version indeed proved simple; now a medium one (I think)

The (same) premise: A number of people stands on a line playing a hat guessing game

• they may not move during the game, they can only look straight ahead (each person in a direction along the line, i.e. right or left depending on their facings)
• they all wear a yellow, a red or a green hat.
• they see all people in front of them
• they do not know their own hat
• they do not know anything about the configuration behind them, except which people are there, and what is deduced from the content of the statements
• all statements are provably true for the person uttering them

Anna says: The person directly before the person directly before me wears a red hat
Bob says: The person directly before the person directly before me wears a green hat

then Dennis says: Ernest does not know the color of his hat
then Ernest says: I know the color of my hat

• What is the color of Ernest's hat?
• Please also provide a valid configuration of people.
• Are you sure this is correct? It looks perfectly symmetric in Anna/red, Bob/green. So whichever configuration works will work equally well after swapping Anna and Bob and all greens for reds and all reds for greens. Oct 5, 2020 at 14:30
• @PaulPanzer I have the same thought, so my conclusion is that E wears yellow hat. But I haven't figured out a valid configuration for that. Oct 5, 2020 at 14:31
• @WhatsUp you're a genius! Oct 5, 2020 at 14:36