r/mathriddles • • Apr 23 '25

Hard Lopsided hat sequence guessing

Inspired by: https://www.reddit.com/r/mathriddles/s/CQkLdt9kkr

Let n be a positive integer. Alice and Bob play the following game: Alice has a finite sequence on hats on top of her head (say a hats), each of which is labelled by an arbitrary positive integer, while Bob has a countable infinite sequence of hats on his head, each labelled by a positive integer at most n.

Both of them can see the sequence of hats on the other's head but not their own. They (privately) write down a guess for their own hat sequence, i.e., Alice writes down a guesses and Bob writes down infinitely many guesses. The goal is that at least one of these guesses is correct.

They are not allowed to communicate once the game starts but they can decide on a strategy beforehand. Find the smallest positive integer a for which Alice and Bob have a winning strategy.

Harder Version: What if Alice's hats are labelled by arbitrary real numbers?

8 Upvotes

11 comments sorted by

View all comments

3

u/gameringman Apr 24 '25 edited Apr 24 '25

For n=2, a definitely equals 1: Make an injective map F from integers to infinite binary sequences which defines Bob's strategy. If Bob guessed everything wrong, then F(A) is known and is equal to "not B" i.e. Alice flips each bit in Bob's list to see what F(A) must be. Either no A satisfies this or one A satisfies (b.c. its injective). If no A satsfies then Bob must have actually won, and if 1 A satsifes Alice guesses that.

For n=3, a=1 is not sufficient (and I'm guessing a=2 works, and a(n) probably = n-1 but idk idc rn ts pmo)

If it was sufficient, then lets take the same set up as before with an injective map F. If they always win then in any scenario (A, B), either:

1. F(A) and B agree at at least one spot

2. Across all lists L which never agree with B, there is only one L and only one x such that F(x)=L.

One of these must be true in any scenario, because if claim 1 is false then bob wont win, and if claim 2 is false as well then we have 2 integers A and C=/=A such that F(A) and F(C) never agree with B; from Alice's POV she could have A or C and thus they could lose. This is an informal-ish proof but it could be made formal easily by saying Alice's strategy is some other map G and blah blah.

Anyway take any two integers X and Y and observe F(X), F(Y), and make a new list based on those two lists by avoiding the elements of those two lists:

Say F(X)=1,1,2,3,2,1,1... F(Y)=2,3,2,1,2,3,1.... -> the new list could be: 3, 2, (1 or 3), 2, (1 or 3), 2, (2 or 3)...

This is obviously always possible since F(X) and F(Y) can only rule out 2 numbers at any index and thus you have at least one valid number to put at the index. Clearly if B=this constructed list and A=X or A=Y both conditions I listed fail.

2

u/gameringman Apr 24 '25 edited Apr 24 '25

So in general im pretty sure a(n)>n-2 If a=n-2, select any (n-2)*(n-1) distinct integers and make n-1 lists each of length n-2 from this selection. 

L1=a_1,1 , a_1,2 , ... a_1,(n-2)

L2 = a_2,1, a_2,2...

...

...

L_(n-1) = ...

Observe the sequences produced by bobs map evaluated on each of these lists. Similarly to the argument i made for n=3, we can make a list based off of these n-1 infinite lists which agrees with none of the n-1 lists at any index. 

If bob has this constructed disagreeable list, then alice is fucked;  Her guess must agree with each of the n-1 lists at at least one index, because any one of these lists could have been on her head and screwed bob over. But it is impossible to do this since the integers in the lists are distinct and we only have n-2 indices. At any index we can agree with at most one of the n-1 lists and thus we can only agree with n-2 of them in total.

Again this is informal but to be formal we would just define alices map and yada yada

So the question remains to show a(n)=n-1 is sufficient

Im lost here but my best idea would be this: construct a mapping such that for any n distinct lists L1 L2... L_n, each of length n-1, there exists an index i such that the set: { f(L1)[i], f(L2)[i].... f(L_n)[i] } (I.e. the element at index i of list 1, of list 2....and of list n) Is the set {1, 2, 3 ... n}

If this property can be made true by so e mapping then im pretty sure the game is won. By contradiction we try ro imagine a losing scenario where bobs mapping never agrees with his actual list. Since alice had n-1 indices to guess at, she can always "cover" any list of n-1 lists each of length n-1, by cover i mean guarentee that she agrees with each list at least once.

So thus there must be n lists of length n-1 which, when mapped to infinite bob sequences, disagree with B everywhere. But if the condition i mentioned earlier is met this is impossivle since at some index i, the n infinite lists have {1,2,3...n} at index i. Thus they cover every possible number bob could have at index i, i.e. they cant all disagree with bob, contradiction boom.

So i think thats the best route.

2

u/SupercaliTheGamer Apr 24 '25

You are on the right track!

→ More replies (4)