# Math for Liberal Studies.  Problems can occur when data is transmitted from one place to another  The two main problems are  transmission errors: the.

## Presentation on theme: "Math for Liberal Studies.  Problems can occur when data is transmitted from one place to another  The two main problems are  transmission errors: the."— Presentation transcript:

Math for Liberal Studies

 Problems can occur when data is transmitted from one place to another  The two main problems are  transmission errors: the message sent is not the same as the message received  security: someone other than the intended recipient receives the message

 “Party tonight, bring chipd”

 We detect the error because “chipd” is not a word in our dictionary

 “Party tonight, bring chipd”  We detect the error because “chipd” is not a word in our dictionary  Can we correct the error?

 “Party tonight, bring chipd”  Even though “chipd” is not the correct word, we can assume that the correct word is close  What words are one letter away from “chipd”?  After considering the possibilities, “chips” is the most likely correction

 “Party tonight, bring sofa”  This time, all of the words are in the dictionary, but we still suspect something is wrong (unless it’s a furniture party)

 “Party tonight, bring sofa”  This time, all of the words are in the dictionary, but we still suspect something is wrong (unless it’s a furniture party)  Again we can change a single letter to change “sofa” to “soda,” which seems likely to be the original intended message

 “Party tonight, bring sedr”  Identifying the error is easy: “sedr” is not a word  However, this time, changing a single letter doesn’t get us a word that makes sense

 “Party tonight, bring sedr”  We can change two letters, but that gives us two viable options:  sedr → sodr → soda  sedr → bedr → beer  It is impossible to tell which of these was the original intended message

 Errors can be detected when the message isn’t in a “dictionary” of valid messages  We can try to correct errors by finding valid messages that are “close” to the message we receive (but this doesn’t always work)

 Machines communicate with each other using a language entirely made of 0’s and 1’s  The same kinds of errors we studied earlier (substitution, transposition) can occur when these digital signals are sent  We can use special techniques to detect and correct these errors

 As an example, consider the Mars rovers, which landed in 2004  NASA sends signals to the rover to command it to perform various tasks, like movement  These signals are sent in binary

 Suppose these messages are 4 digits long  That makes 16 possible messages NASA could send:

 Suppose NASA sends the message “0110,” which might be telling the rover to move backwards to avoid a crater  If, over the vast distances between planets, the message is garbled and received as “0010,” this could be disastrous

 If the garbled message is interpreted as “move forward,” this could mean the end of a very expensive mission  To avoid this problem, we will add check digits to the message, just like we did for ID numbers

 Many of the check digit schemes we studied involved adding up the digits of our ID number  We’ll do something similar here, but keep in mind that since every digit of a binary message must be 0 or 1, our check digit must be 0 or 1 also

 A “checksum” is just a check digit that is based on a sum of digits in the message  The “parity” of the sum is 0 if the sum is even, and 1 if the sum is odd  Another way to think about parity is that it is the remainder when the sum is divided by 2

 Let’s go back and add a parity checksum digit to each of these messages

 For example: 1011  The sum of the digits is 3, which has parity 1  So the code word is 10111

 Doing this for each of the messages gives us the code words shown below

 Now when NASA wants to send the message “0110,” they send the code word “01100.”  Now see what happens when there is a substitution error: 00100  We can detect the error because this is not a valid code word

 Can we correct the error?  Using the ideas from before, we want to look for the valid code word that is “closest” to the message we received  What does “closest” mean? We have to define the idea of distance between code words

 The distance between two code words is simply the number of digits in which they differ  For example, the distance between 01101 and 10111 is 3

 To correct the error in our message, we will compare it to every valid message and find the one that is closest (in the sense of having the smallest distance)  This is called the minimum distance decoding method

 We compare the message we received (00100) to the valid code words: Code Word Distance Code Word Distance Code Word Distance Code Word Distance 000001000113001011001101 010013010103011001011113 100013100103101001101113 110003110115111013111103

 Unfortunately, there are 5 code words that are tied for the closest  We have no way of knowing which one is correct! Code Word Distance Code Word Distance Code Word Distance Code Word Distance 000001000113001011001101 010013010103011001011113 100013100103101001101113 110003110115111013111103

 Why didn’t our checksum allow us to correct this error?  If we look closely at our list of code words, we see that some of them are at a distance of 2 from each other

 Distance 2 is significant because it means that if there is a single error, the new message is now 1 away from the original, but also 1 away from a new code word

 If we can create a code system where the minimum distance between code words is 3, then we will be able to correct any single digit error

 Our solution is to add more checksums to our messages  Let’s call the four digits of our message M 1, M 2, M 3, and M 4  So for the message 0110, M 1 = 0, M 2 = 1, M 3 = 1, and M 4 = 0

 This time we will have three checksums, which we’ll call C 1, C 2, and C 3  C 1 is the parity of M 1 + M 2 + M 3  C 2 is the parity of M 1 + M 3 + M 4  C 3 is the parity of M 2 + M 3 + M 4  Let’s try it on an example: 0111

 Our message is 0111  C 1 is the parity of M 1 + M 2 + M 3 = 2, which is 0  C 2 is the parity of M 1 + M 3 + M 4 = 2, which is 0  C 3 is the parity of M 2 + M 3 + M 4 = 3, which is 1  So the code word is 0111001

 Doing this for each of our 4-digit messages, we get a new list of 7-digit code words:

 This time, the minimum distance between code words is 3, which means that we can detect any single error

 If we start with a valid code word and there is a single error, we are 1 away from where we started, and at least 2 away from anywhere else

 Also, we can detect any two errors using this code, since after 2 errors, we are still at least 1 away from any valid code word

 In general, if we know that the minimum distance between code words is D:  the code can detect D – 1 errors  the code can correct (D – 1)/2 errors, rounded down  In our examples, when D = 2, we could detect 1 error, but could not correct any  When D = 3, we can detect 2 errors, can correct 1

Download ppt "Math for Liberal Studies.  Problems can occur when data is transmitted from one place to another  The two main problems are  transmission errors: the."

Similar presentations