Maths Olympiad Prep

Library / /30 of 30

Combinatorics Difficulty 9.1 IMO level Prove it Germany

Problem:

Let kk and nn be positive integers with n>kn>k. By a binary word of length nn we mean a sequence of nn terms, each of which is 0 or 1. Anja chooses one word among all possible binary words of length nn. She then writes on a board all binary words of length nn that differ from her chosen word in exactly kk positions. Afterwards Bernhard enters the room. Anja tells him the value of kk, and he then looks at the binary words on the board. He now tries to guess the binary word that Anja chose at the beginning. What is (as a function of kk and nn) the minimal number of attempts that Bernhard needs in order to guess the binary word with certainty?

Solution

Solution:

The answer is: If n2kn \neq 2 k then Bernhard can always guess the word chosen by Anja on the first attempt; in the case n=2kn=2 k he needs two attempts to guess the word with certainty. We denote the word chosen by Anja at the beginning by uu.

Case 1: n2kn \neq 2 k. Let 1in1 \leq i \leq n be arbitrary. Among all (nk)\binom{n}{k} words on the board, exactly (n1k)\binom{n-1}{k} agree with uu at the ii-th position and (n1k1)\binom{n-1}{k-1} differ from uu at the ii-th position. A simple computation shows that in the case n2kn \neq 2 k we also have (n1k)(n1k1)\binom{n-1}{k} \neq \binom{n-1}{k-1}, that is, by looking at the ii-th positions of all the words on the board, Bernhard can deduce the ii-th position of uu. Since this works for all i=1,,ni=1, \ldots, n, Bernhard can uniquely determine the word uu chosen by Anja at the beginning, and thus guesses it on the first attempt in this way.

Case 2: n=2kn=2 k. We first show that Bernhard cannot uniquely deduce uu, that is, he may need more than one attempt. Suppose Anja had chosen the (unique) binary word uˉ\bar{u} that differs from her actual word uu in all positions. An arbitrary binary word of length nn agrees with uu in exactly k=n/2k=n / 2 positions if and only if it agrees with uˉ\bar{u} in exactly k=n/2k=n / 2 positions, that is, in this case Anja would have written exactly the same binary words on the board. This means that Bernhard has no way of distinguishing between uu and uˉ\bar{u}, and on his first attempt to guess Anja's word he might be wrong. We now show that Bernhard can always succeed in two attempts. For this it suffices to prove that for every binary word ww of length nn different from uu and uˉ\bar{u}, the set of all binary words of length nn that differ from ww in exactly k=n/2k=n / 2 positions is not identical to the set of words on the board. To this end we may assume without loss of generality that ww differs from uu in exactly aa positions, where 0<ak=n/20<a \leq k=n / 2 (otherwise consider uˉ\bar{u} instead of uu). Then we can change exactly kk of the remaining nakn-a \geq k positions and obtain a word ww' that differs from ww in exactly kk positions, but from uu in a+k>ka+k>k positions, that is, it is not on the board.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement translated into English from de; metadata (topic, difficulty) added by this project.