Here are two puzzles, and a meta-puzzle. I’m going away for two weeks and I’m not posting the answers until I return, so unless you think you can solve them or you can stand the suspense, stop reading now!

First Puzzle: three prisoners with skullcaps

A warden says to three prisoners: tomorrow morning the guards will seat the three of you around a triangular table. Standing behind you, they will place a skullcap on each of your heads, such that each of you has no chance of seeing his own skullcap. Each skullcap is either black or white; overall there can be any combination. Each of you will place your hand on a switch below the table, such that the others have no way to see. You can move the switch to the left to indicate black, right to indicate white, or leave it in the middle to indicate no choice. After a suitable time to move the switches, you’ll put your hands on the table and we’ll see how you did.

Here are the three possible outcomes:

Someone correctly identifies the color of his own skullcap, and no one else makes a mistake. In this case, you all go free.

At least one person guesses wrong. In this case you all die.

No one guesses. In this case you all die.

So not everyone has to guess, but everyone who does must guess correctly for you to win. You can plan now, but tomorrow you will be forbidden to talk or otherwise communicate in any way.

What is the prisoners’ best strategy to maximize their chances of survival?

Second Puzzle: 100 prisoners with boxes

A warden says to one hundred prisoners: tomorrow morning the guards will lock each of you in separate cells, with no means of communication. One by one you will be escorted into a room with one hundred closed numbered boxes. Each box contains the name of one of you hundred prisoners, and each prisoner’s name is in exactly one box. You will be allowed to open ninety boxes — all but ten — in order to try to find your own name. Once you are finished, the boxes will be closed (no rearranging) and you returned to your solitary cell, so the next prisoner may come and try.

There are two possible outcomes:

All one hundred of you are successful in finding your own name. In this case, you all go free.

One or more of you fails to find his own name. In this case, you all die.

You can plan now, but tomorrow you will be forbidden to talk or otherwise communicate in any way.

What is the prisoners’ best strategy to maximize their chances of survival?

Meta-puzzle

The solutions to these puzzles have something interesting in common. What is it?

PS — there are no tricks to either of these. The prisoners do not cheat.