Maths Olympiad Prep

Library / /18 of 19

, 2021

Combinatorics Difficulty 5.7 AIME, harder Prove it United States

Problem:

Bob knows that Alice has 20212021 secret positive integers x1,,x2021x_{1}, \ldots, x_{2021} that are pairwise relatively prime. Bob would like to figure out Alice's integers. He is allowed to choose a set S{1,2,,2021}S \subseteq \{1,2, \ldots, 2021\} and ask her for the product of xix_{i} over iSi \in S. Alice must answer each of Bob's queries truthfully, and Bob may use Alice's previous answers to decide his next query. Compute the minimum number of queries Bob needs to guarantee that he can figure out each of Alice's integers.

Solution

Solution:

In general, Bob can find the values of all nn integers asking only log2n+1\left\lfloor\log_{2} n\right\rfloor+1 queries.

For each of Alice's numbers xix_{i}, let QiQ_{i} be the set of queries SS such that iSi \in S. Notice that all QiQ_{i} must be nonempty and distinct. If there exists an empty QiQ_{i}, Bob has asked no queries that include xix_{i} and has no information about its value. If there exist i,j,iji, j, i \neq j such that Qi=QjQ_{i}=Q_{j}, xix_{i} and xjx_{j} could be interchanged without the answer to any query changing, so there does not exist a unique sequence of numbers described by the answers to Bob's queries (Alice can make her numbers distinct).

From the above, log2n+1\left\lfloor\log_{2} n\right\rfloor+1 is a lower bound on the number of queries, because the number of distinct nonempty subsets of {1,,n}\{1, \ldots, n\} is 2n12^{n}-1.

If Bob asks any set of queries such that all QiQ_{i} are nonempty and disjoint, he can uniquely determine Alice's numbers. In particular, since the values x1,,x2021x_{1}, \ldots, x_{2021} are relatively prime, each prime factor of xix_{i} occurs in the answer to query SjS_{j} iff jQ(i)j \in Q(i) (and that prime factor will occur in each answer exactly to the power with which it appears in the factorization of xix_{i}). Since all Q(i)Q(i) are unique, all xix_{i} can therefore be uniquely recovered by computing the product of the prime powers that occur exactly in the answers to queries Q(i)Q(i).

It is possible for Bob to ask log2n+1\left\lfloor\log_{2} n\right\rfloor+1 queries so that each ii is contained in a unique nonempty subset of them. One possible construction is to include the index ii in the jjth query iff the 2i12^{i-1}-value bit is set in the binary representation of jj. So the answer is log22021+1=11\left\lfloor\log_{2} 2021\right\rfloor+1=11.

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 reproduced verbatim; metadata (topic, difficulty) added by this project.