Let be positive integers with . There are two people, A and B:
1. A first secretly writes down an -digit 01 sequence on a piece of paper, and then writes on the blackboard all length- 01 sequences that differ from this 01 sequence in exactly positions. For example, if , and the 01 sequence on the paper is 101, then A must write 001, 111 and 100 on the blackboard.
2. Next, B looks at all the sequences on the blackboard and tries to guess what the sequence on the paper is. Each time he may guess one -digit 01 sequence, and A must honestly tell him whether he guessed correctly.
For each pair , find the smallest positive integer such that B has a guessing strategy guaranteeing that he can guess the correct answer within guesses.
Solution
Let the sequence on the paper be .
First consider . If the first digit of is 1, then on the blackboard there will be sequences starting with 1, and sequences starting with 0; note that . From this we see that B only needs to count the number of sequences starting with 1 versus starting with 0 in order to determine what the first digit of is. Using the same method, B can determine every digit of . Hence B can guess correctly on the very first try.
Now consider . When , it is easy to see that two guesses are needed. When , note that if we flip every digit of on the paper (change 0 to 1 and 1 to 0), then the blackboard will still contain exactly the same set of sequences, so at least two guesses are required. Therefore, it suffices to show that two guesses are enough to guarantee the correct answer:
· If the first two digits of are the same, then on the blackboard, the sequences starting with 01 and those starting with 10 will each number , while the sequences starting with 00 and those starting with 11 will each number .
· Conversely, if the first two digits of are the same, then on the blackboard, the sequences starting with 01 and those starting with 10 will each number , while the sequences starting with 00 and those starting with 11 will each number .
· Since , B only needs to count the corresponding numbers of sequences in order to determine whether the first two digits of are the same.
· By the same reasoning, B can determine whether any two digits of are the same.
· Therefore B only needs to guess what the first digit of is, and this requires at most two guesses. This completes the proof.