I thought of two secret numbers $A$ and $B$ that are between $1$ and $10$ inclusive. Each turn you can provide me with your guesses $A'$ and $B'$ and I will tell you the sum of the absolute differences, ie. $|A-A'|+|B-B'|$. I will also tell you once your guesses are correct: $A'=A$ and $B'=B$. What is the least number of turns needed for you to guarantee to guess the two secret numbers in the worst case?


1 Answer 1


3 turns

Guess 0 and 0 first. Since numbers are between 1 and 10, so this will give you the value of A + B.
Guess 0 and 10 next. This gives you A + 10 - B. Then solve the two equations to get both secret numbers and guess them in your next turn.

  • $\begingroup$ rot13 (Vfa'g gung 3 thrffrf? Svefg thrff vf (0, 0), frpbaq thrff vf (0, 10), guveq thrff vf gur nafjre) $\endgroup$ Jan 22, 2023 at 23:11
  • $\begingroup$ @ApexPolenta: Is it really a “guess” if it’s the answer? $\endgroup$ Jan 23, 2023 at 3:01
  • 1
    $\begingroup$ @PierrePaquette the question asks how many guesses you need in order to guarantee to guess the values, so you do need the correct values to be one of your "guesses". $\endgroup$ Jan 23, 2023 at 16:11
  • $\begingroup$ @EspeciallyLime fair, updated. $\endgroup$ Jan 23, 2023 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.