Today, we end our exploration of hat puzzles with a look at a couple of variations on the infinite hat puzzle from our last post. In particular, we will deal with situations in which the prisoners cannot hear each other’s guesses and therefore cannot pass along any information, and yet in which the prisoners still have surprisingly effective strategies at their disposal.

## Puzzle Five: Countably infinite hats with no information

The setup is the same as that of Puzzle Four. There are countably infinitely many prisoners, labelled by the natural numbers. They are each given a red or blue hat and are lined up so that each prisoner knows their own number and can see exactly the prisoners with larger numbers. Each prisoner guesses the color of their own hat. If they are correct, then they are released; if they are incorrect, then they are executed. The difference is that, in this puzzle, although the prisoners can still devise a strategy beforehand, none of the prisoners knows the guesses of any of the others. How can the prisoners act to minimize the number of prisoners who guess incorrectly?

With no information being passed, it might seem hard to envision any strategy being reasonably effective. We will see, though, that for a reasonable definition of ‘reasonably effective,’ there is a reasonably effective strategy, and it can be found using only tools that we developed in our solution to Puzzle Four. As usual, configurations of hats will be represented as infinite sequences of 0s and 1s, with 0 meaning ‘red’ and 1 meaning ‘blue.’ In our last post, we isolated an equivalence relation, called , on the set of all infinite sequences of 0s and 1s (this set is denoted by ), where, for two sequences , we say if and differ in only finitely many positions. Also as in our solution of Puzzle Four, we can assume that, during their strategizing, the prisoners fixed a *transversal* of , i.e. a function from the set of equivalence classes of to such that, for every equivalence class , we have .

The point, of course, is that, when the prisoners are lined up with hats on their heads, each prisoner can see all but finitely many of the hats, so each prisoner knows precisely in which equivalence class their particular configuration lies. Denote this equivalence class by . Since each prisoner knows , which was fixed in advance, each prisoner also knows and knows that their configuration only differs from in finitely many places. Suppose now that each prisoner guesses the color indicated for their position by . Whenever their particular configuration differs from , they will be wrong. However, we know that their configuration only differs from finitely many times, so only finitely many prisoners are wrong. This finite number could be arbitrarily large, but it is guaranteed that, from some point on, the prisoners’ configuration will agree with , and *all *of the prisoners from that point on will guess correctly. This isn’t bad for a situation that may at first glance have appeared somewhat hopeless!

## Puzzle Six: A continuum of hats

We have more prisoners now, one for each real number. They are again each given a red or blue hat and arranged in a line so that each prisoner can see exactly those prisoners with strictly larger numbers than their own. Each prisoner guesses the color of their hat; if they are correct, they are released, and if not, they are executed. And, again as in Puzzle Five, each prisoner knows their own number, and the prisoners are allowed to devise a strategy beforehand, but no prisoner knows the guesses of any of the other prisoners.

**Note: **The solution to this puzzle requires somewhat more sophistication than previous solutions, so be prepared to work a little bit here. It’s worth it, though!

In this situation, configurations of hats will be represented by functions , where, for a real number , gives the color of the hat worn by Prisoner . Let denote the set of all such functions. We can try to recreate the strategy used in Puzzle Five in the following way: define an equivalence relation on by letting if and only if and differ in only finitely many places. Oh, but now we run into a problem: no prisoner is able to tell in which equivalence class their configuration lies, since each prisoner is ignorant of the colors of the hats of all of the prisoners with smaller numbers and, for each real number , the set of real numbers smaller than has the same size as the set of all real numbers!

OK. Let’s try to generalize the strategy from Puzzle Five in a different way, using a different equivalence relation. Let’s say that if, for all *large enough* , . More precisely, if there is some real number such that, for all , . The reader is invited to check that this does in fact define an equivalence relation. Also, it is evident that each prisoner is able to tell in which equivalence class of this relation the actual configuration lies. Therefore, we can mimic the strategy from Puzzle Four: the prisoners fix beforehand a transversal (call it ) of the equivalence relation, i.e. a function that chooses a representative element from each equivalence class. Then, given a real number , Prisoner guesses , where is the equivalence class of the actual configuration. By the definition of the equivalence relation, then, there is some real number such that, for every prisoner with a number at least as large as , that prisoner guesses correctly.

This is something, at least. We guarantee that continuum many prisoners are released, and we will certainly have an impressive run of success past the magic real number . However, we don’t really know anything about what happens for the prisoners with numbers less than . For all we know, it could be the case that all of them guessed incorrectly! We will have saved continuum many prisoners, but perhaps we have sent continuum many prisoners to their deaths as well! That doesn’t seem too good. Can we do better?

