N hats in a row
How many can predict the color of the hat on their own head?
This is a problem which is extensively discussed online with videos and text. Here we present the general solution.
Here is the Problem: N people are lined up facing in the same direction. With their eyes closed, hats are placed on their heads. The hats are of two colors, either white or black. Each person can see the hats on the heads of people ahead of him. Starting from the last person in the line, they are asked to predict the color of the hat on their heads. What is the maximum number of correct answers possible if they use some rule?
Solution is here