13
$\begingroup$

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?

$\endgroup$

1 Answer 1

15
$\begingroup$

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.

$\endgroup$
4
  • $\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 at 23:11
  • $\begingroup$ @ApexPolenta: Is it really a “guess” if it’s the answer? $\endgroup$ Jan 23 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 at 16:11
  • $\begingroup$ @EspeciallyLime fair, updated. $\endgroup$ Jan 23 at 16:29

Your Answer

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

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