maths.free › Abstract Algebra › 8. Algebraic Coding Theory › Error-Detecting and Correcting Codes
Error-Detecting and Correcting Codes
Let us examine a simple model of a communications system for transmitting and receiving coded messages (). Uncoded messages may be composed of letters or characters, but typically they consist of binary m-tuples.
Error-Detecting and Correcting Codes
Let us examine a simple model of a communications system for transmitting and receiving coded messages ().
Uncoded messages may be composed of letters or characters, but typically they consist of binary \(m\)-tuples. These messages are encoded into codewords, consisting of binary \(n\)-tuples, by a device called an encoder. The message is transmitted and then decoded. We will consider the occurrence of errors during transmission. An error occurs if there is a change in one or more bits in the codeword. A decoding scheme is a method that either converts an arbitrarily received \(n\)-tuple into a meaningful decoded message or gives an error message for that \(n\)-tuple. If the received message is a codeword (one of the special \(n\)-tuples allowed to be transmitted), then the decoded message must be the unique message that was encoded into the codeword. For received non-codewords, the decoding scheme will give an error indication, or, if we are more clever, will actually try to correct the error and reconstruct the original message. Our goal is to transmit error-free messages as cheaply and quickly as possible.
Example
One possible coding scheme would be to send a message several times and to compare the received copies with one another. Suppose that the message to be encoded is a binary \(n\)-tuple \((x_{1}, x_{2}, \ldots, x_{n})\). The message is encoded into a binary \(3n\)-tuple by simply repeating the message three times: \[\begin{aligned}\end{aligned}\]. To decode the message, we choose as the \(i\)th digit the one that appears in the \(i\)th place in at least two of the three transmissions. For example, if the original message is \((\codeword{0110})\), then the transmitted message will be \((\codeword{0110}\; \codeword{0110}\; \codeword{0110})\). If there is a transmission error in the fifth digit, then the received codeword will be \((\codeword{0110}\; \codeword{1110}\; \codeword{0110})\), which will be correctly decoded as \((\codeword{0110})\). We will adopt the convention that bits are numbered left to right in binary \(n\)-tuples. This triple-repetition method will automatically detect and correct all single errors, but it is slow and inefficient: to send a message consisting of \(n\) bits, \(2n\) extra bits are required, and we can only detect and correct single errors. We will see that it is possible to find an encoding scheme that will encode a message of \(n\) bits into \(m\) bits with \(m\) much smaller than \(3n\).
Example
Even parity, a commonly used coding scheme, is much more efficient than the simple repetition scheme. The ASCII (American Standard Code for Information Interchange) coding system uses binary \(8\)-tuples, yielding \(2^{8} = 256\) possible \(8\)-tuples. However, only seven bits are needed since there are only \(2^7 = 128\) ASCII characters. What can or should be done with the extra bit? Using the full eight bits, we can detect single transmission errors. For example, the ASCII codes for A, B, and C are \[\begin{aligned}\text{A} & = \codeword{65}_{10} = \codeword{01000001}_{2}, \\ \text{B} & = \codeword{66}_{10} = \codeword{01000010}_{2}, \\ \text{C} & = \codeword{67}_{10} = \codeword{01000011}_{2}\end{aligned}\]. Notice that the leftmost bit is always set to \(0\); that is, the \(128\) ASCII characters have codes \[\begin{aligned}\codeword{00000000}_{2} & = \codeword{0}_{10}, \\ & \aatavdots{=} \\ \codeword{01111111}_{2} & = \codeword{127}_{10}\end{aligned}\]. The bit can be used for error checking on the other seven bits. It is set to either \(0\) or \(1\) so that the total number of \(1\) bits in the representation of a character is even. Using even parity, the codes for A, B, and C now become \[\begin{aligned}\text{A} & = \codeword{01000001}_{2}, \\ \text{B} & = \codeword{01000010}_{2}, \\ \text{C} & = \codeword{11000011}_{2}\end{aligned}\]. Suppose an A is sent and a transmission error in the sixth bit is caused by noise over the communication channel so that \((\codeword{0100}\; \codeword{0101})\) is received. We know an error has occurred since the received word has an odd number of \(1\)s, and we can now request that the codeword be transmitted again. When used for error checking, the leftmost bit is called a parity check bit.
By far the most common error-detecting codes used in computers are based on the addition of a parity bit. Typically, a computer stores information in \(m\)-tuples called words. Common word lengths are \(8\), \(16\), and \(32\) bits. One bit in the word is set aside as the parity check bit, and is not used to store information. This bit is set to either \(0\) or \(1\), depending on the number of \(1\)s in the word.
Adding a parity check bit allows the detection of all single errors because changing a single bit either increases or decreases the number of \(1\)s by one, and in either case the parity has been changed from even to odd, so the new word is not a codeword. (We could also construct an error detection scheme based on odd parity; that is, we could set the parity check bit so that a codeword always has an odd number of \(1\)s.)
The even parity system is easy to implement, but has two drawbacks. First, multiple errors are not detectable. Suppose an A is sent and the first and seventh bits are changed from \(0\) to \(1\). The received word is a codeword, but will be decoded into a C instead of an A. Second, we do not have the ability to correct errors. If the 8-tuple \((\codeword{1001}\; \codeword{1000})\) is received, we know that an error has occurred, but we have no idea which bit has been changed. We will now investigate a coding scheme that will not only allow us to detect transmission errors but will actually correct the errors.
Example
Suppose that our original message is either a \(0\) or a \(1\), and that \(0\) encodes to \((\codeword{000})\) and \(1\) encodes to \((\codeword{111})\). If only a single error occurs during transmission, we can detect and correct the error. For example, if a \((\codeword{101})\) is received, then the second bit must have been changed from a \(1\) to a \(0\). The originally transmitted codeword must have been \((\codeword{111})\). This method will detect and correct all single errors.
| Transmitted | Received Word | |||||||
| Codeword | \(\codeword{000}\) | \(\codeword{001}\) | \(\codeword{010}\) | \(\codeword{011}\) | \(\codeword{100}\) | \(\codeword{101}\) | \(\codeword{110}\) | \(\codeword{111}\) |
| \(\codeword{000}\) | \(0\) | \(1\) | \(1\) | \(2\) | \(1\) | \(2\) | \(2\) | \(3\) |
| \(\codeword{111}\) | \(3\) | \(2\) | \(2\) | \(1\) | \(2\) | \(1\) | \(1\) | \(0\) |
In , we present all possible words that might be received for the transmitted codewords \((\codeword{000})\) and \((\codeword{111})\). also shows the number of bits by which each received \(3\)-tuple differs from each original codeword.
Maximum-Likelihood Decoding
The coding scheme presented in is not a complete solution to the problem because it does not account for the possibility of multiple errors. For example, either a \((\codeword{000})\) or a \((\codeword{111})\) could be sent and a \((\codeword{001})\) received. We have no means of deciding from the received word whether there was a single error in the third bit or two errors, one in the first bit and one in the second. No matter what coding scheme is used, an incorrect message could be received. We could transmit a \((\codeword{000})\), have errors in all three bits, and receive the codeword \((\codeword{111})\). It is important to make explicit assumptions about the likelihood and distribution of transmission errors so that, in a particular application, it will be known whether a given error detection scheme is appropriate. We will assume that transmission errors are rare, and, that when they do occur, they occur independently in each bit; that is, if \(p\) is the probability of an error in one bit and \(q\) is the probability of an error in a different bit, then the probability of errors occurring in both of these bits at the same time is \(pq\). We will also assume that a received \(n\)-tuple is decoded into a codeword that is closest to it; that is, we assume that the receiver uses maximum-likelihood decoding. This section requires a knowledge of probability, but can be skipped without loss of continuity.
A binary symmetric channel is a model that consists of a transmitter capable of sending a binary signal, either a \(0\) or a \(1\), together with a receiver. Let \(p\) be the probability that the signal is correctly received. Then \(q = 1 - p\) is the probability of an incorrect reception. If a \(1\) is sent, then the probability that a \(1\) is received is \(p\) and the probability that a \(0\) is received is \(q\) (). The probability that no errors occur during the transmission of a binary codeword of length \(n\) is \(p^{n}\). For example, if \(p=0.999\) and a message consisting of 10,000 bits is sent, then the probability of a perfect transmission is \[\begin{aligned}\end{aligned}\].
Condensed — the full section is in Judson, Abstract Algebra: Theory and Applications.
Block Codes
If we are to develop efficient error-detecting and error-correcting codes, we will need more sophisticated mathematical tools. Group theory will allow faster methods of encoding and decoding messages. A code is an \((n, m)\)-block code if the information that is to be coded can be divided into blocks of \(m\) binary digits, each of which can be encoded into \(n\) binary digits. More specifically, an \((n, m)\)-block code consists of an encoding function \[\begin{aligned}\end{aligned}\] and a decoding function \[\begin{aligned}\end{aligned}\]. A codeword is any element in the image of \(E\). We also require that \(E\) be one-to-one so that two information blocks will not be encoded into the same codeword. If our code is to be error-correcting, then \(D\) must be onto.
Example
The even-parity coding system developed to detect single errors in ASCII characters is an \((8,7)\)-block code. The encoding function is \[\begin{aligned}\end{aligned}\], where \(x_8 = x_7 + x_6 + \cdots + x_1\) with addition in \({\mathbb Z}_2\).
Let \({\mathbf x} = (x_1, \ldots, x_n)\) and \({\mathbf y} = (y_1, \ldots, y_n)\) be binary \(n\)-tuples. The Hamming distance or distance, \(d({\mathbf x}, {\mathbf y})\), between \({\mathbf x}\) and \({\mathbf y}\) is the number of bits in which \({\mathbf x}\) and \({\mathbf y}\) differ. The distance between two codewords is the minimum number of transmission errors required to change one codeword into the other. The minimum distance for a code, \(d_{\min}\), is the minimum of all distances \(d({\mathbf x}, {\mathbf y})\), where \({\mathbf x}\) and \({\mathbf y}\) are distinct codewords. The weight, \(w({\mathbf x})\), of a binary codeword \({\mathbf x}\) is the number of \(1\)s in \({\mathbf x}\). Clearly, \(w({\mathbf x}) = d({\mathbf x}, {\mathbf 0})\), where \({\mathbf 0} = (\codeword{00 \cdots 0})\). \(d(\mathbf x, \mathbf y)\) Hamming distance between \(\mathbf x\) and \(\mathbf y\) \(d_{\min}\) the minimum distance of a code \(w(\mathbf x)\) the weight of \(\mathbf x\)
The following proposition lists some basic properties about the weight of a codeword and the distance between two codewords. The proof is left as an exercise.
Condensed — the full section is in Judson, Abstract Algebra: Theory and Applications.
Historical Note
Modern coding theory began in 1948 with C. Shannon's paper, A Mathematical Theory of Information [7]. This paper offered an example of an algebraic code, and Shannon's Theorem proclaimed exactly how good codes could be expected to be. Richard Hamming began working with linear codes at Bell Labs in the late 1940s and early 1950s after becoming frustrated because the programs that he was running could not recover from simple errors generated by noise. Coding theory has grown tremendously in the past several decades. The Theory of Error-Correcting Codes, by MacWilliams and Sloane [5], published in 1977, already contained over 1500 references. Linear codes (Reed-Muller \((32, 6)\)-block codes) were used on NASA's Mariner space probes. More recent space probes such as Voyager have used what are called convolution codes. Currently, very active research is being done with Goppa codes, which are heavily dependent on algebraic geometry.
Symbols used here
i² = −1.
Naturals, integers, rationals, reals, complex numbers.
x belongs to A; every element of A is in B.
Marks the point where the statement has been established.
n divides a − b; a and b have the same remainder.
b is a multiple of a; the largest number dividing both.
A set with an operation; the do-nothing element; the element that undoes g.
Same structure; the group of cosets of a normal subgroup N.
The remainders 0…n−1 with clock arithmetic.
The set of morphisms; do g then f.
Questions people ask
What is a group, in plain words?
A set with one operation that is associative, has an identity, and lets every element be undone. Symmetries of any object form a group — that is where the idea came from.
What is the difference between a ring and a field?
A ring has addition and multiplication that behave like the integers (you cannot always divide); a field is a ring where every non-zero element has a reciprocal, like the rationals or the reals.
Өөрийнхөөг турш
Parts of this page are adapted from Judson, Abstract Algebra: Theory and Applications (GFDL 1.3). Condensed and re-explained here; errors are ours.
Бүх зүйл Abstract Algebra
GroupsSubgroups, cosets and Lagrange's theoremCyclic groups and permutation groupsHomomorphisms, normal subgroups and quotient groupsRings and fieldsGalois theory: why the quintic has no formula