## Task 21/62

![](https://cdn.mathpix.com/cropped/2024_06_06_1d2be4837fb839c2b31dg-046.jpg?height=223&width=1010&top_left_y=891&top_left_x=523)

In a keyless padlock, the bolt part with four identical and equally spaced teeth on one side is inserted into a sleeve with four identical rings that can rotate independently around the bolt axis (see figure). This is only possible in a specific position of the rings, as is the opening of the lock.

On the rings, six letters are engraved; four of them (one per ring) form the known key word when in the open position.

a) How many different key words are possible with this construction at each lock? A "key word" is any (even nonsensical) combination of four letters.

b) Compare the security of this lock with that of a similar lock that has six rings with four letters each.

c) How many different rings with six different letters from the 26 letters of the alphabet can the manufacturing company produce?

Rings are considered the same if they have the same letters (regardless of order) and the notch is under the same letter.

d) How many locks with different key words can be made from these rings?
a) First, one can set the first ring in six different positions. Then, for each of these positions, six positions of the second ring are possible. Thus, there are already 36 different possibilities for the first two rings.

For each of these, the third ring can again be set in six different ways, resulting in 216 settings.

Finally, this number is multiplied by six again when the last ring is set, so that a total of 1296 different settings result.

In general, it can be shown that with $n$ rings each with $m$ numbers, $m^{n}$ different keywords can be formed.

b) From the solution of a) it follows immediately:

1. A lock with four rings, each with six letters, contains 1296 keywords,
2. A lock with six rings, each with four letters, contains 4096 keywords.

The security of the second lock is therefore in the ratio of $4096: 1296 \approx 3: 1$ to that of the first, i.e., the second lock is about three times as secure as the first.

c) It is necessary to determine how many possibilities there are to select $k$ (in our case $k=6$) different elements from $n$ (in our case $n=26$) different elements.

First, one can select a letter from the 26 letters in 26 different ways.

For each of these 26 possibilities, there are now 25 possibilities for selecting a second letter, making a total of $26 \cdot 25$.

However, it is easy to see that each combination of letters appears twice: for example, to $c$ the letter $d$ is chosen once and to $d$ the letter $c$ is chosen once. Therefore, the product 26 $\cdot$ 25 must still be divided by two to obtain the number of different possibilities. For each of these possibilities, there are again 24 new selection possibilities for the third letter, but each combination of letters appears multiple times: for example, to $(a b)$ the letter $c$ is added once, to $(b c)$ the letter $a$ is added once, and to $(a c)$ the letter $b$ is added once. There are no other combinations of the three elements $a, b$, and $c$. Thus, the number of $26 \cdot 25 \cdot 24$ combinations is now reduced to $\frac{26 \cdot 25 \cdot 24}{1 \cdot 2 \cdot 3}=2600$.

One can see how the development continues:

In general, the number of combinations of $k$ elements from $n$ elements is given by

$$
x=\frac{n \cdot(n-1) \cdot(n-2) \cdot \ldots \cdot(n-k+1)}{1 \cdot 2 \cdot 3 \cdot \ldots \cdot k}
$$

in our case, therefore, $x=230230$.

Since each of the rings can have the notch under any letter, this number must still be multiplied by six: $230230 \cdot 6=1381380$. Thus, there are 1381380 different rings.

d) Since each of the 26 letters can appear on each of the four rings of a lock, the task is to determine how many different combinations of 4 out of 26 letters there are, where the order matters but each letter can repeat up to four times.

First, one can select 26 letters; for each of these 26 possibilities, one can again choose a second letter in 26 different ways, so that one already has $26 \cdot 26=26^{2}$ possibilities.

One then considers further that the number is again multiplied by 26 when selecting the third letter: $26^{3}$. When selecting the fourth, there are then $26^{4}=456976$ different possibilities. Clearly, the same formula as in a) applies generally.