You are on page 1of 2

02249 COMPUTATIONALLY HARD PROBLEMS

Exercise 1.5

Olga Athanasopoulou
s192619
Answers:

a) The alphabet used is:


Σcipher = {A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z}

b) The definition for the Lcipher language is:


52
Lcipher = {w ∈ Σ cipher | (∀ xi ∈ wl, 0 ≤ I < 52: (i%2 == 0) => xi ≠ xi+1) ∧ (∀ xi, xj, xk ∈ wl : (i≠j≠k) ∧
(xi = xj) => xi≠xk)}

The cipher will be encoded in a word where in every other symbol a different encoding will
start, ie the encoding of the letters will be given in consecutive pairs. The size of the word can
only be 52 (26*2) because there must be a mapping for each letter (a monoalphabetic cipher
follows an one-to-one relationship).

Because the even indices of the symbols in the word correspond to the starting symbol in each
relationship (the one that is encoded) and they can't be encoded to themselves, we make sure
they aren't by stating (using the modulus function) that they must be not equal to the symbol
right after them (the one to which it's been encoded).

Finally, we have to state that for any three different indices in the word, only up to two of them
can be equal, since every symbol must be used only twice in the word (once as the symbol to
be mapped and once as the symbol another one maps to).

c) In order for a word to belong to the Lcipher language, it has to satisfy the following conditions:
◦ Is comprised exclusively of letters included in the Σcipher alphabet
◦ Has a length of 52
◦ For all letters with even indices in the word, the following one has to be different than it
◦ Each letter in the alphabet can appear only twice in the word
By checking whether these conditions are true, we can make sure that a word belongs to
Lcipher.

d) Given the definition of Lcipher provided previously, the Ceasar cipher would be encoded as the
following word:
w = ABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZA

You might also like