Can You Figure Out The Answer To This Clever Prisoner Hat Puzzle?

To sign up for our daily newsletter covering the latest news, features and reviews, head HERE. For a running feed of all our stories, follow us on Twitter HERE. Or you can bookmark the Gizmodo Australia homepage to visit whenever you need a news fix.

Here’s another classic maths riddle for you to prune your brain on a little bit: if people were lined up from tallest to shortest (meaning a person can see everything in front of them) and all wearing black or white hats, can you figure out which colour hat you were wearing even if you had no idea how many black or white hats there were total? The answer is yes, you can!

Alex Gendler explains for Ted-Ed how simple it is to do. But first, the problem: there are 10 people lined up from tallest to shortest each wearing a different hat colour (black or white). The entire group doesn’t know how many black or white hats there are and you can only see the people in front of you but you have to guess what colour your hat is. In fact, the entire group needs to guess 9 of the 10 hat colours correctly.

How does a group do it? Watch the video below.

It requires a bit of code and trickery but if you assign odd and even to the terms black and white for the tallest person that’s furthest back, it all makes sense.