Source: IMO-2012-P3
Category: Operations and Strategies

Problem:
The liar's guessing game is a game played between two players $A$ and $B$. The rules of the game depend on two fixed positive integers $k$ and $n$ which are known to both players.

At the start of the game $A$ chooses integers $x$ and $N$ with $1 \le x \le N$. Player $A$ keeps $x$ secret, and truthfully tells $N$ to player $B$. Player $B$ now tries to obtain information about $x$ by asking player $A$ questions as follows: each question consists of $B$ specifying an arbitrary set $S$ of positive integers (possibly one specified in some previous question), and asking $A$ whether $x$ belongs to $S$. Player $B$ may ask as many questions as he wishes. After each question, player $A$ must immediately answer it with yes or no, but is allowed to lie as many times as she wants; the only restriction is that, among any $k+1$ consecutive answers, at least one answer must be truthful.

After $B$ has asked as many questions as he wants, he must specify a set $X$ of at most $n$ positive integers. If $x$ belongs to $X$, then $B$ wins; otherwise, he loses. Prove that:

\begin{enumerate}[(a)]
  \item If $n \ge 2^k$, then $B$ can guarantee a win.
  \item For all sufficiently large $k$, there exists an integer $n \ge (1.99)^k$ such that $B$ cannot guarantee a win.
\end{enumerate}

Solution:
Call the players Alice and Bob.

Part (a): We prove the following.

**Claim.** If $N \ge 2^{k}+1$, then in $2k+1$ questions Bob can rule out some number in $\{1,\dots,2^{k}+1\}$ from being equal to $x$.

**Proof.** First, Bob asks the question $S_{0}=\{2^{k}+1\}$ repeatedly until Alice answers "yes" or until Bob has asked $k+1$ questions. If Alice answers "no" to all of these, then Bob rules out $2^{k}+1$. So assume Alice eventually says "yes".

Now let $T=\{1,\dots,2^{k}\}$. Then he asks $k$ follow-up questions $S_{1},\dots,S_{k}$ defined as follows:

- $S_{1}=\{1,3,5,7,\dots,2^{k}-1\}$ consists of all numbers in $T$ whose least significant binary digit is $1$.
- $S_{2}=\{2,3,6,7,\dots,2^{k}-2,2^{k}-1\}$ consists of all numbers in $T$ whose second least significant binary digit is $1$.
- More generally, $S_{i}$ consists of all numbers in $T$ whose $i$-th least significant binary digit is $1$.

Without loss of generality, Alice answers all of these "yes" (the other cases are similar). Among the last $k+1$ answers at least one must be truthful, and the number $2^{k}$ (having zeros in all relevant digits) does not appear in any of $S_{0},\dots,S_{k}$ and is therefore ruled out.

Thus, in this way Bob can repeatedly find non-possibilities for $x$ (and then relabel the remaining candidates $1,\dots,N-1$) until he arrives at a set of at most $2^{k}$ numbers.

Part (b): It suffices to consider $n=\left\lceil 1.99^{k}\right\rceil$ and $N=n+1$ for large $k$. At the $t$-th step Bob asks some question $S_{t}$; we phrase each of Alice's answers in the form "$x\notin B_{t}$", where $B_{t}$ is either $S_{t}$ or its complement. (You may think of these as "bad sets"; the idea is to show we can avoid having any number appear in $k+1$ consecutive bad sets, preventing Bob from ruling out any numbers.)

Main idea: for every number $1\le x\le N$, at time step $t$ we define its *weight* to be
\[
w(x)=1.998^{e}
\]
where $e$ is the largest integer such that $x\in B_{t-1}\cap B_{t-2}\cap\dots\cap B_{t-e}$.

**Claim.** Alice can ensure the total weight never exceeds $1.998^{k+1}$ for large $k$.

**Proof.** Let $W_{t}$ denote the sum of weights after the $t$-th question. We have $W_{0}=N<1000N$. We will prove inductively that $W_{t}<1000N$ always.

At time $t$, Bob specifies a question $S_{t}$. Alice chooses $B_{t}$ as whichever of $S_{t}$ or $\overline{S_{t}}$ has the smaller total weight, hence at most $W_{t}/2$. The weights of the elements in $B_{t}$ increase by a factor of $1.998$, while the weights of the elements in $\overline{B_{t}}$ all reset to $1$. So the new total weight after time $t$ is
\[
W_{t+1}\le 1.998\cdot\frac{W_{t}}{2}+ \#\overline{B_{t}}\le 0.999\,W_{t}+N.
\]
Thus, if $W_{t}<1000N$, then $W_{t+1}<1000N$.

To finish, note that $1000N=1000\left(n+1\right)\le 1000\left(1.99^{k}+2\right)<1.998^{k+1}$ for large $k$.

In particular, no individual number can have weight $1.998^{k+1}$. Hence for every time step $t$ we have
\[
B_{t}\cap B_{t+1}\cap\dots\cap B_{t+k}=\varnothing.
\]
Then once Bob stops, if he declares a set of $n$ positive integers and $x$ is an integer Bob did not choose, Alice's question history is consistent with $x$ being Alice's number, because among any $k+1$ consecutive answers she claimed that $x\in\overline{B_{t}}$ for some $t$ in that range.


Grading guidelines:
(Partial) 1. For part (a), gave a correct strategy/argument showing how to eliminate at least one candidate number using the “among any k+1 answers one is true” condition (e.g. repeating one query k+1 times to force a truthful answer and hence rule out a value). 2. For part (a), used binary-digit queries (or an equivalent coding idea) to argue that from k+1 consecutive answers one can exclude at least one of 2^k+1 numbers, leading to a reduction toward a final candidate set of size ≤2^k. 3. For part (b), introduced a quantitative invariant (weights/potential) and the idea that Alice answers by choosing the lighter of S_t and its complement to keep the invariant bounded. (Almost) 1. Part (a) is complete, and part (b) has the full weight strategy with a correct inequality of the form W_{t+1}≤cW_t+N (c<1) implying W_t=O(N), but the write-up fails to justify the final comparison O(N)<1.998^{k+1} for large k (or uses incorrect constants while the method would work with adjusted bases). 2. Part (b) correctly derives that no element can lie in k+1 consecutive bad sets (hence Bob cannot rule out any number), but does not clearly explain why this implies that after Bob outputs any set X of size ≤n, some x∉X remains consistent with all answers (missing the final consistency/quantifier step). 3. Solution is almost complete, but made minor mistakes which are not negligible.