06.09.2014 Views

guava - Gap

guava - Gap

guava - Gap

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GUAVA 30<br />

[ 1 1 ]<br />

gap> m*C;<br />

[ 1 1 0 0 ]<br />

4.2.4 InformationWord<br />

♦ InformationWord(C, c)<br />

(function)<br />

Here C is a linear code and c is a codeword in it. The command InformationWord returns<br />

the message word (or ’information digits’) m satisfying c=m*C. This command simply calls Decode,<br />

provided c in C is true. Otherwise, it returns an error.<br />

To invert this, use the encoding function * (see * (4.2.3)).<br />

Example<br />

gap> C:=HammingCode(3);<br />

a linear [7,4,3]1 Hamming (3,2) code over GF(2)<br />

gap> c:=Random(C);<br />

[ 0 0 0 1 1 1 1 ]<br />

gap> InformationWord(C,c);<br />

[ 0 1 1 1 ]<br />

gap> c:=Codeword("1111100");<br />

[ 1 1 1 1 1 0 0 ]<br />

gap> InformationWord(C,c);<br />

"ERROR: codeword must belong to code"<br />

gap> C:=NordstromRobinsonCode();<br />

a (16,256,6)4 Nordstrom-Robinson code over GF(2)<br />

gap> c:=Random(C);<br />

[ 0 0 0 1 0 0 0 1 0 0 1 0 1 1 0 1 ]<br />

gap> InformationWord(C,c);<br />

"ERROR: code must be linear"<br />

4.3 Boolean Functions for Codes<br />

4.3.1 in<br />

♦ in(c, C)<br />

(function)<br />

The command c in C evaluates to ‘true’ if C contains the codeword or list of codewords specified<br />

by c. Of course, c and C must have the same word lengths and base fields.<br />

Example<br />

gap> C:= HammingCode( 2 );; eC:= AsSSortedList( C );<br />

[ [ 0 0 0 ], [ 1 1 1 ] ]<br />

gap> eC[2] in C;<br />

true<br />

gap> [ 0 ] in C;<br />

false

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!