65.12 DistanceCodeword

DistanceCodeword( c_1, c_2 )

DistanceCodeword returns the Hamming distance from c_1 to c_2. Both variables must be codewords with equal word length over the same Galois field. The Hamming distance between two words is the number of places in which they differ. As a result, DistanceCodeword always returns an integer between zero and the word length of the codewords.

    gap> a := Codeword([0, 1, 2, 0, 1, 2]);; b := NullWord(6, GF(3));;
    gap> DistanceCodeword(a, b);
    4
    gap> DistanceCodeword(b, a);
    4
    gap> DistanceCodeword(a, a);
    0 

Previous Up Top Next
Index

GAP 3.4.4
April 1997