D
D
Deathgar2018-09-17 12:20:02
Linear algebra
Deathgar, 2018-09-17 12:20:02

Given 2 unknown numbers, their sum modulo 33, as well as their difference modulo 33, how to find these numbers?

Verbatim task:
An unknown sequence of integers is used to encrypt a message.
Each letter of the message was previously replaced by its serial number in the alphabet (A for 1, ..., Z for 33). Then the next member of the sequence was added to it and, finally, the remainder of dividing this sum by 33 was written out.
This is what happened:
30 11 7 24 29 11 15 18 15 32 9 3 10 1 26
24 the members of the sequence were subtracted, it would be
6 24 31 10 24 27 20 12 5 13 15 23 21 16 19 31
Find the original message.
As far as I understand, we have two equations for the first numbers:
x + y = 30 (mod 33)
x - y = 6 (mod 33)
How to find x and y?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Deathgar, 2018-09-24
@Deathgar

Based on what was written below, I made it in C#. If anyone needs it.
The bottom answer is also correct, but you need to shift the indices in the end.

static string Posl(int[] a, int[] b)
        {
            string rez = "";
            int[] c = new int[a.Length];
            for (int i = 0; i < a.Length; i++)
            {
                c[i] = a[i] + b[i];

                if ((c[i] & 1) == 1)
                {
                    c[i] += 33;
                    c[i] /= 2;
                    c[i] %= 33;
                }
                else
                {
                    c[i] /= 2;
                    c[i] %= 33;
                }
                Console.WriteLine(c[i]);
                rez += alf[c[i] - 1];

            }
            return rez;
        }

L
longclaps, 2018-09-17
@longclaps

for a, b in zip([30, 11, 7, 24, 29, 11, 15, 18, 15, 32, 9, 3, 10, 1, 26, 24],
                [6, 24, 31, 10, 24, 27, 20, 12, 5, 13, 15, 23, 21, 16, 19, 31]):
    c = a + b
    if c & 1:
        c -= 33
    print('АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ'[c // 2], end='')

Some nonsense:
'СБТРЙТБОЙЁЛМЯШЁК'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question