EE 387 October 28, 2015 Algebraic Error-Control Codes Homework #4 Solutions Handout #24 1. LBC over GF(5). Let G be a nonsystematic generator matrix for a linear block code over GF(5). 2 4 2 2 4 4 G = 0 0 3 0 1 1 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 = [I P T ] for the linear block code generated by G. Using elementary row operations, we transform the original generator matrix as follows. 1 2 1 1 2 2 1 2 1 1 2 2 G 0 0 3 0 1 1 3 1 4 0 4 0 2 4 0 2 0 0 4 3 0 1 1 2 (normalize row 1, clear column 3) 2 3 4 1 1 1 3 0 0 2 3 3 1 2 1 1 2 2 0 0 1 0 2 2 4 3 0 1 1 2 3 1 0 0 1 2 (normalize row 2, clear column 4) 3 0 0 2 3 3 1 1 0 0 3 3 0 0 1 0 2 2 4 3 1 0 0 3 3 1 0 0 1 2 3 1 0 0 1 2 (normalize row 3, clear column 5) 1 1 0 0 3 3 2 3 0 0 0 2 4 3 1 0 0 3 1 1 1 0 0 0 3 1 0 0 1 2 1 3 0 0 1 0 (normalize row 4, clear column 6) 1 4 0 0 0 1 1 4 0 0 0 1 = G (systematic) The parity-check portion of the systematic generator matrix G is 1 1 P = 1 2 1 3 1 4 Therefore the systematic parity-check matrix over GF(5) is [ ] 1 0 1 1 1 1 H = [I P T ] = = 0 1 1 2 3 4 [ ] 1 0 4 4 4 4. 0 1 4 3 2 1 It is easy to verify that no two columns of H are linearly depent. Therefore the linear block code generate by G has minimum distance 3 and can correct single symbol errors. In fact, the code is a 5-ary Hamming code of blocklength (5 2 1)/(5 1) = 6.
2. Puncturing vs. shortening.(blahut#3.18) Under what conditions is puncturing a code by b places equivalent to shortening a code by b places? If the generator matrix that results from deleting b columns has b rows that are all zero, then the number of information symbols the rank of the generator matrix is reduced by b. Hence assuming the generator matrix is in systematic form, the necessary and sufficient condition is that after deleting b columns from information bits, the b rows that had nonzero elements in those deleted b columns all become zero. As an example, consider the following 4 7 generator matrix that defines code with minimum distance 1. When punctured by deleting row 4 and column 4, the new 3 6 generator matrix has minimum distance 3. 0 1 1 0 1 0 0 G 1 = 1 0 1 0 0 1 0 0 1 1 1 0 0 1 1 0 0 0 0 1 G 2 = 1 0 1 0 1 0 1 1 0 0 0 1 0 0 0 1 0 0 0 In general, if by rearranging rows and columns of a generator matrix G we can obtain a matrix of the form [ ] G1 0 G =, 0 G 2 then the code can be punctured without decreasing minimum distance by deleting either the first or second group of codeword symbols. As shown above, puncturing may increase minimum distance. 3. 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+253x 7 +506x 8 +1288x 11 +1288x 12 +506x 15 +253x 16 +x 23. 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; Page 2 of 5 EE 387, Autumn 2015
G = zeros(k, n); for i=0 : k-1 G(i+1,:) = [zeros(1,i) g zeros(1,n-k-i)]; % 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; % create codebook and compute weight distribution C = mod(m * G, 2); W = sum(c, 2); A = histc(w, 0:23) b. The weight enumerator of the (11,6) ternary Golay code is A(x) = 1+132x 5 +132x 6 +330x 8 +110x 9 +24x 11 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)]; % 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; % create codebook and compute weight distribution C = mod(m * G, 3); % Matlab trick to replace 2 s by 1 s C(C == 2) = 1; W = sum(c, 2); A = histc(w, 0:11) Homework #4 Solutions Page 3 of 5
4. Plotkin bound. Let C = {c 1,c 2,...,c M } be a binary linear block code. a. Let c ij be the j-th bit of c i. Show that for every j, either every c ij is 0 or exactly half of the c ij are 0. b. Use the previous part of this problem to obtain the Plotkin bound, d n 2k 1 2 k 1, on the minimum distance d of any binary parity-check code of blocklength n. a. Suppose that c ij = 1 for some codeword c. If C 0 is the subgroup of codewords for which c ij is 0, then C 1 = c+c 0 is the set of codewords for which c ij is 1. These cosets have the same number of elements. Therefore c ij = 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 2 k 1 nonzero codewords has weight the average weight, so an upper bound on the minimum distance is d = w average weight n2k 1 2 k 1 1 n for large k. 2 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 2 m. 5. Prime quadratic polynomials. (Blahut #4.2+) a. How many distinct second-degree monic polynomials of the form x 2 +ax+b (b 0) over are there over GF(16)? b. How many distinct polynomials of the form (x β)(x γ) are there over GF(16)? c. Does this prove that an irreducible second-degree polynomial exists? How many second-degree prime polynomials over GF(16) are there? d. Given that there is at least one prime polynomial over GF(2 m ) of degree 2, prove that there is a prime polynomial of the form x 2 +ax+1. Solution (20 points) a. Thereare16choicesforaand15choicesforb 0. Thereforethenumber ofmonicpolynomials of degree 2 over GF(16) is 16 15 = 240. b. There are 15 choices for β 0 and 15 choices for γ 0. However, since order is not important, the number of ways to form (x β)(x γ) is the number of ways to pick two different elements fromaset of 15 plus the number of ways to pick a pair of identical elements, that is, ( 15 2) +15 = 120. c. Every reducible monic polynomial of degree 2 with nonzero constant term can be factored as (x β)(x γ) with β 0,γ 0. Since the number of ways of factoring is smaller than the number of polynomials of degree 2, the difference consists of prime polynomials. Hence there are 240 120 = 120 irreducible monic (i.e., prime) quadratic polynomials over GF(16). Each such polynomial has two zeroes that belong to GF(256) GF(16). Since the number of Page 4 of 5 EE 387, Autumn 2015
primitive elements in GF(256) is the number of integers between 0 and 255 that are relatively prime to 255, there are 2 4 16 255 = 128 primitive elements and therefore 64 primitive 3 5 17 polynomials of degree 2 over GF(16). The remaining 56 prime polynomials are not primitive. d. Here are two proofs that there is a prime polynomial over GF(2 m ) of the form x 2 +ax+1. i. Let x 2 + bx + c be a prime quadratic polynomial. Obviously, c 0. Every element of GF(2 m ) has a square root. Use the change of variables x = u c: x 2 +bx+c = (u c) 2 +b(u c)+c = cu 2 +bu ( c+c = c u 2 + b ) u+1 c Since x 2 +bx+c is prime, u 2 +(b/ c)u+1 is prime and has constant coefficient 1. ii. The two zeroes of x 2 + αx + 1 are reciprocals, since the product of the zeroes equals the constant coefficient. Thus the possible factors of this polynomial are of the form (x β)(x β 1 ) for nonzero β GF(2 m ). There are 2 m 1 polynomials of this form but 2 m possible values of α. Since 2 m > 2 m 1, there are 2 m 2 m 1 = 2 m 1 > 0 values of α in GF(2 m ) such that x 2 +αx+1 is prime. The first proof gives an explicit method for finding a prime polynomial of the desired form. The second proof is more elegant and can easily be exted to all finite fields, even if not all elements have square roots. 6. Zeroes of polynomials over a ring. (Blahut #4.5) Over Z/(15), the ring of integers modulo 15, show that the polynomial p(x) = x 2 1 has more than two zeroes. Such a polynomial over a field can have only two zeroes. Where does the proof of Theorem 4.3.9 fail for a ring? The obvious solutions are+1 and 1 = 14. We can find the other two solutions, +4 and 4 = 11 by trial and error. Or we could use the Chinese remainder theorem, since the solutions to the four pairs of equations, x = ±1 mod 3, x = ±1 mod 5, are solutions of x 2 = 1. The proof of Theorem 4.3.9 does not work because polynomials over a ring may not have unique prime factorizations. In this problem, x 2 1 = (x 1)(x+1) = (x 4)(x+4). Therefore the number of prime divisors may be larger than the degree of a polynomial. Homework #4 Solutions Page 5 of 5