Guessing game where opponent can lie

134 Views Asked by At

I encountered the following problem:

Your opponent chooses a number $n \in \{1, \dots, m\}$ (where $m$ is a power of $2$) and your task is to guess it. You are allowed to ask only $m$ questions of type: "Is the number in the set X?" for $X \subset \{1, \dots, m\}$. However, the opponent need not to always answer truthfully and may lie less than $m/4$ times (i.e. in at most $m/4 - 1$ answers).

The source suggest that there is a winning strategy (I assume that for us) and that it is related to error correction codes.

I tried to use induction of $m$ ($2^{k-1} \to 2^k$) but failed. It is easily achievable to detect the half of $\{1, \dots, m\}$ in which $n$ lies, but not to force the opponent to spend a half of opportunities to lie.

Since it has something to do with error correction codes, I also tried to get some new insights by constructing a code which translates the words from $\mathbb{Z}_2^{\log_2 m}$ ($m$ in binary) to $\mathbb{Z}_2^m$ (sequence of answers, some of them are lies). The code needs to have distance at least $m/2$ to detect $m/4$ "errors" (code distance = minimal Hamming distance between the code words).

However, just having the code is not sufficient. It is also necessary to have the proper set of questions which makes the translation (i.e. the coding function). Then it is possible to ask the questions and reconstruct the number $n$ from the answers (i.e. correct the errors and deduce the $n$). But now, it is an idea which is very far for anything concrete.

1

There are 1 best solutions below

1
On BEST ANSWER

Here's a start.

Let $m = 2^k$. Consider the Hadamard code $[2^k,k, 2^{k - 1}]_2$. Every number $n \in {1, \ldots, m}$ corresponds to a codeword $Had(n)$ of length $m$, i.e. a sequence of $m$ bits. For each $i \in {1, \ldots, m}$, let $X_i$ be the set $$X_i = \{n \in \{1, \ldots, m\} | \text{the }i\text{-th bit of Had}(n)\text{ is }1 \}.$$

There's the obvious $m$ questions you can ask, and since your opponent only lies $m/4 - 1$ times at most, you will be able to decode the codeword to the correct number.