# 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 letter code. 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 O, P, S, T, Ь, Я 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, 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(\Pi)+k(\text { ( })+k(T)+k(\mathrm{~b})+k(C)+k(O)+k(T)
$$

which is equivalent to

$$
k(\Pi)+k(T)+k(\mathrm{~b})+k(\text { Я) }=0
$$

from which it follows that

$$
k(\Pi)=k(T)=k(\mathrm{~b})=k(\text { Я })=0
$$

The elementary codes of the two remaining letters $k(C)$ and $k(O)$ can be any digits from 0 to 9. Therefore, there are exactly $10^{2}$ ways to encode them. However, for any choice of $k(O)$ and $k(C)$, the words "ПОП" and "ТОТ" will have the same codes $k(O)$, which cannot be decoded uniquely.

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

There are exactly 100 ways to encode them.

In any of these ways, unique decoding is impossible.