Maths Olympiad Prep

Library / /310 of 397

, 2023

Combinatorics Difficulty 6.7 National Olympiad Prove it Taiwan

II-C. Two squids are forced to participate in a game. Before it begins, they will be informed of all the rules, and can discuss their strategy freely. Then, they will be locked in separate rooms, and be given distinct positive integers no larger than 20232023 as their IDs respectively. The two squids then take turns alternatively; on one's turn, the squid chooses one of the following:
1. announce a positive integer, which will be heard by the other squid;
2. declare which squid has the larger ID. If correct, they win and are released together; otherwise, they lose and are fired together.
Find the smallest positive integer NN so that, no matter what IDs the squids have been given, they can always win in a finite number of turns, and the sum of the numbers announced during the game is no larger than NN.

Solution

The answer is N=10N = 10, where 「」 denotes the ceiling function. In general, if the given IDs must not exceed MM, then the smallest N=log2M1N = \lceil \log_2 M \rceil - 1.

Construction: Label the two squids 11 and 22, with their given IDs being D1D_1 and D2D_2 respectively. When M2N+1M \le 2^{N+1}, the IDs can be represented as
Di=pi,12N+pi,22N1++pi,N21+1=1+j=1Npi,j2N+1j, D_i = p_{i,1} 2^N + p_{i,2} 2^{N-1} + \dots + p_{i,N} 2^1 + 1 = 1 + \sum_{j=1}^{N} p_{i,j} 2^{N+1-j},
where pi,j{0,1}p_{i,j} \in \{0,1\}. For convenience, let pi,jp_{i,j} denote the value of pi,jp_{i,j} for the squid whose turn it is on turn ii, that is,
pi,j={p1,ji1(mod2)p2,ji0(mod2) p_{i,j} = \begin{cases} p_{1,j} & i \equiv 1 \pmod{2} \\ p_{2,j} & i \equiv 0 \pmod{2} \end{cases}
Similarly define DiD_i as the ID of the squid whose turn it is on turn ii.

Let k0=0k_0 = 0, and consider the following strategy: if on turn ii the squid cannot yet determine which ID is larger, have it compute
ki=min{k:pi,k=1,k>ki1}. k_i = \min\{k : p_{i,k} = 1, k > k_{i-1}\}.
and have it announce kiki1k_i - k_{i-1}. It is easy to see that the sum of the numbers announced up through turn ii is kiNk_i \le N. Furthermore, since kik_i is strictly increasing, it must be that after finitely many turns {k:pi,k=1,k>ki1}=\{k : p_{i,k} = 1, k > k_{i-1}\} = \emptyset; we need only show that the squids will correctly determine which ID is larger before this situation occurs. To this end, let us define the sets
S(k):={{(D1,D2):1D1,D2M}k=0{(D1,D2):p1,1=p2,1,,p1,k=p2,k}k1 S(k) := \begin{cases} \{(D_1, D_2) : 1 \le D_1, D_2 \le M\} & k = 0 \\ \{(D_1, D_2) : p_{1,1} = p_{2,1}, \dots, p_{1,k} = p_{2,k}\} & k \ge 1 \end{cases}

First, we prove by mathematical induction that: at the end of turn ii, either "the squids know (D1,D2)S(ki1)(D_1, D_2) \in S(k_{i-1})" or "one of the squids can determine which ID is larger." The case i=1i=1 is obvious. Suppose the claim holds for ii; then on turn i+1i+1:
(a) since no determination was made on the previous turn, by the induction hypothesis the squids know (D1,D2)S(ki1)(D_1, D_2) \in S(k_{i-1});
(b) since kiki1k_i - k_{i-1} was announced on the previous turn, by the definition of kik_i, the squids know pi,ki1+1==pi,ki1=0p_{i,k_{i-1}+1} = \cdots = p_{i,k_{i}-1} = 0 and pi,ki=1p_{i,k_i} = 1.

At this point there are several cases:
- There exists ki1<<kik_{i-1} < \ell < k_i such that pi+1,=1p_{i+1,\ell} = 1; then using (a) and (b) we may derive the following relation and determine which is larger:
Di+11+j=1ki1pi+1,j2N+1j+2N+1>1+j=1ki1pi,j2N+1j+j=+1N2N+1jDi D_{i+1} \ge 1 + \sum_{j=1}^{k_{i-1}} p_{i+1,j} 2^{N+1-j} + 2^{N+1-\ell} > 1 + \sum_{j=1}^{k_{i-1}} p_{i,j} 2^{N+1-j} + \sum_{j=\ell+1}^{N} 2^{N+1-j} \ge D_i
- If not, and pi+1,ki=0p_{i+1,k_i} = 0, then the squids can use (a) and (b) to derive the following relation and determine which is larger:
Di+11+j=1ki1pi+1,j2N+1j+j=+1N2N+1j<1+j=1ki1pi+1,j2N+1j+2N+1Di D_{i+1} \le 1 + \sum_{j=1}^{k_{i-1}} p_{i+1,j} 2^{N+1-j} + \sum_{j=\ell+1}^{N} 2^{N+1-j} < 1 + \sum_{j=1}^{k_{i-1}} p_{i+1,j} 2^{N+1-j} + 2^{N+1-\ell} \le D_i
- If neither of the above holds, then p1,j=p2,jp_{1,j} = p_{2,j} for all ki1<jkik_{i-1} < j \le k_i, so we know (D1,D2)S(ki)(D_1, D_2) \in S(k_i).

* If pi+1,j=0p_{i+1,j} = 0 for all j>kij > k_i, then based on (D1,D2)S(ki)(D_1, D_2) \in S(k_i) and the uniqueness of the IDs, the squids can deduce the following relation and thereby determine which is larger:
Di+1=1+j=1kipi+1,j2N+1j1+j=1kipi,j2N+1j+2Di D_{i+1} = 1 + \sum_{j=1}^{k_i} p_{i+1,j} 2^{N+1-j} \le 1 + \sum_{j=1}^{k_i} p_{i,j} 2^{N+1-j} + 2 \le D_i
* If not, then {k:pi,k=1,k>ki1}\{k : p_{i,k} = 1, k > k_{i-1}\} is nonempty, so the squids can successfully compute ki+1k_{i+1}.

Lower bound: We need only show that when M=2k+1M = 2^k + 1, it is impossible to guarantee a win while announcing numbers summing to less than kk.

Let us proceed by mathematical induction on kk. The case k=1k=1 is obvious. Suppose the claim holds for all k<Kk < K. Note that the first squid can only declare which is larger directly on the first turn when D1=1D_1 = 1 or D1=MD_1 = M. Aside from these two cases, for i=1,2,,K1i=1,2,\dots,K-1, suppose the first squid announces ii when D1AiD_1 \in A_i; then there must exist some ii such that Ai2Ki+1|A_i| \ge 2^{K-i} + 1, otherwise
2K1={2,3,,M1}=i=1K1Ai2K1+2K2++21<2K1 2^K - 1 = |\{2,3,\dots,M-1\}| = \left| \bigcup_{i=1}^{K-1} A_i \right| \le 2^{K-1} + 2^{K-2} + \dots + 2^1 < 2^K - 1
which is a contradiction. This means that after the first turn ends, there are at least 2Ki+12^{K-i} + 1 possible values of D1D_1, and all 2Ki+12^{K-i} + 1 of these could also be possible values of D2D_2. Thus, starting from the second turn onward, the game can be viewed as one with at least 2Ki+12^{K-i} + 1 possible ID values, but where the sum of the numbers announced must be less than KiK-i (since ii has already been announced on the first turn); by the induction hypothesis, a win cannot be guaranteed in this case. This completes the proof.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement translated into English from zh; metadata (topic, difficulty) added by this project.