Yes, we can. In fact, I claim that the prisoners have a strategy which guarantees the following:

- Only countably many prisoners guess incorrectly.
- There is a real number such that, for every real number , Prisoner guesses correctly.

How can we accomplish this seemingly miraculous feat? Think about it for a few minutes before continuing.

The strategy works as follows. First, let denote the cardinality of (namely, ). One of the many equivalent formulations of the axiom of choice is that any set can be well-ordered in order type equal to its cardinality. In other words, we can enumerate the elements of by the ordinals such that each element is enumerated exactly once. Fix such an enumeration, , during the prisoners’ strategizing session.

Now suppose that the prisoners are given hats and lined up, and suppose that their actual configuration is given by a function . Given a real number and an ordinal , let us say that is *possible *for if, for all real numbers , . In other words, is possible for if, as far as Prisoner knows, the actual configuration might be . Now, for each real number and ordinal , Prisoner is able to tell if is possible for , since this depends only on values of that Prisoner can see. Prisoner can thus identify the *least *ordinal such that is possible for . Denote this ordinal by . Prisoner then guesses the hat color given by .

I claim that this strategy does what we want, though this fact should by no means be obvious at this point. To prove that it works, we have to analyze what happens when a prisoner guesses incorrectly. To this end, suppose that is a real number and Prisoner guesses incorrectly. In particular, this means that . Now suppose that . Prisoner can see Prisoner , so it must be the case that . In particular, , since . Also note that, since is possible for and , we easily have that is possible for . But Prisoner chose instead of , so we must have . Putting this together, we have shown the following:

- For all real numbers , and, if Prisoner guesses incorrectly, then .

Now let be the set of all real numbers such that Prisoner guesses incorrectly, and let . By what we have proven, if are both in , then . In particular, .

**Claim: ** is countable.

**Proof: **Suppose not. Then, as , is uncountable. Since is a subset of an ordinal, is well-ordered by the usual ordering on the ordinals. Let be its order type, and let enumerate in increasing order. For , let be the unique element of such that . Note that, for , we must have . Since is uncountable, . Recall that the rational numbers, , are dense in , i.e. for every pair of real numbers , there is a rational number such that . Now for each , fix a rational number such that . Since the sequence is strictly decreasing, it must be the case that, for , . But then is an uncountable set of rational numbers, contradicting the fact that there are only countably many rational numbers. Thus, is countable, and the claim is proven.

Therefore, when employing our strategy, only countably many prisoners guess incorrectly. It remains to show that there is a real number such that, for all real numbers , Prisoner guesses correctly. If this is not true, then we can construct an increasing sequence of real numbers such that, for all , Prisoner guesses incorrectly. But now, if are natural numbers, then , so is an infinite, strictly decreasing sequence of ordinals, contradicting the fact that the ordinals are well-ordered. Thus, we have shown that are strategy works exactly as desired.

**Remark: **If this strategy is not sufficiently surprising to you, let me quickly remark that we can make the challenge to the prisoners seemingly much more difficult in two different ways, and yet the same strategy will have the same astoundingly good result.

- First, we assumed above that there were only two possible hat colors for the prisoners. We never actually used this fact, though. The strategy would work just as well if there were ten possible colors of hats, or one for each natural number, or one for each real number. The strategy would work even if the number of possible colors were equal to an inaccessible cardinal, a measurable cardinal, a supercompact cardinal! The only necessity is that the prisoners know beforehand the set of possible colors, in which case they can devise a strategy exactly as above.
- In this puzzle, in order to be released, each prisoner only has to guess the color of their own hat. Perhaps this is too easy, so let’s make it harder as follows. In this new, strengthened challenge, each prisoner guesses the color not only of their own hat but also the color of the hat of ever prisoner with a smaller number. For each real number , in order for Prisoner to be released, there must be some real number such that Prisoner guesses
*every*hat color correctly on the interval (recall this is the set of real numbers such that ). Success in this new challenge probably now seems almost comically difficult, but, as I’ll leave it to the reader to check, the strategy we gave above easily generalizes to a strategy for this challenge with exactly the same result!

For more on this and related matters, the interested reader is directed towards the entertaining paper, “A Peculiar Connection Between the Axiom of Choice and Predicting the Future,” by Christopher S. Hardin and Alan D. Taylor.

## One thought on “Infinite Hats II”