The Impossible Hat Puzzle: Can You Crack the Code?

All copyrighted images used with permission of the respective copyright holders.

The Last Gizmodo Monday Puzzle: A Farewell to Brainteasers

It has been a pure delight to melt your brains every week, but today’s solution marks the last installment of the Gizmodo Monday Puzzle. A heartfelt thank you to everyone who commented, emailed, or puzzled along in silence. Your participation made this weekly tradition truly special.

While we bid farewell to this particular brain-bending format, my passion for puzzles remains. You can find my work in other exciting places, such as the Morning Brew newsletter, where I’ve crafted several puzzles to challenge your mind.

For those who crave a deeper dive into fascinating mathematical concepts, I also write a series on mathematical curiosities for Scientific American. If you enjoyed the thought-provoking preambles of this puzzle series, you’ll find plenty more intrigue and insights there.

And of course, you can continue to engage with my latest brain-tickling creations on X (formerly Twitter) @JackPMurtagh.

Now, let’s dive into the solution of the final Gizmodo Monday Puzzle and see if you cracked the code.

Solution to Puzzle #48: Hat Trick

Did you survive the dystopian nightmares of last week’s puzzle? A big shout-out to bbe for conquering the first puzzle and to Gary Abramson for providing a remarkably concise solution to the second.

Let’s recap the challenges and their solutions:

Puzzle One: The Red and Blue Hats

In this puzzle, 10 prisoners are lined up single file, each with a hat placed on their head. They can’t see their own hat but can see all the hats in front of them. The hats are either red or blue, and the prisoners are told they can only guess their own hat color once. If they guess wrong, they die. But, they can strategize beforehand to maximize survival chances.

The Solution: The group can guarantee the survival of all but one person. This strategy hinges on the person in the back of the line using their single guess to convey crucial information.

Here’s how it works:

  1. The Last Prisoner’s Role: The person at the back of the line counts the number of red hats they see in front of them. If the count is odd, they shout "red". If the count is even, they shout "blue".

  2. Deduction Chain: Now, let’s consider the next person in line. They see eight hats in front of them and hear the call from the person behind. Let’s say they count an odd number of red hats. Since the person behind them shouted "blue", they know that person must have seen an even number of red hats. This means their own hat must be red to make the total number of red hats even.

Each person in line, starting from the second-to-last, can perform the same deduction based on the hats they see and the call from the person behind them.

Puzzle Two: The Red and Blue Hats – Round Two

In this puzzle, ten prisoners are again lined up, each wearing a red or blue hat. This time, they are allowed to pass their turn and not guess. If they guess wrong, they die. The group only needs one person to guess correctly, but a single incorrect guess means death for everyone.

The Solution: The prisoners can devise a strategy that guarantees their survival with a very high probability (1,023/1,024).

Here’s the strategy:

  1. Passing the Buck: Every prisoner will pass their turn unless they only see red hats in front of them, or if someone behind them has already guessed.

  2. The Blue Hat’s Turn: This strategy ensures that the first person to see only red hats in front of them (or the person at the front of the line who sees no hats) will be the one to guess "blue".

Why This Works: The person in the back of the line will pass unless they see nine red hats, in which case they’ll guess "blue". If they guess correctly, everyone else passes, and the group survives unless all ten hats are red.

If the person in back passes, it means they saw at least one blue hat ahead of them. The next person in line will then only guess "blue" if they see eight red hats (as their own hat must be blue).

This pattern continues, ensuring that the first person who sees only red hats is the one to make the crucial guess, maximizing their chances of success.

The Probability of Winning: The only way the prisoners lose is if all ten hats are red. The probability of this occurring is 1/1,024. Therefore, the probability of the group surviving is 1,023/1,024.


The Gizmodo Monday Puzzle may be ending, but our love for challenging puzzles and exploring the fascinating world of logic and strategy continues. I encourage you to keep your minds sharp, embrace the joy of problem-solving, and share your own puzzles with friends and family.

Until our paths cross again in the world of puzzles, keep thinking critically and never stop seeking new solutions!

Article Reference

Alex Parker
Alex Parker
Alex Parker is a tech-savvy writer who delves into the world of gadgets, science, and digital culture. Known for his engaging style and detailed reviews, Alex provides readers with a deep understanding of the latest trends and innovations in the digital world.