Maths Olympiad Prep

Library / /12 of 24

, 2023

Combinatorics Difficulty 6.6 National Olympiad Prove it Canada

Problem:

William is thinking of an integer between 1 and 50, inclusive. Victor can choose a positive integer mm and ask William: "does mm divide your number?", to which William must answer truthfully. Victor continues asking these questions until he determines William's number. What is the minimum number of questions that Victor needs to guarantee this?

Solution

Solution:

The minimum number is 15 questions.

First, we show that 14 or fewer questions is not enough to guarantee success. Suppose Victor asks at most 14 questions, and William responds with "no" to each question unless m=1m=1. Note that these responses are consistent with the secret number being 1. But since there are 15 primes less than 50, some prime pp was never chosen as mm. That means the responses are also consistent with the secret number being pp. Therefore, Victor cannot determine the number for sure because 1 and pp are both possible options.

Now we show that Victor can always determine the number with 15 questions. Let NN be William's secret number. First, Victor asks 4 questions, with m=2,3,5,7m=2,3,5,7. We then case on William's responses.

Case 1. William answers "no" to all four questions.

NN can only be divisible by primes that are 11 or larger. This means NN cannot have multiple prime factors (otherwise N112>50N \geq 11^2 > 50), so either N=1N=1 or NN is one of the 11 remaining primes less than 50. Victor can then ask 11 questions with m=11,13,17,,47m=11,13,17, \ldots, 47, one for each of the remaining primes, to determine the value of NN.

Case 2. William answers "yes" to m=2m=2, and "no" to m=3,5,7m=3,5,7.

There are only 11 possible values of NN that match these answers (2,4,8,16,22,26,32,34,38,442,4,8,16,22,26,32,34,38,44, and 4646). Victor can use his remaining 11 questions on each of these possibilities.

Case 3. William answers "yes" to m=3m=3, and "no" to m=2,5,7m=2,5,7.

There are 5 possible values of NN (3,9,27,333,9,27,33, and 3939). Similar to Case 2, Victor can ask about these 5 numbers to determine the value of NN.

Case 4. William answers "yes" to multiple questions, or one "yes" to m=5m=5 or m=7m=7.

Let kk be the product of all mm's that received a "yes" response. Since NN is divisible by each of these mm's, NN must be divisible by kk. Since k5k \geq 5, there are at most 10 multiples of kk between 1 and 50. Victor can ask about each of these multiples of kk with his remaining questions.

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.