Challenge 9: The Prisoner Line-Up

  • Thread starter Office_Shredder
  • Start date
  • Tags
    Challenge
In summary, a strategy for the countably infinite prisoners to guess their hat colors and win their freedom involves using the axiom of collective choice to agree on a function that satisfies certain conditions. Each prisoner then uses this function to guess their own hat color based on the information they can see from the other prisoners. This strategy can potentially limit the number of prisoners who guess their hat color incorrectly, with some solutions even guaranteeing that only one prisoner will guess wrong. However, some flaws have been pointed out, such as the dependence on the axiom of choice and the potential for different algorithms to be generated by different prisoners.
  • #1
Office_Shredder
Staff Emeritus
Science Advisor
Gold Member
5,666
1,568
Countably infinite prisoners, numbered 1,2,3 etc. are told that tomorrow they will be given hats, colored either black or white, and lined up so that each prisoner can only see the prisoners whose hats are labeled with a greater number. The prisoners then get to guess which color hat they wear, in order from 1 onwards. If all but finitely many of them guess which color hat they have, the prisoners win and they are let free.

The challenge: Describe a strategy which let's the prisoners go free. Assume as with all such challenges that the prisoners can't communicate in secret once they get their hats, they can see infinitely far to all the prisoners that are supposed to be visible to them, they have perfect memory and are perfectly logical and all those other things that people can't do in real life.

Bonus points if you can create a strategy that places a specific upper bound on how many prisoners get their hat wrong.
 
Mathematics news on Phys.org
  • #2
Let's assume a (somehow stronger) version of choice, say the axiom of collective choice, that for any set [itex]\mathcal X[/itex] of sets, the prisoners can agree on an element of [itex]\prod_{X\in\mathcal X} X[/itex]. Hopefully that's not cheating.

Define a binary relation on [itex]Z= \{b,w\}^\infty[/itex] via [tex]\sim := \{(x,y)\in Z\times Z: \enspace x,y \text{ agree on cofinitely many entries} \}[/tex] which is easily seen to be an equivalence relation. By collective choice, the prisoners can agree on a function [itex]f: Z\to Z[/itex] such that
- Every [itex]z\in Z[/itex] satisfies [itex]f(z)\sim z[/itex].
- Every [itex]z,y\in Z[/itex] with [itex]z\sim y[/itex] satisfy [itex]f(z)=f(y)[/itex].

The guessing rule: If [itex]z[/itex] is the true hat sequence, prisoner [itex]k[/itex] guesses [itex]f(z)_k[/itex], which he knows, because he knows the [itex]\sim[/itex]-class of [itex]z[/itex].

Because [itex]f(z)\sim z[/itex], only finitely many of the prisoners can be incorrect.
 
  • #3
economicsnerd, your axiom of collective choice is just the axiom of choice plus one prisoner telling everyone what he chose so I'll allow it. That's a really nice solution. Any alternate or stronger solutions out there? (by stronger I mean limiting how many prisoners guess wrong).
 
  • #4
Office_Shredder said:
economicsnerd, your axiom of collective choice is just the axiom of choice plus one prisoner telling everyone what he chose...
True. I guess I was just worrying about being able to "tell" something with so much information in it.
 
  • #5
Define the real number [itex]a[/itex] to be the number (between 0 and 1) whose binary expansion is represented by the sequence of hat colors (white = 0, black = 1). Assuming this is a computable number, then there exists an algorithm to compute it with arbitrary precision. This algorithm must be finite, so it can be encoded in a binary program of length n. The first n prisoners will say each bit in the program (using the convention that white = 0 and black = 1). Then all other prisoners will be able to run the algorithm in their heads up to the desired accuracy to predict their own hat color.

I see a few flaws in this solution, for example not all numbers are computable (but for all purposes, who could realistically generate such a number in the first place? :P ). Also, I am not sure whether it is possible to generate an algorithm to compute a computable number given only its decimal (binary) expansion. This would work well for rational numbers, or even algebraic numbers (by encoding the coefficients of the polynomial whose root we are looking for, and then using numerical methods such as Newton-Raphson, etc).

