SphereContent( n, t, F )
SphereContent
returns the content of a ball of radius t around an
arbitrary element of the vectorspace <F>^<n>. This is the cardinality
of the set of all elements of <F>^<n> that are at distance (see
DistanceCodeword) less than or equal to t from an element of
<F>^<n>.
In the context of codes, the function is used to determine if a code is perfect. A code is perfect if spheres of radius t around all codewords contain exactly the whole vectorspace, where t is the number of errors the code can correct.
gap> SphereContent( 15, 0, GF(2) ); 1 # Only one word with distance 0, which is the word itself gap> SphereContent( 11, 3, GF(4) ); 4984 gap> C := HammingCode(5); a linear [31,26,3]1 Hamming (5,2) code over GF(2) #the minimum distance is 3, so the code can correct one error gap> ( SphereContent( 31, 1, GF(2) ) * Size(C) ) = 2 ^ 31; true
GAP 3.4.4