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...
Q4: Suppose you want to send a 5000 character message, using 7-bit ASCII encoding. How many...
Q4: Suppose you want to send a 5000 character message, using 7-bit ASCII encoding. How many TOTAL bits would need to be transmitted using an asynchronous connection? How many of those bits are overhead? How many TOTAL bits would need to be transmitted using a synchronous connection? How many of those bits are overhead? For the synchronous connection, each frame can hold 1000 characters, and has a start byte flag, a stop byte flag, a control byte, a 2 byte...
SOLVE USING WHILE. A perfect number is a positive integer that is equal to the sum...
SOLVE USING WHILE. A perfect number is a positive integer that is equal to the sum of its positive divisors except the number itself. The first two perfect numbers are 6 and 28 since 1+2+3=6 and 1+2+ 4+7+14=28. Write a matlab computer program that finds the first n perfect number (the user must input the value of n) and show them in a vector thanks! xo
using this code under, I want when the user input only letter q an error message...
using this code under, I want when the user input only letter q an error message appears that there is no second smallest, how I can do that? #include <iostream> #include <sstream> #include <vector> #include <algorithm> using namespace std; int secondSmallestNumber(vector<int> &I); int main() {    cout << "Enter the numbers in random order: (close by entering q)" << endl;    vector<int> I;    int input;    stringstream ss;    string str;    bool flag = false;    while (!flag) {        getline(cin, str);        ss.clear();        ss << str;...
Using C: Implement four versions of a function funSum that takes a positive integer n as...
Using C: Implement four versions of a function funSum that takes a positive integer n as input and returns the sum of all integers up to and including n that are divisible by 6 or 7: using a for loop in funSum1, using a while loop in funSum2, using a do-while loop in funSum3, and using recursion in funSum4. Your output for the included test code should be: funSum1(20) = 57 funSum2(20) = 57 funSum3(20) = 57 funSum4(20) = 57
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
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT