# One hundred and one hats

You are a prisoner. One day, the Warden summons you and ninety-nine others to see his hat collection.

"Bowlers and baseball caps. Stensons and sombreros. One hundred and one headpieces, each unique in the world," says the Warden.

"You are the smartest of prisoners in my domain, and by law I must offer you a chance at your freedom. So here is the game we will play. While you all are blindfolded, I will place a hat on each of your heads. I will also wear one myself. Once the blindfolds are removed, you will look around and know the identity of every hat except two: your own hat, and my hat. Yes, by then I'll be gone.

"You will all then guess, by secret ballot, the identity of my hat. Besides seeing what other people are wearing, these guesses are independent. No communication once the game begins.

"If everyone names my hat, you will all go free. But a single wrong answer means you can all walk yourselves right back to your cells.

"Good luck. I reckon you will need it, as I calculate your odds of winning at $2^{-100}$."

As the prisoners gather to discuss their strategy, someone asks you what should be done. What do you say?

A couple notes:

1. Assume you can't cheat by looking at the brim of your own hat -- you really don't know what your own hat is.
2. The solution I am aware of uses math beyond high-school level. Nothing too super powered, but something you might not be aware of if you weren't / aren't a math major in college.