Weights of Linear Codes and Their Dual
Total Page:16
File Type:pdf, Size:1020Kb
Bolcar: Weights of Linear Codes and their Dual On the Weights of Linear Codes and their Dual Lauren Bolcar Fall 2019 MA 398, Dr. Molitierno Faculty Mentor: Dr. Boyle Published by DigitalCommons@SHU, 2020 1 Academic Festival, Event 102 [2020] Abstract Codes were invented to detect and correct transmission errors caused by noise on a communication channel. In this paper, we will look at linear codes as well as the dual code and the matrices that allow us to convert between the two. For linear codes, the error correcting capabilities of a code are determined by the weights, in particularly the minimum weight, of the codewords. We will explore these weights and how to find their minimum value as well as introduce the MacWilliams Theorem, which connects the weights of a code to the weights of its dual. https://digitalcommons.sacredheart.edu/acadfest/2020/all/102 2 Bolcar: Weights of Linear Codes and their Dual 1 1 Introduction to Coding Theory When information or messages are transmitted to some receiver, it is done so through a communication channel. Ideally, at the end of this transmission, the information obtained at the receiving end is the same information that was sent into the channel. In reality, however, this is not always the case, since it is likely that errors will occur during transmission. This is because our messages are sent over a noisy channel, which simply means that some sort of distraction of interruption happened in the channel that caused what was received to be di↵erent than what was sent. As a result, codes were invented to detect and correct transmission errors caused by noise on the channel. 2 Background DEFINITION 2.1 A code C over an alphabet A is a subset of An := A ... A ⇥ ⇥ (n copies). For the purpose of this paper, A will always be a finite field. In particular, we will consider the binary field F2 := 0, 1 ,whereadditionandmultiplicationare { } done modulo 2. DEFINITION 2.2 Elements of a code are called codewords,andthelength of the code is n. When A is a field, C An is called a linear code if it is a vector ⇢ Published by DigitalCommons@SHU, 2020 3 Academic Festival, Event 102 [2020] 2 subspace of An.Thedimension k of C is defined to be the dimension of C as a vector space over A.Together,n and k are called the parameters of C.Wecall the code an [n, k]code. Recall that a vector subspace is closed under linear operations. Thus, if x, y 2 C,thenax + by C for all a, b A. Also, recall that the dimension of a vector 2 2 space is, by definition, the number of vectors in a basis, or, equivalently, the number of nonzero rows when in reduced row echelon form. For a linear code C of length n and dimension k over F2,therearek basis elements for C,eachofwhichisavectoroflengthn. DEFINITION 2.3 Let C be a linear [n, k]code.Agenerator matrix for C is a k n matrix such that the rows are the basis vectors for C. ⇥ For example, consider the 3 6generatormatrix ⇥ 100110 2 3 G = . (2.1) 6 0100117 6 7 6 7 6 7 6 0011017 6 7 4 5 Since G is in reduced row echelon form, its rows are the basis vectors of some linear code C.Weseethatthereare3vectorsinthebasis,eachoflength6, meaning that we have a [6, 3] code with length n =6anddimensionk =3. The code C is the set of all possible linear combinations of the rows of G.If https://digitalcommons.sacredheart.edu/acadfest/2020/all/102 4 Bolcar: Weights of Linear Codes and their Dual 3 G is a generator matrix for C,thenC is exactly the set k uG u F2 , (2.2) { | 2 } where u is all the possible 1 k binary row message vectors and G is of the form ⇥ G =[I P ]. (2.3) k| In (2.3), I is the k k identity matrix and P is a k (n k) matrix of 0’s and k ⇥ ⇥ − 1’s. THEOREM 2.4 Let a linear code C be a vector space over F2. If dim(C) = k, then C has 2k codewords. Proof:Supposedim(C)=k and let x1, x2,...,xk be a basis for C.Then,C = λ1x1 + λ2x2 + ...+ λkxk where λ1,λ2,...,λk F2.SinceF2 =2,thereare 2 | | exactly 2 choices for each λ1,λ2,...λk.Eachchoicegivesadi↵erentwordandso C has exactly 2k codewords. 2 Continuing with our example, then, using the matrix in (2.1), C has 23 =8 codewords and is the set as described in (2.2). Each codeword can therefore be found by multiplying the generator matrix G on the left by a possible message vector. For instance, using the message vector u = 110 , Published by DigitalCommons@SHU, 2020 5 Academic Festival, Event 102 [2020] 4 we get that one codeword is 100110 2 3 = . 110 6 0100117 110101 6 7 6 7 6 7 6 0011017 6 7 4 5 The other codewords would similarly be obtained by doing the multiplication with the 7 other possible 1 3messagevectors.ThecodeC then contains the following ⇥ codewords: 100110 010011 001101 111000 (2.4) 110101 101011 011110 000000. Notice also that, in accordance with (2.3), 100 110 2 3 2 3 I = and P = . (2.5) k 6 0107 6 0117 6 7 6 7 6 7 6 7 6 7 6 7 6 0017 6 1017 6 7 6 7 4 5 4 5 DEFINITION 2.5 If C is an [n, k]linearcodeoverF2,itsdual code C? is the set of vectors which are orthogonal to all codewords of C: C? = v u v =0forallu C . { | · 2 } The dual code C? is an [n, n k] code, which can be proven using the following − lemmas and the Rank-Nullity Theorem from Linear Algebra [5]. https://digitalcommons.sacredheart.edu/acadfest/2020/all/102 6 Bolcar: Weights of Linear Codes and their Dual 5 LEMMA 2.6 C? is a linear code. Proof:Ify, y0 C?,thenx y = x y0 =0forallx C. This implies that 2 · · 2 x (y + y0)=x y + x y0 =0forallx C and that x (λy)=λ(x y)=λ(0) = 0 · · · 2 · · for all x C.Thus,C? is a linear code. 2 2 LEMMA 2.7 Let G be a generator matrix of the code C. The dual code C? = T Null G, or, equivalently, w C? if and only if Gw =0. 2 Proof:Letg denote the rows of G for 1 i k.Then,g ,...,g are the i 1 k codewords that form a basis for C.WewillshowGwT = 0 if and only if g w i · for all i. ( )Letw C?.Then,u w =0forallu C.SincetherowsofG are the ( 2 · 2 codewords of C, g w =0fori =1,...k.So,GwT =0. i · ( ) Assume that g ,...g are the rows of G and that GwT =0.Then,g w =0 ) 1 k i · for all i.SincetherowsofG form a basis of C,ifx is any codeword of C,then k x = aigi for some scalers ai F2.So, i=1 2 P k k w x = a (w g )= a 0=0. · i · i i · i=1 i=1 X X So, w is orthogonal to every codeword in C,whichimpliesthatw C?. 2 Thus, C? = Null G. 2 Published by DigitalCommons@SHU, 2020 7 Academic Festival, Event 102 [2020] 6 THEOREM 2.8 If C is an [n, k] linear code over F , then C? is an [n, n k] 2 − code over F2. n Proof:SupposeC is an [n, k]linearcodeoverF2.Then,C is a subspace of F2 and the dimension of C is k.LetG be a generator matrix for C. By the Rank-Nullity Theorem from Linear Algebra, Rank G + dim(Null G)=n.Since,bydefinition, Rank G is equal to the number of nonzero rows when G is in row reduced form, which is equal to dim C,thenRankG = k.So,k + dim(Null G)=n implies that dim(Null G)=n k. − n By Lemma 2.6, C? is a linear code, so C? is a subspace of F2 .SinceC? is the null space of G by Lemma 2.7 and dim(Null G)=n k,thendimC? = − n dim(Null G)=n k.So,C? is an n k dimensional subspace of F2 .Thus,C? − − is an [n, n k]code. 2 − DEFINITION 2.9 A parity check matrix H for an [n, k]codeisan(n k) n − ⇥ matrix which is a generator matrix of C?,givenby T H =[P In k]. (2.6) | − THEOREM 2.10 If G is the generator matrix of C given by [I P ], then H is k| the generator matrix of C?, or, equivalently, the parity check matrix of C. https://digitalcommons.sacredheart.edu/acadfest/2020/all/102 8 Bolcar: Weights of Linear Codes and their Dual 7 Proof:LetG be the generator matrix of C given by [I P ], where, as a reminder, k| I is the k k identity matrix and P is a k (n k) matrix. Assume that k ⇥ ⇥ − T H =[P In k]andrankH = n k.Then, | − − T P GH =[Ik P ] = IkP + PIn k. In k − − When in the binary case, though, P = P as 1=1and0=0inmodulo2. So, − − T GH = Ik( P )+PIn k = P + P =0. − − − Thus, GHT =0impliesthattherowsofH are orthogonal to the rows of G.Since the rows of G represent the codewords of C,thisindicatesthattherowsofH are in C?.WealsoknowthatthedimC? = n k by Theorem 2.8 and that − the dimension of a code equals the rank of its generator matrix.