The
-Hamming code over
having
generator matrix
C:=HammingCode(3,GF(2)); G:=GeneratorMat(C); Display(G);Encoding a message
Elements(C); Size(Elements(C));
From this, you see all the codewords of C and how many there are.
To get the parity check matrix, type
H:=CheckMat(C); Display(H);
Note all the columns of
are distinct and non-zero.
To see if a vector in
is a codeword,
simply compute
and check if it is zero or not.
Here's a GAP example:
e:=Z(2)*[1,0,0,0,0,0,0]; c := "1010"*C; v:=c+e; v in C;
Since this last vector is non-zero,
is not a codeword.
If it was a vector received in transmission
(with at least one error) then to decode it,
hence to find the most likely codeword
sent, type
Decode(C,v);
(b) Find a parity check matrix of the
-ary Hamming
code of length
.
Verify
for three or four codewords
.
Decode
.
To get the dimension of the code, type
Dimension(C); To get its
minimum distance, type MinimumDistance(C);
(a) the binary Hamming code of length
,
(b) the 3-ary Hamming code of length
.