EDIT: speaking of that, I think there's something wrong or that I have misunderstood. The set of all sequences of ones and zeros is uncountable. But if there was a strategy that gave a finite upper bound N on the number of prisoners who must guess, then the set of all possible sequences generated by such a strategy must be countable, since it depends only on N bits, and so only 2^N such sequences are possible. Thus some sequences would not be described by such a strategy.
 
Last edited:
  • #6
As a matter of fact, it's possible for us to construct a strategy that guarantees that at most one prisoner will get his hat wrong. As in economicsnerd's solution, we start by having the prisoners agree on a choice function [itex]f[/itex] on the set of all infinite sequences. The first prisoner counts the number of positions [itex]k\geq 2[/itex] such that [itex]f(z)_k \neq z_k[/itex] - which will necessarily be a finite number - and then calls out "black" if this number is even and "white" if this number is odd. The second prisoner observes the number of [itex]k\geq 3[/itex] such that [itex]f(z)_k \neq z_k[/itex], and by comparing the parity he gets with that indicated by the first prisoner, determine whether [itex]f(z)_2 = z_2[/itex] and hence the color of his own hat, which he calls out. This gives the third prisoner enough information to deduce and call out the color of his hat, followed by the fourth, and so on. Hence every prisoner except possibly the first will correctly guess the color of his own hat with this strategy.
 
  • #7
@Boorglar: The set of computable numbers is countable, so this strategy does not cover most cases.

With at most N guesses, you can distinguish more than 2^N cases - there is some freedom which prisoners decide to transmit information (instead of trying to get their own hat right based on the previous information). Doesn't change much, however.Is this possible without the axiom of choice? If not, I think Citan Uzuki found the perfect solution.
 
  • #8
Yeah I just realized another (huge) flaw in my answer: the first prisonner might think of a number and come up with an algorithm. But the second prisoner will not see the same number, and he has no way to know which algorithm the 1st prisoner had in mind.

And also, mfb is right. The information that prisoner n obtains contains the hat colors for prisonners 1 to n-1. So each prisoner actually has more information than the previous.
 
  • #9
mfb said:
I think Citan Uzuki found the perfect solution.

Agreed! It's a very elegant solution.
 

FAQ: Challenge 9: The Prisoner Line-Up

How does the prisoner line-up challenge work?

The prisoner line-up challenge involves a group of prisoners who are given a chance to escape their death sentence. They are lined up facing forward, so that the first prisoner sees the other prisoners, the second prisoner sees the third and so on. The last prisoner at the back cannot see anyone. The prisoners are then given the opportunity to call out a color, either black or white, that they can see on their own hat. If at least one prisoner guesses correctly, all will be set free. However, if any of them guesses incorrectly, they will all be executed.

What is the strategy for the prisoners to survive?

The prisoners must come up with a strategy to communicate and figure out the color of their own hat. One possible strategy is for the first prisoner to count the number of black hats he can see and then call out the opposite color. If there are an odd number of black hats, he would call out white and if there are an even number, he would call out black. The second prisoner can then deduce the color of his own hat based on the first prisoner's answer and so on. This way, at least one prisoner will guess correctly and they will all be set free.

Are there any variations to this challenge?

Yes, there are variations to this challenge such as changing the number of prisoners or the number of hat colors. Another variation is when the prisoners are allowed to strategize beforehand and come up with a plan. In this case, they may be able to save all the prisoners even if more than one prisoner guesses incorrectly.

What is the mathematical concept behind this challenge?

The prisoner line-up challenge involves concepts from combinatorics and probability. By counting the number of black hats, the first prisoner is essentially counting the number of possible outcomes and then using probability to make a guess. This challenge also involves the concept of mutual exclusivity, where the prisoners must work together and communicate effectively to increase their chances of survival.

Can this challenge be applied to real life situations?

Yes, this challenge can be applied to real life situations where decision making involves risk and probability. For example, in the stock market, investors must assess the probability of a certain stock increasing or decreasing in value and make a decision based on that information. This challenge also highlights the importance of teamwork and communication in problem solving.

Similar threads

3
Replies
83
Views
19K
3
Replies
104
Views
15K
Replies
125
Views
18K
Replies
14
Views
7K
Replies
2
Views
1K
2
Replies
60
Views
9K
Back
Top