#GLORIA LIU, Feb 17 2024, Assignment 8 read `C9.txt`: #=====================================# #1. Write a Maple procedure #WtEnumerator(q,M,t) #that inputs a generating matrix M (with k rows say, so so it is an [n,k,d] code for some d )for a linear code over GF(q) (q prime) and outputs the #Sum(t^wt(v), v in C) #over all the q^d vectors v in the code (including the zero-vector of weight 0) wt:=proc(v) local i, result: result:=0: for i in v do if i<>0 then result:=result + 1: fi: od: result: end: WtEnumerator:=proc(q,M,t) local C,v: C:=LtoC(q,M): add(t^(wt(v)), v in C): end: #=====================================# #2. Find a relation between WtEnumerator(q,M,t) and WtEnumerator(q,H,t) where H is the PCM(q,M) (and #hence a generating matrix for the dual code). First do it for q=2, then for other q, and try to #discover the relation (if it exists) result:=Array(1..3, 7..10, 1..2, []): for i from 1 to 3 do: for n from 7 to 10 do: k:=rand(1..n-1)(): q:=ithprime(i): M1:=[seq(RV(q,n), i=1..k)]: M:=SFde(q,M1): H:=PCM(q,M): result[i,n,1]:=WtEnumerator(q,M,t): print("M",result[i,n,1]); result[i,n,2]:=WtEnumerator(q,H,t): print("H",result[i,n,2]); od: od: result; #I am not sure of the relation between the WtEnumerator of M and H.