#OK to post homework #GLORIA LIU, Feb 10 2024, Assignment 6 read `C7.txt`: #=====================================# #1. Read and understand chapter 5 of Raymond Hill's book. #Done #=====================================# #2. do excercies 5.1, 5.2, 5.3, 5.5 (p. 53). #5.1 #No because binary linear codes need to have 2^k elements and 24 is not a power of 2. #5.2 #From 2.4 in the homework 5 we saw that En is obtained by adding an overall parity check to the code (F2)^(n-1). #So it has the same dimension as (F2)^(n-1) and we can modify the generating matrix for (F2)^(n-1). #It is a [n, n-1 ,2]-code #5.3 #This set is a linear code because it is closed under addition and scalar multiplication. #If v and u are both in C, then v*(H^T) + u*(H^T) = 0. #However, v+u would also be in C, since v*(H^T) + u*(H^T) = 0 is also equal to (v+u)*(H^T). #If v is in C, and a is an element of GF(q), then (a*v)*(H^T) = a*(v*(H^T) = a*0 = 0, so av is also part of C. #5.5 #It's possible to have a linear code with all even weight as seen in 5.2. #Assume that one of the codewords in a binary linear code, v, has odd weight. #Adding an odd weight codeword to an even weight codeword results in an odd weight codeword. #Since linear codes are closed under addition, if there are x even weight codewords there have to be at least x odd weight codewords #In addition adding odd codewords together results in an even codeword. So, there are at least as many even weight codewords as odd weight codewords. #So, there are an equal number of odd weight and even weight codewords in the code if at least one of the codewords is odd. #=====================================# #3. Write a program #SearchLC(q,n,k,K) #That inputs q and n for GF(q)^n, and k (for the dimension of the linear code, a certain subspace of GF(q)^n) and a very large positive integer K (say 1000) and keeps generationg, K times, random lists, M, of k members of GF(q)^n, for each determines MinW(q,M) and outputs the one with the largest minimum weight. #Run it, with K=1000 for q=2,3,5 ; 4 ≤ n ≤ 10 ; ; and 3 ≤ k ≤ 5 . SearchLC:=proc(q,n,k,K) local maxMinWeight,i,M,curWeight: maxMinWeight := 0: for i from 1 to K do M := [seq(RV(q, n), i = 1..k)]: curWeight := MinW(q,M): maxMinWeight := max(curWeight, maxMinWeight): od: maxMinWeight: end: K:=1000: qList:=[2,3,5]: A:=Array(1..3, 4..10, 3..5, []): for q1 from 1 to 3 do q:=qList[q1]: for n from 4 to 10 do for k from 3 to 5 do A[q1,n,k]:=SearchLC(q,n,k,K); od: od: od: print(A); #=====================================# #4. #Write a porgram all by yourself, (not using the Maple Linear Algebra package) #SF(q,M) #that inputs q (for GF(q)^n) a generating matrix M ( a list of vectors of lenght n in GF(q)^n), and k=nops(M), and outputs the matrix in statdard form, i.e. of the from #[Ik|A] #where Ik is the k by k identity matrix and A is k by (n-k) matrix. #Skipped