01.08.2013 Views

Information Theory, Inference, and Learning ... - MAELabs UCSD

Information Theory, Inference, and Learning ... - MAELabs UCSD

Information Theory, Inference, and Learning ... - MAELabs UCSD

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Copyright Cambridge University Press 2003. On-screen viewing permitted. Printing not permitted. http://www.cambridge.org/0521642981<br />

You can buy this book for 30 pounds or $50. See http://www.inference.phy.cam.ac.uk/mackay/itila/ for links.<br />

13.10: Dual codes 217<br />

One way of thinking of this equation is that each row of H specifies a vector<br />

to which t must be orthogonal if it is a codeword.<br />

The generator matrix specifies K vectors from which all codewords<br />

can be built, <strong>and</strong> the parity-check matrix specifies a set of M vectors<br />

to which all codewords are orthogonal.<br />

The dual of a code is obtained by exchanging the generator matrix<br />

<strong>and</strong> the parity-check matrix.<br />

Definition. The set of all vectors of length N that are orthogonal to all codewords<br />

in a code, C, is called the dual of the code, C ⊥ .<br />

If t is orthogonal to h1 <strong>and</strong> h2, then it is also orthogonal to h3 ≡ h1 + h2;<br />

so all codewords are orthogonal to any linear combination of the M rows of<br />

H. So the set of all linear combinations of the rows of the parity-check matrix<br />

is the dual code.<br />

For our Hamming (7, 4) code, the parity-check matrix is (from p.12):<br />

H = P I3<br />

⎡<br />

<br />

= ⎣<br />

1 1 1 0 1 0<br />

⎤<br />

0<br />

0 1 1 1 0 1 0 ⎦ . (13.28)<br />

1 0 1 1 0 0 1<br />

The dual of the (7, 4) Hamming code H (7,4) is the code shown in table 13.16.<br />

0000000<br />

0010111<br />

0101101<br />

0111010<br />

1001110<br />

1011001<br />

1100011<br />

1110100<br />

A possibly unexpected property of this pair of codes is that the dual,<br />

H ⊥ (7,4) , is contained within the code H (7,4) itself: every word in the dual code<br />

is a codeword of the original (7, 4) Hamming code. This relationship can be<br />

written using set notation:<br />

H ⊥ (7,4) ⊂ H (7,4). (13.29)<br />

The possibility that the set of dual vectors can overlap the set of codeword<br />

vectors is counterintuitive if we think of the vectors as real vectors – how can<br />

a vector be orthogonal to itself? But when we work in modulo-two arithmetic,<br />

many non-zero vectors are indeed orthogonal to themselves!<br />

⊲ Exercise 13.7. [1, p.223] Give a simple rule that distinguishes whether a binary<br />

vector is orthogonal to itself, as is each of the three vectors [1 1 1 0 1 0 0],<br />

[0 1 1 1 0 1 0], <strong>and</strong> [1 0 1 1 0 0 1].<br />

Some more duals<br />

In general, if a code has a systematic generator matrix,<br />

G = [IK|P T ] , (13.30)<br />

where P is a K × M matrix, then its parity-check matrix is<br />

H = [P|IM ] . (13.31)<br />

Table 13.16. The eight codewords<br />

of the dual of the (7, 4) Hamming<br />

code. [Compare with table 1.14,<br />

p.9.]

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

Saved successfully!

Ooh no, something went wrong!