Chapter 3 Linear Block Codes
3.1
Find, by trial and error, a set of four binary codewords of length three such that each word is at least a distance of from every other word.
Solution:
Consider the following 4 code words:
3.2
Find a set of binary words of length such that each word is at least a distance of from every other word. Hint: Hamming code.
Solution:
From section 1.9, equation (1.35), consider
3.3
Perhaps the simplest of all codes is the binary parity check code, a code, where . Given a message vector , the codeword is , where (arithmetic in ) is the parity bit. Such a code is called an even parity code, since all codewords have even parity — an even number of 1 bits.
(a) Determine the minimum distance for this code.
It's a linear block code, so from Theorem 3.4, we have . It's not possible for a codeword to have only one , so .
(b) How many errors can this code correct? How many errors can this code detect?
It cannot correct any error, but it can detect 1 bit error.
(c) Determine a generator matrix for this code.
Then generator matrix is an matrix, the left part is an identity matrix, while the last column is all one.
(d) Determine a parity check matrix for this code.
Solution:
The parity check matrix is
3.4
For the repetition code, determine a parity check matrix.
Solution:
The generator matrix of the repetition code is
Let
Each row of is linearly independent, also we have .
So is a parity check matrix.
3.6
Let be an binary linear systematic code with generator . Let be an binary linear systematic code with generator . Form the parity check matrix for an code as
Show that this code has minimum distance at least .
Proof:
From theorem 3.15, we have
We would like to prove taking any columns from they must be linearly independent.
Note that
3.7
The generator matrix for a code over is given by
Find a generator matrix and parity check matrix for an equivalent systematic code.
Solution: We will do the generator matrix first since I only finished section 3.2.
Substract the 3rd row from the 2nd row, we have
Swap the 4th and 5th row, we have
The substract the 1st row from the 3rd row
That's an generator matrix for an equivalent systematic code.
Another one from only row operations.
Substract 1st row from the 2nd row
Then substract 2nd row from the 1st row
Then substract 3rd row from the 1st row
3.8
The generator and parity check matrix for a binary code are given by
This code is small enough that it can be used to demonstrate several concepts from throughout the chapter.
(a) Verify that H is a parity check matrix for this generator.
Proof:
What we need to do is to verify . We calculate its 1st row as an example.
Furthurmore, the rows in are linearly independent. If
If we look at column 4, we must have . If we look at column 3, we must have . Then must also be .
(b) Draw a logic diagram schematic for an implementation of an encoder for the nonsystematic generator G using ”and” and ”xor” gates.
Solution: I will just use verilog code instead of diagram schematic.
wire [2:0] msg;
wire [5:0] codeword;
assign codeword[0] = msg[0];
assign codeword[1] = msg[1] ^ msg[2];
assign codeword[2] = msg[0] ^ msg[1] ^ msg[2];
assign codeword[3] = msg[1];
assign codeword[4] = msg[0] ^ msg[2];
assign codeword[5] = msg[0] ^ msg[1];
(d) List the vectors in the orthogonal complement of the code (that is, the vectors in the dual code )
Solution:
We have shown in part (a) that rows in are linearly independent, so they form a basis of . Then the vectors are
(h) Using the generator matrix in (3.23), find the codeword with as message bits.
Solution: It's
3.9
Let a binary systematic code have parity check equations
Answer the following:
(a) Determine the generator matrix for this code in systematic form. Also determine the parity check matrix .
Solution:
In fact, , so .
(b) Using Theorem 3.13, show that the minimum distance of this code is 4.
Proof:
Let . First, take 4 columns, e.g., , and they are linearly dependent.
And any 3 columns are linearly independent. So .
(d) List the vectors in the orthogonal complement of the code (that is, the vectors in the dual code ).
3.10
Show that a self-dual code has a generator matrix which satisfies .
Proof:
Let be a self-dual code, so . Since the row of is a basis of , then the row of is also a basis of . That means .
Since we have then we have .
3.20
Find the lower bound on required redundancy for the following codes.
(a) A single-error correcting binary code of length .
Solution:
We use the equation
In this case, .
So
So
(b) A single-error correcting binary code of length .
We use the equation
In this case, .
So
So
(c) A triple-error correcting binary code of length 23.
Solution:
We use the equation
In this case, .
So
So
(d) A triple-error correcting -ary code (i.e., ) of length .
Solution:
We use the equation
In this case, .
So
So
So .
3.21
Show that all odd-length binary repetition codes are perfect.
Proof:
First assume the length of the odd-length binary repetition code is , then since it maps -bit message to -bit codeword, the redundancy is .
Then we calculate the hamming bound. In this case, .
The hamming bound is .
So it's a perfect code.
3.22
Show that Hamming codes achieve the Hamming bound.
Proof:
For the Hamming code, it can correct bit error, so and ,
So
Then .
On the other hand,
.
So Hamming codes achieve the Hamming bound.
3.25
Let be the generator matrix of an binary code and let no column of be all zeros. Arrange all the codewords of as rows of a array.
(a) Show that no column of the array contains only zeros.
Let be a matrix, each row is one of the messages.
And let , what we need to prove is that no column of is all zeros.
We will just need to show is not all zeros.
Since is not all zeros, then assume .
Then consider the following message:
where only . Then is not all zero. If is the th row in , then .
So is not all zeros.
For other columns we can use the same approach.
(b) Show that each column of the array consists of zeros and ones.
Proof:
Consider the th column of , and denote it , then .
If , it means , that is the inner product of is .
Now consider , then . From Theorem 2.64, . So .
So consists of zeros and ones.
(c) Show that the set of all codewords with zeros in particular component positions forms a subspace of . What is the dimension of this subspace?
Proof:
Let be the set of all codewords in such that particular component positions are , let . For , and those particular component positions are still . So is close under addition and scaler multiplication.
Now to the dimension of this subspace, assume the particular component positions are . Then the corresponding columns in the generator matrix are . Let .
Then this subspace is in fact isomorphic to . So its dimension is .
(d) Show that the minimum distance of this code must satisfy the following inequality, known as the Plotkin bound:
Proof:
From Theorem 3.4, we know . Then we just need to prove
Given any non-zero codeword , , and there are non-zero codewords. That means the total number of digit in is greater of equal to .
On the other hand, from part (b), we know the the total number of digit is exactly , since each column of has s and has columns.
So the Plotkin bound follows.
3.26
Let be the ensemble of all the binary systematic linear codes.
(a) Prove that a nonzero binary vector is contained in exactly of the codes in or it is in none of the codes in .
Proof:
We assume that for a systematic linear code, the generator matrix is like this
Basically, is an matrix and is an matrix.
So for a message , the codeword , where is the parity bits.
Given any nonzero vector where .
If and , then . So such is not contained in any code in .
Now assume , for , we need to find such that .
If , then let . So . Any vector in will satisfy . Since , we know .
On the other hand, if , then any vector will satisfy . .
In either case, there are choices to satisfy . We can apply the same argument to .
Therefore, is contained in exactly codes.
(b) Using the fact that the nonzero -tuples of weight or less can be in at most
systematic binary linear codes, show that there exists an linear code with minimum distance of at least if the following bound is satisfied:
Proof:
First note, since is an matrix, we have .
If a code 's minimum distance is less than , then it must contain a codeword such that , i.e. .
Since we can have at most distinct codewords with , and each codeword is contained in exactly codes, then the number of code with minimum distance less that is at most
So there must be at least one code in , whose distance is greater or equal to .
(c) Show that there exists an binary linear code with minimum distance at least that satisfies the following inequality:
This provides a lower bound on the minimum distance attainable with an linear code known as the Gilbert–Varshamov bound.
Proof:
Assume is the largest integer that satisfies , i.e. then use part (2), we can find a whose distance is .
And
3.29
The construction: Let be linear binary block codes with generator matrix and minimum distance . Define the code by
(a) Show that has the generator
Proof:
is matrix. Let be a message. Let be a message.
and .
And
So is the generator of .
(b) Show that the minimum distance of is
Proof:
Note that since , then .
If , then .
If , then given any . Let's treat as vector in .
So , and also .
So
In either case, .
Furthurmore, when , we can find to reach . when , we can find to reach .
So .
A note from AI: we can use the triangle inequality in the hamming distance to prove this