In: Computer Science
Encoding a message starts with assigning each letter of the
alphabet with a positive integer using a
specific pattern, thus rewriting the original message as a list of
numbers instead of words. Decoding
a message is the process that “undoes” the encoding process. Assume
that the table below was
used to encode an important secret message.
A – 1 F – 6 K – 11 P – 16 U – 21 Z – 26
B – 2 G – 7 L – 12 Q – 17 V – 22 Blank - 27
C – 3 H – 8 M – 13 R – 18 W – 23
D – 4 I – 9 N – 14 S – 19 X – 24
E – 5 J – 10 O – 15 T – 20 Y – 25
You intercepted the following encoded message from Boris and
Natasha.
25 19 19 30 41 17 15 26 27 41 15 28 18 41 18 29 41 34 22 19 41 27
15 34 22
You do not know the encoding or decoding function, but you know
this message consists of 6 words.
Using the encoding system described above, answer the following
questions.
Analysis
1. From previous work with Boris and Natasha, you know that their
encoding and decoding functions
are always linear and have 1 as the coefficient of x. Write the
general form of the linear function
that could be used to decode the message.
Inquiry and Evaluation
2. What strategy would you use to decode the message? Write your
answer in complete sentences
using proper grammar, appropriate capitalization and correct
spelling.
Evaluation
3. Write the decoding function. Use proper function notation.
Synthesis
4. What is the decoded message?
5. Why is it necessary for the encoding function to be
one-to-one? Give a clear, thorough,
explanation specific to this assignment. Use complete sentences,
correct spelling, appropriate
capitalization, and proper grammar.
Given encoded message is:-
25 19 19 30 41 17 15 26 27 41 15 28 18 41 18 29 41 34 22 19 41 27 15 34 22
1) given, coefiicient of x = 1,
function type is linear
we know that general form for linear equation is
where , x = decoded text
y = encoded text
c = constant
A = coefficient of x
given that A =1
so, the required general form of the linear function
that could be used to decode the message is:
......... eq(1)
2) Strategy to decode the message :-
Since, we know that there are 6 words in the given encoded message , hence we can say that there are 5 blanks in the encoded message.
Now, we can find the number which id repeated 5 times in the encoded message and subsitute that value in place of y and the value given for blank (blank = 27, given ) in place of x and find the of c, and hence we can generate the decoding function.
3) Using the above strategy,
we get the number repeating 5 times is 41
hence, y = encoded text for blank = 41
x = code for blank =27
putting the values of x and y in eq(1), we get
y = x + c
41 = 27 + c
c = 41 - 27 = 14
hence , the decoding function is : -
4) Using , the above decoding function we get,
Encoded value |
Decoding function y = x + 14 |
Decoded value | Decoded text |
25 | 25 = x + 14 , x= 25 - 14 = 11 | 11 | K |
19 | 19 = x + 14 , x= 19 - 14 = 5 | 5 | E |
19 | 19 = x + 14 , x= 19 - 14 = 5 | 5 | E |
30 | 30 = x + 14 , x= 30 - 14 = 16 | 16 | P |
41 | 41 = x + 14 , x= 41 - 14 = 27 | 27 | (blank) |
17 | 17 = x + 14 , x= 17 - 14 = 3 | 3 | C |
15 | 15 = x + 14 , x= 15 - 14 = 1 | 1 | A |
26 | 26 = x + 14 , x= 26 - 14 = 12 | 12 | L |
27 | 27 = x + 14 , x= 27 - 14 = 13 | 13 | M |
41 | 41 = x + 14 , x= 41 - 14 = 27 | 27 | (blank) |
15 | 15 = x + 14 , x= 15 - 14 = 1 | 1 | A |
28 | 28 = x + 14 , x= 28 - 14 = 14 | 14 | N |
18 | 18 = x + 14 , x= 18 - 14 = 4 | 4 | D |
41 | 41 = x + 14 , x= 41 - 14 = 27 | 27 | (blank) |
18 | 18 = x + 14 , x= 18 - 14 = 4 | 4 | D |
29 | 29 = x + 14 , x= 29 - 14 = 15 | 15 | O |
41 | 41 = x + 14 , x= 41 - 14 = 27 | 27 | (blank) |
34 | 34 = x + 14 , x= 34 - 14 = 20 | 20 | T |
22 | 22 = x + 14 , x= 22 - 14 = 8 | 8 | H |
19 | 19 = x + 14 , x= 19 - 14 = 5 | 5 | E |
41 | 41 = x + 14 , x= 41 - 14 = 27 | 27 | (blank) |
27 | 27 = x + 14 , x= 27 - 14 = 13 | 13 | M |
15 | 15 = x + 14 , x= 15 - 14 = 1 | 1 | A |
34 | 34 = x + 14 , x= 34 - 14 = 20 | 20 | T |
22 | 22 = x + 14 , x= 22 - 14 = 8 | 8 | H |
Hence, The decoded message is :
KEEP CALM AND DO THE MATH
***********************************************************************************************************************************
Hope this helps!!!