# Task 4.

In modern conditions, digitalization - the conversion of all information into digital code - is considered relevant. Each letter of the alphabet can be assigned a non-negative integer, called the code of the letter. Then, the weight of a word can be defined as the sum of the codes of all the letters in that word. Is it possible to encode the letters Е, О, С, Т, Ш, Ь with elementary codes, each consisting of a single digit from 0 to 9, so that the weight of the word "СТО" is not less than the weight of the word "ШЕСТЬСОТ"? If such encoding is possible, in how many ways can it be implemented? If such encoding is possible, does it allow for the unambiguous restoration of a word from its code?
# Solution.

Let $k(x)$ denote the elementary code of the letter $x$. We have

$k(C)+k(T)+k(O) \geq k(\amalg)+k(\mathrm{E})+k(C)+k(T)+k(\mathrm{~b})+k(C)+k(O)+k(T)$, which is equivalent to

$$
k(\amalg)+k(\mathrm{E})+k(C)+k(T)+k(\mathrm{~b})=0 .
$$

Thus,

$$
k(\amalg)=k(\mathrm{E})=k(C)=k(T)=k(\mathrm{~b})=0 .
$$

The elementary code $k(O)$ can be any digit from 0 to 9. Therefore, there are exactly 10 ways to encode.

However, for any choice of $k(O)$, the words "TOCT" and "TOT" (for example) will have the same code $k(O)$, which cannot be decoded uniquely.

Answer. The inequality for the weights holds if and only if $k(\amalg)=k(\mathrm{E})=k(C)=k(T)=k(\mathrm{~b})=0$.

There are exactly 10 ways to encode.

In any of them, unique decoding is impossible.