Buy the book
How can an infinite number of mathematicians figure out their own hat colours?
How can 4 friends guess their own hat colours?
Feel like exercising your brain? Have a go at one of the problems I have for you.