Important: to view this notebook properly you will need to execute the cell above, which assumes you have an Internet connection. It should already be selected, or place your cursor anywhere above to select. Then press the "Run" button in the menu bar above (the right-pointing arrowhead), or press Shift-Enter on your keyboard.
ParseError: KaTeX parse error: \newcommand{\lt} attempting to redefine \lt; use \renewcommand
We need to find a systematic way of generating linear codes as well as fast methods of decoding. By examining the properties of a matrix H and by carefully choosing H, it is possible to develop very efficient methods of encoding and decoding messages. To this end, we will introduce standard generator and canonical parity-check matrices.
Suppose that H is an m×n matrix with entries in Z2​ and n>m. If the last m columns of the matrix form the m×m identity matrix, Im​, then the matrix is a . More specifically, H=(A∣Im​), where A is the m×(n−m) matrix
With each canonical parity-check matrix we can associate an n×(n−m)
G=(AIn−m​​).​
Our goal will be to show that an x satisfying Gx=y exists if and only if Hy=0. Given a message block x to be encoded, the matrix G will allow us to quickly encode it into a linear codeword y.
Example8.23
Suppose that we have the following eight words to be encoded:
(000),(001),(010),…,(111).​
For
A=​011​110​101​​,​
the associated standard generator and canonical parity-check matrices are
G=​100011​010110​001101​​​
and
H=​011​110​101​100​010​001​​,​
respectively.
Observe that the rows in H represent the parity checks on certain bit positions in a 6-tuple. The 1s in the identity matrix serve as parity checks for the 1s in the same row. If x=(x1​,x2​,x3​,x4​,x5​,x6​), then
Here x4​ serves as a check bit for x2​ and x3​;x5​ is a check bit for x1​ and x2​; and x6​ is a check bit for x1​ and x3​. The identity matrix keeps x4​,x5​, and x6​ from having to check on each other. Hence, x1​,x2​, and x3​ can be arbitrary but x4​,x5​, and x6​ must be chosen to ensure parity. The null space of H is easily computed to be
An even easier way to compute the null space is with the generator matrix G (Table 8.24).
Message Word x
Codeword Gx
000
000000
001
001101
010
010110
011
011011
100
100011
101
101110
110
110101
111
111000
Table8.24A matrix-generated code
Theorem8.25
If H∈Mm×n​(Z2​) is a canonical parity-check matrix, then Null(H) consists of all x∈Z2n​ whose first n−m bits are arbitrary but whose last m bits are determined by Hx=0. Each of the last m bits serves as an even parity check bit for some of the first n−m bits. Hence, H gives rise to an (n,n−m)-block code.
We leave the proof of this theorem as an exercise. In light of the theorem, the first n−m bits in x are called and the last m bits are called . In Example 8.23, the first three bits are the information bits and the last three are the check bits.
Theorem8.26
Suppose that G is an n×k standard generator matrix. Then C={y:Gx=y for x∈Z2k​} is an (n,k)-block code. More specifically, C is a group code.
Proof
Let Gx1​=y1​ and Gx2​=y2​ be two codewords. Then y1​+y2​ is in C since
G(x1​+x2​)=Gx1​+Gx2​=y1​+y2​.​
We must also show that two message blocks cannot be encoded into the same codeword. That is, we must show that if Gx=Gy, then x=y. Suppose that Gx=Gy. Then
Gx−Gy=G(x−y)=0.​
However, the first k coordinates in G(x−y) are exactly x1​−y1​,…,xk​−yk​, since they are determined by the identity matrix, Ik​, part of G. Hence, G(x−y)=0 exactly when x=y.
Before we can prove the relationship between canonical parity-check matrices and standard generating matrices, we need to prove a lemma.
Lemma8.27
Let H=(A∣Im​) be an m×n canonical parity-check matrix and G=(AIn−m​​) be the corresponding n×(n−m) standard generator matrix. Then HG=0.
Let H=(A∣Im​) be an m×n canonical parity-check matrix and let G=(AIn−m​​) be the n×(n−m) standard generator matrix associated with H. Let C be the code generated by G. Then y is in C if and only if Hy=0. In particular, C is a linear code with canonical parity-check matrix H.
Proof
First suppose that y∈C. Then Gx=y for some x∈Z2m​. By Lemma 8.27, Hy=HGx=0.
Conversely, suppose that y=(y1​,…,yn​)t is in the null space of H. We need to find an x in Z2n−m​ such that Gxt=y. Since Hy=0, the following set of equations must be satisfied:
Consequently, we can let xi​=yi​ for i=1,…,n−m.
It would be helpful if we could compute the minimum distance of a linear code directly from its matrix H in order to determine the error-detecting and error-correcting capabilities of the code. Suppose that
We state this result in the following proposition and leave the proof as an exercise.
Proposition8.30
Let ei​ be the binary n-tuple with a 1 in the ith coordinate and 0's elsewhere and suppose that H∈Mm×n​(Z2​). Then Hei​ is the ith column of the matrix H.
Theorem8.31
Let H be an m×n binary matrix. Then the null space of H is a single error-detecting code if and only if no column of H consists entirely of zeros.
Proof
Suppose that Null(H) is a single error-detecting code. Then the minimum distance of the code must be at least 2. Since the null space is a group code, it is sufficient to require that the code contain no codewords of less than weight 2 other than the zero codeword. That is, ei​ must not be a codeword for i=1,…,n. Since Hei​ is the ith column of H, the only way in which ei​ could be in the null space of H would be if the ith column were all zeros, which is impossible; hence, the code must have the capability to detect at least single errors.
Conversely, suppose that no column of H is the zero column. By Proposition 8.30, Heiâ€‹î€ =0.
Example8.32
If we consider the matrices
H1​=​111​101​100​010​001​​​
and
H2​=​111​101​100​000​001​​,​
then the null space of H1​ is a single error-detecting code and the null space of H2​ is not.
We can even do better than Theorem 8.31. This theorem gives us conditions on a matrix H that tell us when the minimum weight of the code formed by the null space of H is 2. We can also determine when the minimum distance of a linear code is 3 by examining the corresponding matrix.
Example8.33
If we let
H=​111​101​100​010​​​
and want to determine whether or not H is the canonical parity-check matrix for an error-correcting code, it is necessary to make certain that Null(H) does not contain any 4-tuples of weight 2. That is, (1100),(1010),(1001),(0110),(0101), and (0011) must not be in Null(H). The next theorem states that we can indeed determine that the code generated by H is error-correcting by examining the columns of H. Notice in this example that not only does H have no zero columns, but also that no two columns are the same.
Theorem8.34
Let H be a binary matrix. The null space of H is a single error-correcting code if and only if H does not contain any zero columns and no two columns of H are identical.
Proof
The n-tuple ei​+ej​ has 1s in the ith and jth entries and 0s elsewhere, and w(ei​+ej​)=2 for iî€ =j. Since
0=H(ei​+ej​)=Hei​+Hej​​
can only occur if the ith and jth columns are identical, the null space of H is a single error-correcting code.
Suppose now that we have a canonical parity-check matrix H with three rows. Then we might ask how many more columns we can add to the matrix and still have a null space that is a single error-detecting and single error-correcting code. Since each column has three entries, there are 23=8 possible distinct columns. We cannot add the columns
So we can add as many as four columns and still maintain a minimum distance of 3.
In general, if H is an m×n canonical parity-check matrix, then there are n−m information positions in each codeword. Each column has m bits, so there are 2m possible distinct columns. It is necessary that the columns 0,e1​,…,em​ be excluded, leaving 2m−(1+m) remaining columns for information if we are still to maintain the ability not only to detect but also to correct single errors.