Did you solve it? Logicians in a line | Mathematics

Earlier today I have put you a problem with the following logic, as a retrospective commemoration of the day of the world’s logic. Here is again with the solution – and a comment on how it is associated with the real world.
Eye
1. Ten scientists are placed in a line, all of whom face the same trend. A red or green hat is placed on each of their heads. Logic does not know the color on their heads, nor the color of the people who stand behind them in the line. Every logic can only look forward, and thus know the color of the hat for a person or people in front of them.
One after another, every logiti says in a loud voice either the word “red” or the word “green”. Each Logitei says one of these words, and there is no logic that speaks twice.
Can you think about a strategy – which logogues will agree before the line – which leads to at least nine of them say the word color that describes the hat on their head properly?
There are no mirrors or reflective materials. Knowledge is concluded about their entire hats color, which can see it and what is said.
2. The same preparation as before, but now there are three colors of the hat: red, green and yellow.
Can you think of a strategy in which each logistical word says one word, now either “red”, “green” or “yellow”, and leads to at least nine of them say the right colors of their hats.
solution
1. Here is a strategy working. The first person to speak is the person in the back of the line. Second, the person is directly in front of them, and so on that the person in front of the line is the last person to speak. The person in the back of the line may say the right color of his hat, but everyone will do that.
The person in the back, who sees that each person from their hat says, says “red” if they see an equal number of red hats and “green” if they see a strange number of red hats.
The next person can conclude the color of his hat by looking at the number of red hats in front of them. Suppose the person in the back said “red”, and they see a marital number of red hats, they know that his hat cannot be red, because if they see a strange number of red hats (the number that the past sees in one minus line). So they say “green”. On the other hand, if they see a strange number of red hats, they will say “red”.
The third person in the line does the same. They look forward to knowing the number of red hats they can see. If the first person, “red” and “the second”, said “Al -Akhdar” and they see an equal number of red, then they know that they have “green”, and if they see a strange number they know that they have a red hat. And what goes. Each person deduces their hatred by looking at whether there is a strange or even red hats in front of them, and compare this with the knowledge that the person who stands behind them in the line.
2. The same strategy, but instead of looking at the possibilities/even, we look at the rest when divided into 3. (The artistic term is Modulo 3)
Let “red” = 0, “green” = 1 and “yellow” = 2.
The person in the back of the line will look at the hats in front of him and use the code above, increase the hat color numbers. Therefore, if they see three red, three green and three yellow, they will count 0 + 3+ 6 = 9. Then they divide this number by 3. 2 They say “yellow”.
The next person in the line adds the hats that they see according to the symbol, and the rest when divided into 3. If the rest is the same as the rest that the person who precedes them announced, then they have a red hat. (Because their hat added 0 to the number of the hat). If the rest is less than the color that the person said loudly by the person who precedes them, they will have a green hat, and if it is less than two, then they have a yellow hat.
Repeat the same procedure while you are moving via the line.
This type of thinking is used in some “error correction codes”, which is a strong technique of errors. Suppose every person in the line is a computer, and the hat is part of the data in this computer. If any computer loses its data (that is, it can no longer see its own hat), it is possible to rebuild the data based on the data on other computers.
I hope you enjoyed the language – I will return within two weeks.
Thanks to Deniz Sarikaya, from VRIJE Universiteit Brussel and Universität Zu Lübeck, which is coordinator World Logic Day.
I have prepared a mystery here on Mondays since 2015. I have always been aware of the wonderful puzzles. If you want one suggestion, Send me.