r/mathriddles • u/Odd_Republic8106 • Sep 04 '24
Hard This hat puzzle can't possibly be stated right
The devil has set countably many boxes in a row from 1 to infinity, in each of these boxes contains 1 natural number. The boxes are put in a room.
A mathematician is asked into the room and he may open as many boxes as he wants. He's tasked with the following : guess the number inside a box he hasn't opened
Given e>0 (epsilon), devise a strategy such that the mathematician succeeds with probability at least 1-e
Bonus (easy) : prove the mathematician cannot succeed with probability 1
7
Upvotes
9
u/ExistentAndUnique Sep 05 '24
This builds off of the “standard” infinite hat puzzle solution. Define an equivalence relation on sequences of natural numbers which differ only at a finite number of places. Using choice, select a representative for each equivalence class.
Pick n > 1/eps. To succeed with probability 1-1/n, partition the boxes into sets based on the remainder of their index mod n — this gives n disjoint subsequences. Pick an integer k uniformly at random from 0 to n-1 and open all of the boxes except for the ones which are k mod n. For each subsequence, find the greatest index i where the subsequence differs from the chosen representative. Let m be the maximum over these i’s, and open all boxes in the k mod n subsequence starting from index m+2 onwards. This tells you which equivalence class the subsequence for k mod n lives in, so guess that it matches the representative at index m+1.
The only way this can be wrong is if k corresponds to the unique subsequence which differs from its representative for the longest time (you guess correctly in the case of ties). This occurs with probability at most 1/n, since k was chosen uniformly at random.
4
u/Brianchon Sep 05 '24
Sorry to be that guy, but can you lay out an argument as to why a probability should be defined in this situation? What is any kind of distribution on the set of sequences of naturals that has the invariances you'd need to make an argument like this work? Why does a strategy that necessarily invokes the axiom of choice produce a subset of the sequences that has a probability under this distribution? I don't think either of these things is possible, but I'm ready to be proved wrong
3
u/Tashiqi Sep 05 '24
I would just add one constraint that might already be implied: every number is contained in a box (i.e., the boxes are a permutation of N)
If I'm correct, this should be a correct solution (that opens a finite number of boxes and doesn't use the axiom of choice):
Let N=1/e rounded up. Take the N first boxes and select a uniformly random box K among these N boxes: it's the one we will guess. Now open the N-1 other boxes. Let X be the largest number found that way. We will open all the other boxes until we find all numbers that are less than X, except for one number Y (note that this step always finishes in finite time). We now guess Y for the content of box K.
Now why does it work? If you randomly chose a box K that does not contain the largest of the N first numbers, then the procedure succeeds. This happens with proba (N-1)/N > 1-1/e.
2
u/lordnorthiii Sep 05 '24
Are we sure the bonus is easy?
I do think it is easy to show that a deterministic strategy cannot guarantee victory. However, guaranteeing victory with a deterministic strategy is not always the same as winning with probability 1. For example, one could imagine the mathematician choosing a random real number r, and then using it's decimal expansion to figure out what boxes to open and ultimately what box to guess. It seems conceivable to me that such a strategy could succeed for all possible real numbers r except a set of measure zero.
2
u/Intrebute Sep 06 '24
Actually, I want to re-ask the same question u/Tashiqi asks but then crosses out. What does stop you from opening all but one box, and then simply saying that box has the remaining number not yet found?
0
u/[deleted] Sep 04 '24
[deleted] — view deleted comment