## Task 3 - 250823

A security lock has four wheels, each marked with the digits 1 to 9. The lock can only be opened by setting exactly one number combination (a specific digit on each wheel). The owner of such a lock has forgotten the exact number combination at the time of purchase. He only remembers that the digits 1, 4, and 6 each appear exactly once in the number combination. The order of the individual digits has also slipped his mind.

a) How many different settings would have to be tried in the worst case to open the lock?

b) How many different settings would be necessary at most if the owner still remembers which wheel he needs to set the digit 4 on?
a) We start with those number combinations in which the digits 1, 4, 6 appear in this order. In addition to them, there is another unknown digit $x$. Since $x$ is not identical to the digits 1, 4, 6, there are six possibilities for $x$.

Since $x$ can stand at the 1st, 2nd, 3rd, or 4th position in the setting sequence, there are a total of $4 \cdot 6 = 24$ possibilities for the sequence 1, 4, 6.

Analogously, we proceed with the other five possible sequences: 1, 6, 4; 4, 1, 6; 4, 6, 1; 6, 1, 4; 6, 4, 1. In the worst case, therefore, $6 \cdot 24 = 144$ settings have to be made.

b) We start with those number combinations in which the digits 1, 6 appear in this order. In addition to them and the digit 4, there is another unknown digit $x$.

Again, there are six possibilities for $x$. Since $x$ can stand exactly at those three positions in the setting sequence where the digit 4 does not stand, there are a total of $3 \cdot 6 = 18$ possibilities for the sequence 1, 6.

Analogously, we proceed with the other sequence 6, 1. Thus, under the conditions of part b), at most $2 \cdot 18 = 36$ settings would be necessary.