My calculator has the usual number keys:
0123456789
Dave swapped two number keys around, and won't give it back until I work out which keys he's swapped.
I can give him one sum, using one or more of the basic operators +−÷×
, and he will tell me the result on the screen after he presses the equals key.
What sum should I give, so that I will know what keys were swapped when he tells me the result? Or is this simply not possible?
Answer
Perhaps the most obviously correct way to do this is
123456789 + 123456789
because
You can halve the result, producing the number that the key sequence 123456789 corresponds to (as the key swap will affect both halves equally), and then you'll know which digit each of the keys from 1 to 9 corresponds to (and can determine 0 by elimination). This actually works for any permutation of the number keys, not just swaps.
No comments:
Post a Comment