Question

In: Computer Science

Encoding a message starts with assigning each letter of the alphabet with a positive integer using...

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.

Solutions

Expert Solution

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!!!


Related Solutions

Write a program that uses a dictionary to assign “codes” to each letter of the alphabet....
Write a program that uses a dictionary to assign “codes” to each letter of the alphabet. For example:      codes = {'A':'%', 'a':'9', 'B':'@', 'b':'#', etc....} Using this example, the letter “A” would be assigned the symbol %, the letter “a” would be assigned the number 9, the letter “B” would be assigned the symbol “@” and so forth. The program should open a specified text file, read its contents, and then use the dictionary to write an encrypted version of...
In international Morse code, each letter in the alphabet is symbolized by a series of dots...
In international Morse code, each letter in the alphabet is symbolized by a series of dots and dashes: the letter “a” for example is encoded as “×- ” while the most common letter “e” has the shortest code “×” (just a dot). What is the minimum number of dots and/or dashes needed to represent any letter in the English alphabet (26 letters)?
using the fact that : A positive integer n ≥ 3 is constructive if it is...
using the fact that : A positive integer n ≥ 3 is constructive if it is possible to construct a regular n-gon by straightedge and compass, it is possible to construct the angle 2π/n. And that if both angles α and β can be constructed by straightedge and compass then so are their sums and differences.The outside angle of a regular n-gon is 2π/n. 1. Suppose that n = p^(α1) ··· p^(αk) where p ,··· , pk are distinct odd...
Write following program using Python: A positive integer greater than 1 is said to be prime...
Write following program using Python: A positive integer greater than 1 is said to be prime if it has no divisors other than 1 and itself. A positive integer greater than 1 is composite if it is not prime. Write a program that asks the user to enter a integer greater than 1, then displays all of the prime numbers that are less than or equal to the number entered. Last, create two files. One file will hold all of...
Each of two players chooses a positive integer. If player i's integer is greater than player j's integer and less than three times this integer, then player j pays $1 to player i.
Question is based off of Game Theory Mixed strategy and Pure strategy Nash EquilibriumEach of two players chooses a positive integer. If player i's integer is greater than player j's integer and less than three times this integer, then player j pays $1 to player i. If player i's integer is at least three times greater than player j's integer, then player i pays $1 to player j. If the integers are equal, no payment is made. Each player's preferences...
For each positive integer, n, let P({n}) =(1/2^n) . Consider the events A = {n :...
For each positive integer, n, let P({n}) =(1/2^n) . Consider the events A = {n : 1 ≤ n ≤ 10}, B = {n : 1 ≤ n ≤ 20}, and C = {n : 11 ≤ n ≤ 20}. Find (a) P(A), (b) P(B), (c) P(A ∪ B), (d) P(A ∩ B), (e) P(C), and (f) P(B′). Hint: Use the formula for the sum of a geometric series
Find a primitive root, for all positive integral m, modulo each integer below. (a) 7m (Hint:...
Find a primitive root, for all positive integral m, modulo each integer below. (a) 7m (Hint: Using Corollary 5.15, find a common primitive root r modulo 7 and 72• The proof of Proposition 5.17 then guarantees that r is a primitive root modulo 72 for all positive integral m.) (b) 11m (c) 13m (d) 17m
Suppose you have a list containing k integer numbers. Each number could be positive, negative, or...
Suppose you have a list containing k integer numbers. Each number could be positive, negative, or zero. Write pseudocode for a program that first asks the user for each of the numbers. After that, it should determine and display the number from the list that is nearest to the positive number five (5). Notes: 1. Try working this out for k = 4 and k = 5. See if you can find an algorithmic pattern that can be extended for...
Using the T accounts below, record the following transactions. Label each entry with the appropriate letter....
Using the T accounts below, record the following transactions. Label each entry with the appropriate letter. a. The stockholders contributed cash of $40,000 and a truck worth $48,000 into the business in exchange for 8,800 shares of $10 par value stock. b. Paid two months' rent in advance, $2,400. c. Agreed to do a hauling job for a price of $6,400. d. Performed the hauling job. Will get paid later. e. Received payment of $2,000 on the hauling job. f....
Write a program to reverse each integer number on array (size 3) using while loop. C++...
Write a program to reverse each integer number on array (size 3) using while loop. C++ Input: 3678 2390 1783 Output: 8763 0932 3871
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT