guava - Gap
guava - Gap
guava - Gap
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Chapter 2<br />
A First Tutorial in GUAVA<br />
An error-correcting code is essentially just a subset of the set of all possible messages of a given length<br />
over some finite ”alphabet.”<br />
In algebraic coding theory, the ”alphabet” is usually some finite field (very often GF(2)) and<br />
frequently the error-correcting code is chosen to be a vector subspace of the space of all row vectors<br />
of some fixed length n. Such codes are known as Linear Codes, but, however a code is defined the<br />
point is to have a collection of ”codewords” that are said to be ”in the code” and any other word (row<br />
vectors that are not ”in the code”) will be assumed to be a codeword that has been mangled by the<br />
addition of noise.<br />
When a message is received that is not a codeword, we ask ourselves the question ”Which codeword<br />
is closest to this message I’ve received?” In other words we make the presumption that the<br />
received message is actually a codeword that has been changed in a relatively small number of positions<br />
– and we put them back the way they were supposed to be!<br />
That process is called ”decoding.” Developing codes that have efficient decoding algorithms is<br />
one of the central problems of algebraic coding theory.<br />
2.1 Working with codewords<br />
So let’s play around a bit.<br />
Start GAP in a terminal window, then issue the command<br />
Example<br />
gap> LoadPackage("<strong>guava</strong>");<br />
GUAVA can construct codewords in a variety of ways. One of the most typical cases is for a<br />
codeword to consist of binary digits. In that case we say that ”the code is over GF(2)” and codewords<br />
can be constructed as follows:<br />
Example<br />
gap> c1:=Codeword("101010101");<br />
[ 1 0 1 0 1 0 1 0 1 ]<br />
gap> v:=Z(2)*[1,1,1,1,1,1,1,1,1];<br />
[ Z(2)ˆ0, Z(2)ˆ0, Z(2)ˆ0, Z(2)ˆ0, Z(2)ˆ0, Z(2)ˆ0, Z(2)ˆ0, Z(2)ˆ0, Z(2)ˆ0 ]<br />
gap> c2:=Codeword(v);<br />
[ 1 1 1 1 1 1 1 1 1 ]<br />
gap> c3:=c1+c2;<br />
[ 0 1 0 1 0 1 0 1 0 ]<br />
gap> Weight(c1);<br />
14