# How to open the lock from this safe?

The puzzle is as follows:

The figure from below shows a lock mechanism used to store sensitive data microfilms from a certain lab.

This mechanism is magnetic and consists in numbered buttons which allow them to be moved.

The only valid movements are non-rotating exchanges between two contiguous tiles that are in the same row.

How many exchanges at least must be made so that, considering three-digit numerals row by row, the sum of the two upper rows equals the last row? Assume this way is the only method to open the safe without turning on the alarm.

The alternatives given in my book are as follows:

1. 5
2. 2
3. 4
4. 3

I'm not very sure on how to approach this puzzle because it seems not possible to be solved, or could it be that am I just missing the obvious?

The 3 and 4 must be together to add up 7. Thus the only other possible choices must be swap the remaining numbers. I believe that the only possible solution (assuming that this problem is wrong) could be:

8-5-3

1-6-4

9-2-7

Thus the answer would be 2 with those pairs being 8 and 5 and 1 and 6. The other part which does seem to be misleading is the meaning of exchanges? Does it account for pairs or individual movements?*

If so that would be 4, in other words taking out 8 and putting it onto the place of 5 and vice-versa.

Is this reasonable or what? Can someone help me here with some sort of strategy? Maybe there's a method or something which could be done.

This was obtained from my Logical games book from 2000s and it seems to be an adaptation from Martin Gardner's Puzzle carnival from 1970s.

• You've been posting a lot of questions from this particular source recently, and I understand you might want to know the answers to the ones you can't solve, but you don't seem to have been waiting for answers to previous questions and haven't accepted many. Perhaps try again on the problems you haven't been able to solve, as if you post too many from one place, it'll reach the point where you're just simply writing out the entire book on this site – Beastly Gerbil Jan 20 at 10:25
• @BeastlyGerbil Sorry to give that impression. I thought that I could get some help. I do really want to give my best effort. Next time I'll be more patient and analize it better. – Chris Steinbeck Bell Jan 20 at 10:51

It seems like the parameters of the questions are as follows

- We may swap two adjacent digits in the same row and that counts as one move.
- In the end, the 3-digit number in the first row plus the three-digit number in the second row must equal the three-digit number in the third row.

Under these conditions it looks like the minimum number of moves we need is

3

Reasoning

Given the arrangement of digits into three sets $$\{3,5,8\}, \{1,4,6\}, \{2,7,9\}$$, there are only two ways that a pandigital sum can be formed by constructing numbers using each set such that the third set is the sum of the other two, namely

$$358 + 614 = 972$$
$$583 + 146 = 729$$

For the first sum, we see that the $$614$$ is already in place. To get the $$358$$ requires two moves $$583 \rightarrow 538 \rightarrow 358$$ and to get the $$972$$ requires one move $$927 \rightarrow 972$$, so overall, three moves.
For the second sum, we see that the $$583$$ is already in place. To get the $$146$$ requires two moves $$614 \rightarrow 164 \rightarrow 146$$ and to get the $$729$$ requires three moves $$927 \rightarrow 972 \rightarrow 792 \rightarrow 729$$, so overall we have five moves.
Hence, 3 is the best we can do.