We call a sequence of length $n$ of zeros and ones a "string of length $n$" and the elements of the same sequence "bits". Let $m,n$ be two positive integers so that $m<2^n$. Arik holds $m$ strings of length $n$. Giora wants to find a new string of length $n$ different from all those Arik holds. For this Giora may ask Arik questions of the form: "What is the value of bit number $i$ in string number $j$?" where $1\leq i\leq n$ and $1\leq j\leq m$. What is the smallest number of questions needed for Giora to complete his task when: a) $m=n$? b) $m=n+1$?
Problem
Source: 2022 Grosman Mathematical Olympiad P2
Tags: combinatorics
23.09.2022 00:59
a) The answer is $n$. Let $a(i,j)$ be the answer to the question. Basically using Cantor's diagram, we can just construct the string whose $i$_th number is $s(i)=1-a(i,i)$. This is different from each string (it differsfrom the $i$th string in the $i$th element). $n$ is also the minimum because we can check at most $n-1$ strings, so the one we construct might be equal to the one we didn't check. b)The answer is $n+2$. Apply the same algorhytm, except that at the beginning we check $a(1,1),a(1,2),a(1,n+1)$. At least two of these three are equal by php so wlog $a(1,1)=a(1,n+1)$. Applying the rest of the algorhytm, we again get that the constructed sequence is different ftom the $(n+1)$th because $s(1)=1-a(1,1)=1-a(1,n+1)$. To show that $n+2$ is the minimum, note that again we must at least check $n+1$ bits (one per string). By php, we must have chosen a position at least twice. However, if two bits of the revealed ones in this position are different, we can't guarantee that the constructed string will be different from both, since we only checked that position from both strings (if we checked more than one postiton per string we would have already checked at least $n+2$ bits).