(again a more a difficult one)
The (same) premise:
An unknown 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 1 (i.e. directly) before Fay wears a red hat
Bob says: The person 2 before me wears a green hat
Carole says: The person 4 before me wears a yellow hat
EDIT : I made a mistake twice in Fays statement D and E were wrongly one way earlier I'm so sorry..
Fay says: Dennis is directly behind Ernest and vice versa.
then Dennis says: Ernest does not know the color of his hat
then Ernest says: I know the color of my hat
Note: Since it is not clear to everyone: The then in the last two statements mean that it matters that Dennis it the fourth and Ernest the fifth/last to talk.
- Given that the statements cannot be true with less people than present, how do they stand?
(i.e. Give the order and directions; not all hat colors are known)
A hint to make life easier
The number of persons can immediately be determined
It is
There are 6 persons.
Why
This because all facings are stated (by me) to be deducible. The facings of unmentioned persons are not mentioned in any way in the hints, so only the mentioned persons can be present. Note that if this was not noticed, it would still be reasonable to assume 6 until contradiction, since we are looking for a minimal number.
The most important thing to realize:
Dennis' statement gives Ernest information. This excludes a lot of possibilities. Even if it is not clear yet how Ernest deduces his hat color from the information, Dennis must be passing him useful information (that can be combined with other information to give him his hat color).