You are on page 1of 5

EE 387

Algebraic Error-Control Codes

October 29, 2014


Handout #19
Homework #4 Solutions

1. Dual spaces. Let V be the vector space of polynomials over GF(2), and let W be the subspace
of polynomials with even parity. (Fact: W = {f (x) : f (1) = 0}.) Find W and W .
Solution (5 points)
Even though W is a proper subspace of V , its orthogonal complement W contains only the zero
polynomial. To see this, let f (x) be any nonzero polynomial of degree m. Then xm+1 + xm is a
polynomial of even parity and f (x) (xm+1 + xm ) = 1, hence f (x) is not in W . Thus W = {0}
and W = V , the set of all polynomials.
In an infinite dimensional vector space, W may be a proper subset of W .
2. Binary LBC. (Blahut #3.1) The generator

G= 0
0

matrix for a code over GF(2) is given by

0 1 0 1 1
1 1 1 0 1 .
1 1 0 1 0

a. Find the generator matrix and the parity-check matrix for an equivalent systematic code.
Note: the systematic generator matrix is of the form [ P | I ].
b. List the vectors in the orthogonal complement of the code.
c. Form the standard array for the code. Hint: write small.
d. How many codewords are there of weights 0, 1, . . . , 6 ?
e. Find the codeword with 101 as data symbols.
f. Decode the received word 111001.
Solution (30 points)
a. We use elementary row
form [ P | I ].

1 0 1 0
G=0 1 1 1
0 1 1 0

operations to arrive at a generator matrix for the original code of the

1 1
1
0 10
1 0
0

1
0

0
1

From the systematic generator matrix


matrix H = [ I | P T ]:

1 0 1 1 0

G= 0 1 1 0 1
1 1 0 0 0

1 0 0 0 1
1 1 1 0 1
1 1 0 1 0

1 0 0 0 1
0 1 1 0 0
1 1 0 1 0

0 1 1 0 0
1 1 0 1 0
1 0 0 0 1

(add row 3 to row 1)

(add row 1 to row 2)

(move row 1 below row 3)

G = [ P | I ] we obtain the systematic parity-check

0
1 0 0 1 0 1
0 H=0 1 0 0 1 1
1
0 0 1 1 1 0

Note: in chapter 3 of Blahuts book, a generator matrix is defined to be of the form [ I | P ]. An


(n, k) code has such a systematic generator matrix if and only if the first k columns of every
generator matrix are linearly independent. The first three columns of the G of this problems
are linearly dependent. Thus there is no systematic generator matirx, but by rearranging
columns we can obtain the systematic generator matrix of an equivalent code. There are
many sets of three linearly independent columns.
b. The orthogonal complement of the code is the set of linear combinations of the rows of a check
matrix of the code.



1 0 0 1 0 1
000000,
100101,
010011,
110110,

H =0 1 0 0 1 1 C =
001110, 101011, 011101, 111000
0 0 1 1 1 0
c. The code C generated by G has 23 = 8 codewords and 26 /23 = 8 cosets. The standard array
consists of eight rows and eight columns and is shown in the table on page 2.
000000
000001
000010
000100
001000
010000
100000
001001

101011
101010
101001
101111
100011
111011
001011
100010

011101
011100
011111
011001
010101
001101
111101
010100

110110
110111
110100
110010
111110
100110
010110
111111

011010
011011
011000
011110
010010
001010
111010
010011

110001
110000
110011
110101
111001
100001
010001
111000

000111
000110
000101
000011
001111
010111
100111
001110

101100
101101
101110
101000
100100
111100
001100
100101

Table 1: Standard array for part (c)


d. From the list of codewords in the first row of the standard array, we see that there is one
codeword of weight 0, four of weight 3, and three of weight 4. The weight distribution is
(1, 0, 0, 4, 3, 0, 0), and the weight enumerator is A(x) = 1 + 4x3 + 3x4 .
e. The codeword corresponding to message m = 1 0 1 is c = mG = 1 1 0 0 0 1:

1 0 1 0 1 1
c = mG = [ 1 0 1 ] 0 1 1 1 0 1 = [ 1 1 0 0 0 1 ] ,
0 1 1 0 1 0
which is the sum (bitwise exclusive-or) of the first and third rows of G.
f. The received word 1 1 1 0 0 1 appears in row 5 column 6 of the standard array of part (c).
The coset leader 0 0 1 0 0 0 is the estimated error, and the estimated codeword at the top of
column 6 is 1 1 0 0 0 1 .
e be a nonsystematic generator matrix for a linear block code over GF(5).
3. LBC over GF(5). Let G

2 4 2 2 4 4

e = 0 0 3 0 1 1 .
G
3 1 4 0 4 0
2 3 4 1 1 1
Find the systematic generator matrix G = [ P | I ] and the systematic parity-check matrix H =
e
[ I | P T ] for the linear block code generated by G.
Page 2 of 5

EE 387, Autumn 2014

Solution (10 points)


Using elementary

1 2
0 0
e
G
3 1
2 3

1 2
1 2

4 3
3 0

0 0
1 2

3 1
1 1

4 3
1 2

3 1
1 4

row operations, we transform

1 2 1 1
1 1 2 2
2 4 0 2
3 0 1 1

4 3 0 1
4 0 4 0
3 0 0 2
4 1 1 1

0 0 1 0
1 1 2 2

1 2 0 1
0 1 0 0

3 1 0 0
0 1 1 2
1 1 0 0
0 2 3 3

4 3 1 0
1 0 2 2
1 2 0 1
0 1 0 0

3 1 0 0
0 0 1 2
2 3 0 0
0 0 3 3

1 1 1 0
1 0 0 3

1 2 0 1
0 1 0 0

1 3 0 0
0 0 1 2
1 4 0 0
0 0 0 1

the original generator matrix as follows.

2 2
0 0
(normalize row 1, clear column
1 2
3 3

2 2
0 0
(normalize row 2, clear column
1 2
3 3

0 3
0 0
(normalize row 3, clear column
1 2
0 2

0 0
0 0
(normalize row 4, clear column
1 0
0 1

3)

4)

5)

6)

= G (systematic)
The parity-check portion of the systematic generator matrix G is

1 1
1 2

P =
1 3
1 4
Therefore the systematic parity-check matrix over GF(5) is

 

1 0 1 1 1 1
1 0 4 4 4 4
T
H = [ I | P ] =
=
.
0 1 1 2 3 4
0 1 4 3 2 1
4. Weight distribution of Golay codes. (Computational) In 1949 Marcel Golay found the last interesting perfect block codes, the (23,12,7) binary code and the (11,6,5) ternary code.
a. The first row of a generator matrix for the (23,12) binary Golay code is
[1 0 1 0 1 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0].
The other 11 rows are right shifts of this 23-tuple. Find the weight distribution of the code.
b. The first row of a generator matrix for a (11,6) ternary Golay code is
[1 0 1 1 1 1 0 0 0 0 0 ] = [ 2 0 1 2 1 1 0 0 0 0 0 ] .
The other 5 rows are right shifts of this 11-tuple. Find the weight distribution of the code.
Solution (15 points)
a. The weight enumerator of the (23,12) binary Golay code is
A(x) = 1 + 253x7 + 506x8 + 1288x11 + 1288x12 + 506x15 + 253x16 + x23 .
Homework #4 Solutions

Page 3 of 5

The weight distribution was found by the following Matlab code.


g = [1 0 1 0 1 1 1 0 0 0 1 1];
% create generator matrix by shifting first row
n = 23;
k = 12;
G = zeros(k, n);
for i=0 : k-1
G(i+1,:) = [zeros(1,i) g zeros(1,n-k-i)];
end
% create 2^12 by 12 matrix of all messages
M = [0;1];
n = 2;
for m = 2:k
M = [zeros(n,1) M; ones(n,1) M ];
n = 2 * n;
end
%
C
W
A

create codebook and compute weight distribution


= mod(M * G, 2);
= sum(C, 2);
= histc(W, 0:23)

b. The weight enumerator of the (11,6) ternary Golay code is


A(x) = 1 + 132x5 + 132x6 + 330x8 + 110x9 + 24x11
The weight distribution was found by the following Matlab code.
% g(x) = 2 + x^2 + 2x^3 + x^4 + x^5
g = [2 0 1 2 1 1];
% create generator matrix by shifting first row
n = 11;
k = 6;
G = zeros(k, n);
for i=0 : k-1
G(i+1, :) = [zeros(1,i) g zeros(1,n-k-i)];
end
% create 3^6 by 6 matrix of all messages
N = 3;
M = [0 : N-1];
for m = 2 : k
M = [0*ones(N,1) M; 1*ones(N,1) M; 2*ones(N,1) M];
N = 3 * N;
end
% create codebook and compute weight distribution
C = mod(M * G, 3);
% Matlab trick to replace 2s by 1s
C(C == 2) = 1;
W = sum(C, 2);
A = histc(W, 0:11)

Page 4 of 5

EE 387, Autumn 2014

5. Plotkin bound. Let C = {c1 , c2, . . . , cM } be a binary linear block code.


a. Let cij be the j-th bit of ci . Show that for every j, either every cij is 0 or exactly half of the
cij are 0.
b. Use the previous part of this problem to obtain the Plotkin bound,
n 2k1
d k
,
2 1
on the minimum distance d of any binary parity-check code of blocklength n.
Solution (10 points)
a. Suppose that cij = 1 for some codeword c. If C0 is the subgroup of codewords for which cij
is 0, then C1 = c + C0 is the set of codewords for which cij is 1. These cosets have the same
number of elements. Therefore cij = 1 for exactly half the values of i.
b. By part (a), for each j, the number of ones in bit position j averaged over all codewords is
either 0 or 1/2. Summing over all n bit positions, the average number of ones in all codewords
is at most n/2. If the code has no useless bit positions, the average is exactly n/2. At least
one of the 2k 1 nonzero codewords has weight the average weight, so an upper bound on
the minimum distance is
d = w average weight

n2k1
12 n for large k .
2k 1

This inequality is known as the Plotkin bound. The Plotkin bound is achieved by maximumlength codes and by the Reed-Muller codes R(1, m) of order 1 and blocklength 2m .

Homework #4 Solutions

Page 5 of 5

You might also like