Sixteen possibilities and one answer that may be false. All questions must be fixed before the game begins.
Sixteen Numbers and One Lie
Riddle statement
I am thinking of an integer between 1 and 16.
You may ask any questions whose answers are yes or no, with one condition: every question must be prepared before you receive the first answer. You may not change them afterwards.
I will answer every question, but I may lie at most once during the conversation. I may also tell the truth every time.
What is the smallest number of questions that guarantees you can determine the number?
Show solution
Solution
Answer: exactly 7 questions are required.
Why six are not enough
Suppose we ask \(q\) questions. Every number has a sequence of \(q\) truthful answers.
Because one lie is allowed, that number may produce \(q+1\) different received sequences:
- the truthful sequence;
- one for each possible altered answer.
Sequences belonging to different numbers must not overlap, or the chosen number could not be identified.
With six questions, we would need
different sequences, but only
exist.
Thus six questions, and therefore any smaller number, cannot suffice.
How seven questions work
Write the chosen number minus one in binary using four bits:
where \(a\) is the most significant bit.
Let \(\oplus\) denote addition modulo 2: it equals 1 when an odd number of its inputs are 1.
Prepare these seven truthful answers:
Question \(i\) is simply:
Is \(c_i=1\)?
After receiving \(r_1,\ldots,r_7\), calculate:
If every answer was truthful, all three parities are zero.
If one answer was false, the number
gives its exact position from 1 to 7. Correct \(r_j\), then recover:
Those four bits determine \(n-1\), and hence the chosen number.
Therefore seven questions suffice while six do not:
The fit is perfect:
Each of the 16 numbers occupies exactly eight possible received sequences: the truthful one and the seven containing one lie.
Key idea: the three parity checks do more than detect a false answer; they identify exactly which answer must be corrected.