Solutions of Exam Coding Theory (2MMC30), 23 June 2016 (1.a) Consider the 4 4 matrices as words in F 16 2, the binary vector space of dimension 16. C is the code of all binary 4 4 matrices such that the number of ones in every row is even and the same holds for every column. Let c ij be the entry of a codeword in the i-th row and j-th column. The number of ones in the i-th row is even, that means that c i1 + c i2 + c i3 + c i4 0 mod 2 or c i1 + c i2 + c i3 + c i4 = 0 in F 2. This is homogeneous linear equation over F 2, and similarly for every column. Hence C is the solution space of 8 homogeneous linear equations over F 2. Hence C is F 2 -linear. There are 8 equations, but these equations are dependent, since if the sum of ones in every row is even, then the total number of ones is even. Therefore the sum of ones in every column is even. Hence we can define the code by 7 equations. So the dimension of C is at least 16 7 = 9. One can choose the entries of the first 3 rows and the first 3 columns arbitrary, and fill the last row and last column according to the parity check rule to get a unique codeword. Hence there are exactly 2 9 codewords and the dimension is 9. Let c be a nonzero codeword. Then there is at least one entry c ij = 1. Hence there is a i i and a j j such that c i j = 1 and c ij = 1, since the number of ones in the i-th row is even, so at least 2, and the number of ones in the j-th row is even, so at least 2. Furthermore there is a j j such that c i j = 1, since the number of ones in the i -th row is even, so at least 2. In this way we have shown that a nonzero codeword has at least weight 4. Hence the minimum distance of C is at least 4. The array with ones in positions (1, 1), (1, 2), (2, 1) and (2, 2) and zeros at all other positions is a codeword of weight 4. Hence the minimum distance of C is equal to 4. Alternative: Let D be the F 2 -linear [4, 3, 2] code generated by (1, 0, 0, 1), (0, 1, 0, 1) and (0, 0, 1, 1). Then C is equal to the product code D D. Hence C is an F 2 -linear code of length 4.4 = 16, dimension 3.3 = 9 and minimum distance 2.2 = 4. (1.b) From (1.a) it follows that a codeword has weight 4 if and only if j = j. Hence the number of codewords of weight 4 is equal to the number of ways to choose two two-sets {i, i } and {j, j } out of {1, 2, 3, 4}, which is equal to ( 4 2). ( 4 2) = 36. (1.c) Suppose that r is an array that is a received word with one error, say at position (i, j). Then the receiver will notice in row i an odd parity and an even parity for all other rows, and an odd parity in column j and an even parity in all other columns. So change the symbol 0/1 into 1/0 at position (i, j). (1.d) Suppose that r is an array of a received word with at most three erasures. If there is an erasure, then there is at least one row or column with exactly one erasure in that row or column. Suppose that there is a row with exactly one erasure. The value of the erasure in such a row is uniquely determined by the parity rule. Correct these rows according to that parity rule. Then the remaining erasures are all in one row, that means that there is 1
at most one erasure in every column. The value of the erasure in the columns is uniquely determined by the parity rule. Correct these columns in this way. Then all erasures are corrected. (1.e) Suppose that r is an array of a received word with one error and one erasure. There are three possibilities: (i) The error and erasure are in distinct rows and columns. Then the error is detected by a unique row i with odd parity and the erasure is not in row i, and a unique column j with odd parity and and the erasure is not in row j. Change the symbol 0/1 into 1/0 at position (i, j). (ii) The error and erasure are in one row i. Then all other rows have even parity. Furthermore the error is detected by a unique column j with odd parity and and the erasure is not in row j. Change the symbol 0/1 into 1/0 at position (i, j). (iii) The error and erasure are in one column. This case treated similarly by changing the role of columns and rows. (1.f) The first array has odd parity in the second row and the third column 1 0 0 1 1 1 0 1 corrected as: 1 0 0 1 1 1 1 1 The second array has in the fourth row exactly one erasure, correct it by the parity rule. Then the second and fourth column have exactly one erasure, correct these by the parity rule: 1 0 1 1 0 correct fourth row: 1 0 corrected as: The third array has one erasure at position (2, 2). All columns that do not contain an erasure have even parity. The third row is the only row (apart from the second one that contains the erasure) with odd parity. So we are in case (iii), that means that the error is in the same column as the the erasure. Hence the error is in the third row and second column. 0 0 1 0 1 1 1 corrected as: 2
(2) Let C be a q-ary [n, k, d] code with q = 3, n = 13 and d = 5. According to the Singleton bound we have k n + 1 d = 13 + 1 5 = 9. The Griesmer bound states that k 1 n d. q i Hence 13 5 + 2 + 1 + k 1 i=3 According to the Hamming bound we have V q (n, t) q k q n with V q (n, t) = t i=0 ( n i i=0 1 = 8 + (k 3) = 5 + k. Therefore k 8. ) t = (d 1)/2 and (q 1) i. Now q = 3, n = 13 and t = 2. So V 3 (13, 2) = 1+13.2+ ( ) 13 2.2 2 = 339. Now 3 5 < 339 < 3 6. Hence 3 5+k < V 3 (13, 2) 3 k 3 13. Therefore k 7. The Gilbert-Varshamov bound states that there exists a q-ary [n, k, d] code if V q (n 1, d 2) q k < q n Now V 3 (12, 3) = 1 + 12.2 + ( ) 12 2.2 2 + ( ) 12 3.2 3 = 2049 and 3 6 < 2049 < 3 7. So if k 6, then V 3 (12, 3) 3 k < 3 7+k 3 13. Therefore there exists a ternary [13, 6, 5] code. (3.a) The ternary cyclic code C has length n = 13 and defining set {0, 1, 2}. The cyclotomic coset of 0 is {0}. The cyclotomic coset of 1 is equal to the set of all 3 j modulo 13. That is 1, 3, 9, 27 1. The cyclotomic coset of 1 is equal to {1, 3, 9}. So the cyclotomic coset of 2 is equal to the set of all 2.3 j modulo 13. That is 2, 6, 18 5, 15 2. Hence the cyclotomic coset of 2 is equal to {2, 5, 6}. Hence the complete defining set of C is equal to { 0, 1, 2, 3, 5, 6, 9 }. (3.b) The size of the complete defining set of C is 7. Hence the dimension is equal to 13 7 = 6. (3.c) A field of characteristic 3 has 3 e elements and the nonzero elements form a multiplicative cyclic group of order 3 e 1. There is an element of order 13 in F 3 e if and only if 13 divides 3 e 1 if and only if 3 e 1 mod 13. We have seen in (3.a) that e = 3 is the smallest positive integer such that 3 e 1 mod 13. Therefore F 27 is the smallest field of characteristic 3 that contains an element of order 13. 3
(3.d) In (3.a) we showed that the complete defining set is equal to { 0, 1, 2, 3, 5, 6, 9 }. The longest sequence of consecutive integers in this complete defining set is given by 0, 1, 2, 3. It has length 4. Hence the minimum distance of C is at least 5 by the BCH bound. Suppose that a.b 1 mod 13. Then the consecutive sequence of period a in the complete defining set of {0, 1, 2} is equal to the consecutive sequence of period 1 in the complete defining set of {0, b, 2b}. If we take b {1, 3, 9} we get the complete defining set of C and the longest sequence of consecutive integers has length 4. If we take b {2, 5, 6} we get the set { 0, 2, 4, 5, 6, 10, 12 } and its longest sequence of consecutive integers has length 3. If we take b {7, 8, 11} we get the set { 0, 1, 3, 7, 8, 9, 11 } and its longest sequence of consecutive integers has length 3. Finally, if we take b {4, 10, 12} we get the set { 0, 4, 7, 8, 10, 11, 12 } and its longest sequence of consecutive integers has length 4. Hence the longest consecutive sequence of period a in the complete defining sets of I has length 4. Therefore δ BCH (C) = 4 + 1 = 5. (4.a) The generator matrix G of the binary code C given by 1 0 0 1 0 0 G = 0 1 0 0 1 0. 0 0 1 0 0 1 An enumeration of all 2 3 = 8 codewords with their corresponding weights is given in the following table: 0 1 0 0 1 0 0 2 0 1 0 0 1 0 2 0 0 1 0 0 1 2 0 1 1 0 1 1 4 1 0 1 1 0 1 4 1 1 0 1 1 0 4 1 1 1 1 1 1 6 Counting the weights of these codewords gives A 1 = 1, A 2 = 3, A 4 = 3, A 6 = 1 and A i = 0 for all i {1, 2, 4, 6}. Hence the (homogeneous) weight enumerator of C is given by W C (X, Y ) = X 6 + 3X 4 Y 2 + 3X 2 Y 4 + Y 6. 4
(4.b) One checks that GG T = 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 1 1 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 1 =. So every two rows of G have zero inner product. Hence every two codewords of C have zero inner product. Furthermore n = 6 = 2k. Therefore C is self-dual. Alternative: The generator matrix of the code has the form G = (I 3 P ) with P = I 3. Hence H = ( P T I 3 ) is a parity check matrix of the code. Now P T = I 3 over F 2. Hence G = H and C is self-dual. (4.c) By (4.b) we know that W C (X, Y ) = W C (X, Y ). We check this by using MacWilliams identity W C (X, Y ) = 2 3 W C (X + Y, X Y ) Now W C (X, Y ) = (X 2 + Y 2 ) 3. Hence W C (X, Y ) = 1 8 ((X + Y )2 + (X Y ) 2 )) 3 = 1 8 ((X2 + 2XY + Y ) + (X 2 XY + Y 2 )) 2 = 1 8 (2X2 + 2Y 2 ) 3 = (X 2 + Y 2 ) 3 = X 6 + 3X 4 Y 2 + 3X 2 Y 4 + Y 6. Therefore W C (X, Y ) = W C (X, Y ). (5.a) F 9 is the finite field with 9 elements with α F 9 such that α 2 = 1 + α. C is the F 9 -linear code Reed-Solomon code RS 3 (8, 1). Then α i = a i0 + a i1 α where the a ij F 3 are given in the following table. i α i (a i0, a i1 ) 0 α 0 (1, 0) 1 α 1 (0, 1) 2 α 2 (1, 1) 3 α 3 (1, 2) 4 α 4 (2, 0) 5 α 5 (0, 2) 6 α 6 (2, 2) 7 α 7 (2, 1) 8 α 8 (1, 0) 5
So α has order 8. Hence α generates F 9 and therefore is a primitive element of F 9. (5.b) The Reed-Solomon code RS k (n, b) is a F q -linear cyclic code with q = n + 1. It is an MDS code of length n, dimension k and minimum distance d = n + 1 k. Hence C = RS 3 (8, 1) is a code of length 8, dimension 3 and minimum distance d = 8 + 1 3 = 6. (5.c) Let a j = α j 1 and b j = a n b+1 j. Let a = (a 1,..., a n ) and b = (b 1,..., b n ). Then RS k (n, b) = GRS k (a, b). In particular if b = 1 we have that b j = a n j = 1 for all j. Hence 1, a,..., a k 1 is a basis of GRS k (a, b). Therefore the generator matrix of C = RS 3 (8, 1) is given by 1 1 1 1 1 1 1 1 1 α α 2 α 3 α 4 α 5 α 6 α 7 1 α 2 α 4 α 6 α 8 α 10 α 12 α 14 = 1 1 1 1 1 1 1 1 1 α α 2 α 3 α 4 α 5 α 6 α 7 1 α 2 α 4 α 6 1 α 2 α 4 α 6 (5.d) C is an MDS code with parameters [8, 3, 6] by (5.b). Hence its dual is also MDS with parameters [8, 5, 4]. Therefore the minimum distance of C is 4. (5.e) D is the extended code of C. It has length 8 + 1 = 9 and the generator matrix of D is obtained by taking a generator matrix of C and extend it with one column such that the sum of all rows is zero. If we apply this to the generator matrix obtained in (5.c) we get 1 1 1 1 1 1 1 1 1 1 α α 2 α 3 α 4 α 5 α 6 α 7 0 1 α 2 α 4 α 6 1 α 2 α 4 α 6 0 since 1 + + 1 = 9.1 = 0, 1 + α 4 = 0, α + α 5 = 0, α 2 + α 6 = 0 and α 3 + α 7 = 0 as one checks by inspecting the table. Let a = (a, 0) and let b be the all ones vector of length 9. Then D = GRS 3 (a, b ) and therefore D is MDS. (5.f) If we extend again we get a generator matrix with in the added, that is the 10-th column only zeros. Hence D ext has parameters [10, 3, 7] which is not MDS. 6
(6.a) For the syndrome s of r = (4, 0, 5, 6, 1, 2, 1) with respect to H holds 4 1 1 1 1 1 1 1 0 s T = Hr T = 0 1 2 3 4 5 6 5 8 0 1 4 9 5 3 3 6 = 4 0 1 8 5 9 4 7 1 0 2 6 1 (6.b) It is given that the received word r has two errors at the positions 4 and 6. In order to compute the error values we have to find a linear combination of the 4-th and 6-th column of H that equals the syndrome vector. That gives the extended matrix 1 1 8 3 5 4 9 3 0 5 4 6. Gaussian elimination of this matrix over F 11 gives 1 1 8 1 1 8 3 5 4 9 3 0 0 2 2 0 5 5 5 4 6 0 10 10 1 0 7 0 1 1 It has (7, 1) T as unique solution. That is, the error vector e has e 4 = 7 and e 6 = 1 and e i = 0 for all i {4, 6}. Therefore the transmitted codeword is c = r e = (4, 0, 5, 10, 1, 1, 1). 7