> # download from > http://wwwcip.informatik.uni-erlangen.de/~sitsschn/thi3/ > restart: with(LinearAlgebra:-Modular): > # Exercise 11.2 > G:=Mod(2,[[1,0,1,1,1],[0,1,1,0,1],[1,1,0,0,0]],integer); [1 0 1 1 1] [ ] G := [0 1 1 0 1] [ ] [1 1 0 0 0] > # Gaussian elimination mod 2: > G´:=Copy(2,G): > AddMultiple(2,G´,1,G´,3,G´,3); # R3+=R1 > AddMultiple(2,G´,2,G´,3,G´,3); # R3+=R2 > Swap(2,G´,1..-1,3,G´,1..-1,4); # C3 <-> C4 > AddMultiple(2,G´,1,G´,3,G´,1); # R1+=R3 > G´:=G´; > A:=Copy(2,G´,1..-1,4..-1); # G=[E_3|A] > H´:=Create(2,2,5,integer): > Copy(2,Transpose(2,A),H´,1..-1,1..3); > E2:=> Mod(2,[[1,0],[0,1]],integer): > Copy(2,E2,H´,1..-1,4..-1); > H´:=H´; > H:=Copy(2,H´): > Swap(2,H,1..-1,3,H,1..-1,4); # C3 <-> C4 > H:=H; [1 0 0 1 1] [ ] G? := [0 1 0 1 1] [ ] [0 0 1 0 0] [1 1] [ ] A := [1 1] [ ] [0 0] [1 1 0 1 0] H? := [ ] [1 1 0 0 1] [1 1 1 0 0] H := [ ] [1 1 0 0 1] > # compute H * G^T - should be 0 > K:=Multiply(2,H,Transpose(2,G)); [0 0 0] K := [ ] [0 0 0] > # Exercise 11.3 > H:=Mod(2,[[1,1,0,0,1,0,0],[0,0,1,1,0,1,0],[1,1,1,1,0,0,1]],integer); [1 1 0 0 1 0 0] [ ] H := [0 0 1 1 0 1 0] [ ] [1 1 1 1 0 0 1] > AT:=Copy(2,H,1..-1,1..4); # H=[AT|E_3] > G:=Create(2,4,7,integer): > Copy(2,Transpose(2,AT),G,1..-1,5..-1); > E4:=Mod(2,[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],integer): > Copy(2,E4,G,1..-1,1..4); > G:=G; [1 1 0 0] [ ] AT := [0 0 1 1] [ ] [1 1 1 1] [1 0 0 0 1 0 1] [ ] [0 1 0 0 1 0 1] G := [ ] [0 0 1 0 0 1 1] [ ] [0 0 0 1 0 1 1] > # compute H * G^T - should be 0 > K:=Multiply(2,H,Transpose(2,G)); [0 0 0 0] [ ] K := [0 0 0 0] [ ] [0 0 0 0] > # test if dmin <= 2 > Multiply(2,Mod(2,[[1,1,0,0]],integer),G); [1 1 0 0 0 0 0] > # eval syndromes > Multiply(2,H,<0,0,0,0,1,1,0>); > Multiply(2,H,<0,0,1,0,1,0,0>); [1] [ ] [1] [ ] [0] [1] [ ] [1] [ ] [1]