1 / 38

Section 3.5: Error-Correcting Codes

Math for Liberal Studies. Section 3.5: Error-Correcting Codes. Transmission Problems. 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

alain
Download Presentation

Section 3.5: Error-Correcting Codes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Math for Liberal Studies Section 3.5: Error-Correcting Codes

  2. Transmission Problems • 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

  3. Transmission Error Examples • “Party tonight, bring chipd”

  4. Transmission Error Examples • “Party tonight, bring chipd” • We detect the error because “chipd” is not a word in our dictionary

  5. Transmission Error Examples • “Party tonight, bring chipd” • We detect the error because “chipd” is not a word in our dictionary • Can we correct the error?

  6. Transmission Error Examples • “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

  7. Transmission Error Examples • “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)

  8. Transmission Error Examples • “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

  9. Transmission Error Examples • “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

  10. Transmission Error Examples • “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

  11. Error Correction Principles • 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)

  12. Digital Languages • 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

  13. Sending Signals to Mars • 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

  14. Sending Signals to Mars • Suppose these messages are 4 digits long • That makes 16 possible messages NASA could send:

  15. Sending Signals to Mars • Suppose NASA sends the message “0110,” which mightbe 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

  16. Sending Signals to Mars • If the garbled message is interpreted as “move forward,”this could mean the end of avery expensive mission • To avoid this problem, we will add check digits to the message, just like we did for ID numbers

  17. Parity Checksums • 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

  18. Parity Checksums • 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

  19. Adding a Parity Checksum Digit • Let’s go back and add a parity checksum digit to each of these messages

  20. Adding a Parity Checksum Digit • For example: 1011 • The sum of the digits is 3, which has parity 1 • So the code word is 10111

  21. Adding a Parity Checksum Digit • Doing this for each of the messages gives us the code words shown below

  22. Testing the New System • 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

  23. Testing the New System • 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

  24. Distance • 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

  25. Using Distance • 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

  26. Using Distance • We compare the message we received (00100) to the valid code words:

  27. Using Distance • Unfortunately, there are 5 code words that are tied for the closest • We have no way of knowing which one is correct!

  28. What Went Wrong? • 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

  29. What Went Wrong? • 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

  30. What Went Wrong? • 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

  31. More Checksums! • Our solution is to add more checksums to our messages • Let’s call the four digits of our message M1, M2, M3, and M4 • So for the message 0110, M1 = 0, M2 = 1, M3 = 1, and M4 = 0

  32. More Checksums! • This time we will have three checksums, which we’ll call C1, C2, and C3 • C1 is the parity of M1 + M2 + M3 • C2 is the parity of M1 + M3 + M4 • C3 is the parity of M2 + M3 + M4 • Let’s try it on an example: 0111

  33. More Checksums! • Our message is 0111 • C1 is the parity of M1 + M2 + M3 = 2, which is 0 • C2 is the parity of M1 + M3 + M4 = 2, which is 0 • C3 is the parity of M2 + M3 + M4 = 3, which is 1 • So the code word is 0111001

  34. A New List of Code Words • Doing this for each of our 4-digit messages, we get a new list of 7-digit code words:

  35. Minimum Distance • This time, the minimum distance between code words is 3, which means that we can detect any single error

  36. Minimum Distance • 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

  37. Minimum Distance • 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

  38. Using Minimum Distance • 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

More Related