MathDB
Problems
Contests
International Contests
International Olympiad of Metropolises
2021 IOM
5
5
Part of
2021 IOM
Problems
(1)
Crack the code!
Source: IOM 2021 #5
12/10/2021
There is a safe that can be opened by entering a secret code consisting of
n
n
n
digits, each of them is
0
0
0
or
1
1
1
. Initially,
n
n
n
zeros were entered, and the safe is closed (so, all zeros is not the secret code).In one attempt, you can enter an arbitrary sequence of
n
n
n
digits, each of them is
0
0
0
or
1
1
1
. If the entered sequence matches the secret code, the safe will open. If the entered sequence matches the secret code in more positions than the previously entered sequence, you will hear a click. In any other cases the safe will remain locked and there will be no click.Find the smallest number of attempts that is sufficient to open the safe in all cases.
combinatorics