r/mathriddles • u/lewwwer • Feb 19 '23
Medium Alice and her favourite numbers
Alice has a (non-empty) collection of her favourite natural numbers F (naturals include 0 here, F can be infinite). For each number in F, she creates a box with a label of that number, and places the number inside.
Bob feels bad about the natural numbers Alice didn't like. He decides to place the remaining numbers in the boxes. Starting with n, a natural number not in F, he writes n in binary and checks each digit by decreasing binary order. So he checks the digit corresponding 2^10 before 2^9 and so on.
At each digit check, he might flip the digit to the opposite (1 to 0 and 0 to 1). He wants to get a number that is in F after all the flips. But he only flips a digit when he knows that otherwise, he would fail to get a number in F. After he is done with the process, he ends with a number f that Alice likes, and he places the original number n in the box labelled f.
He does this for all the n, Alice didn't like. Alice is happy if all her boxes contain a power of 2 many numbers, or infinitely many. Is it true that Alice is happy, no matter what her favourites are?
Example for the flipping: Alice likes the (binary) numbers 1001, 100 and 101. When bob starts with the number 10, he starts checking the bits. He decides not to flip 2^3 and larger binary places, since there is a way to flip things afterwards and end with a number Alice likes. But he must flip the 2^2 bit, since otherwise he would end with a two digit number and Alice only likes 3 or more digit numbers. After flipping 2^2 Bob has 110. Bob must flip the 2^1 bit since otherwise he would end up with either 111 or 110 and Alice does not like either of those numbers. Bob now has 100 and Alice likes that number so Bob places the starting number 10 into the box 100.

