Quote:
Originally Posted by Rococo
ChatGPT seemed to struggle with the following question:
I concede that the exact answer to the question is complicated, in part because I think optimal strategy will vary depending on the information that people in line receive based on previous selections.
d2, uke, Sklansky,
How would you calculate the answer to this question?
I have something resembling a solution to this, but would have no idea where to start even trying to prove that it's the optimal solution, those sorts of proofs are well above my pay grade.
First, assign each attribute value a digit 0-3. E.g. small = 0, medium = 1, large = 2 etc.
Then, assign each attribute a position 1-4. E.g. size = 1, material = 2 etc.
Now we can construct a 4 digit base 4 number which encodes each hat's attributes in positional notation. E.g. 2213 might mean "large, felt, Pepsi logo, green."
Now we have our encoding, we have 256 numbers in base 4 (0000-3333). Jimmy has 1 number in mind. We are going to pick numbers and Jimmy is going to raise his hand when the number we have picked has at least one digit correct, per the conditions of the original problem.
The best I could come up with going from here is below.
Use the first 4 guesses to guess 0000,1111,2222,3333. Depending on when Jimmy raises his hand, we will know which distinct digits our number contains. We proceed on a case by case basis.
Case A: 1 distinct digit
There are 4 such numbers so this will happen 4/256 of the time.
WLOG, assume the digit is 1.
Not much to do here, the hat is coded 1111 and we are done.
Case B: 2 distinct digits
There are 84 such numbers so this will happen 84/256 of the time.
WLOG, assume the digits are 1 & 2. There are 14 such numbers.
[2^4 for each digit in each place then subtract the 2 degenerate cases of 1111 and 2222]
We now introduce a "masking" method which we can use to isolate digits. For example, we want to know whether our number starts with a 1 or a 2. We can do this in 1 guess by guessing a number with the first digit we care about and the rest digits we know do not appear. For example, we guess 1333. If Jimmy raises his hand, we know the first digit is 1. If he does not, we know it is 2.
WLOG, assume the first digit is 1.
We have now used 5 guesses and we have 7 candidates remaining:
1112, 1121, 1122, 1211, 1212, 1221, 1222
We can use the masking method to narrow down the second digit on guess 6, the third digit on guess 7 and the 4th digit on guess 8. By guess 9 we are down to one candidate and we are done.
Case C: 3 distinct digits
There are 144 such numbers so this will happen 144/256 of the time.
WLOG, assume the digits are 1,2 & 3. There are 36 such numbers.
[3^4 for each digit, subtract 3 * 14 for the different case B combos and 3 for the different case A combos]
We use the masking method to identify the 1st digit (this will now take 2 guesses). WLOG, assume the first digit is 1. This has left us with 12 options after 6 guesses:
1123,1132,1213,1223,1231,1232,1233,1312,1321,1322, 1323,1332
If we use the masking method again for the 2nd digit, we will be left with (worst case) 5 options after 8 guesses.
We can use guess 9 to narrow down the 3rd digit to 1 of 2 possibilities using the masking method.
Guess 10 then leaves us picking at random from (worst case) 3 candidates for a 1 in 3 shot.
Case D: 4 distinct digits.
There are 24 such numbers so this will happen 24/256 of the time. [4! - each place has to have a different digit]
This is really our worst case scenario. We can't use the masking method because we have no spare digits to work with, so we can't isolate anything. I can't really see a better strategy here than picking at random. So, we have 6 guesses from 24 candidates for a 1 in 4 shot.
So, the total probability of success:
(1)4/256 + (1)84/256 + (1/3)(144/256) + (1/4)(24/256) = 55.5%. We (as the group of 10) can take an even money bet on this game and win.
I might well have missed some optimisations in case C and there may well be some strategy I haven't thought of in case D, which will give us better odds. Cases A and B seem pretty straightforward.
Last edited by d2_e4; 10-03-2024 at 02:43 AM.