Question: In a computer network, data must be transmitted between different nodes (devices) Unfortunately, this is not an error-proof process. Transmission problems can garble a message,

In a computer network, data must be transmitted between different nodes (devices) Unfortunately, this is not an error-proof process. Transmission problems can garble a message, leading to errors in the data that is received. Luckily, the errors are (usually) randomly distributed, so they will occur in different places each time a message is transmitted. By transmitting the same message multiple times and monitoring the re- sults, we can gather data that will help us to reconstruct the original message. To do this, we examine each position of each message copy. The value that occurs most fre- quently in a specific position is (usually) the correct value for that position. should return the list of strings entered by the user. Second, define a function named countFrequencies). This function takes two arguments: a list of strings and an integer representing an index value. For each string in the list, the function counts the number of times each character occurs at the specified index (for example, if the index is 4, the function will look at the fifth character of each string). You may assume that the index value always falls into the range 0-(string length - 1), inclusive For example, consider the following repeated/retransmitted message (in this exam- ple, spaces have been inserted between each letter for clarity) Create a dictionary where each key is a lowercase letter, the value of each key is the number of strings that have that letter in the specified position (for example, if the index value is 2, key 'b' will record the number of strings that have'b' in index 2). After examining every string in the list, return the dictionary of letter frequen- cies that was just generated 2 Third, define a function named mostcommonIetter. This function takes a dic- tionary as its sole argument. It returns the key that maps to the largest value. For example, given the dictionary { ' a:3, 'b' ; 5, ' c ' : 4 } , this function would return 'b'. If two (or more) keys are tied for the highest value, you may return any one of those keys as the function result. In the first column/position, we have 1 f, 1 g, and 6 h's. Since 'h' is the most common value for the first letter, we can guess that the first letter of the original message was most likely 'h'. The second position has 5 e's, 1 h, 1 p, and 1 t, so 'e' is the most likely second character. Repeat this process for each position in the message copies. In this case, the original message tums out to be "helloworld" 3 Finally, write some Python code that combines the functions you defined in the preceding steps to reconstruct a garbled (multiply-transmitted) message like the example above For this lab, you will construct a program that reads in a series of (garbled) strings from the user and uses frequency analysis to determine what the original message was Sample Test Cases 1. edferfthmaqvorithm glgoxirhm alwxuithj algbridnn iogleielb wlacbifhm 1. Start by defining a Python function named getMessages (). This function uses a while loop to read a series of strings from the user, until the user enters the string "DONE" to stop. As you read each string, add it to the end of a list. You may assume that each input string has the same number of characters, and only contains lowercase letters (i.e., there will not be any spaces, digits, symbols, or capital letters). When the user has finished entering input strings, this function Expected Output: algorithr
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
