RHcoding
RHcoding
‘ =
“ f2-
& aa 7 ao
Asoaul Bulpos> ul asuno> ysul4 V7
—
i ft
OXFORD APPLIED MATHEMATICS AND COMPUTING SCIENCE SERIES |
A First Course
in Coding Theory
Raymond Hill
*
te
le
qyo4xo
Oxford Applied Mathematics
and Computing Science Series
Oxford Applied Mathematics
and Computing Science Series
A First Course
in Coding Theory
/
) c-ansnoox PRESS « OXFORD
Oxford University Press, Great Clarendon Street, Oxford OX2 6DP
Acknowledgements
I am grateful to Professors P. G. Farrell and J. H. van Lint, and
Drs J. W. P. Hirschfeld, R. W. Irving, L. O’Carroll, and R.
Sandling for helpful comments and suggestions, and to B.
Banieqbal for acquainting me with the work of Ramanujan,
which now features prominently in Chapter 11.
I should also like to thank Susan Sharples for her excellent
typing of the manuscript.
R.H.
Contents
Page
Notation x1
decoding 67
The Hamming codes 81
oO
Perfect codes 97
10 Codes and Latin squares 113
11 A double-error correcting decimal code and an
introduction to BCH codes 125
12 Cyclic codes 141
13 Weight enumerators 165
14 The main linear coding theory problem 175
15 MDS codes 191
16 Concluding remarks, related topics, and further
reading 201
For the reader who is unfamiliar with the notation of modern set
theory, we introduce below all that is required in this book.
A set is simply a collection of objects. In this book we shall
make use of the following sets (among others):
R: the set of real numbers.
Z: the set of integers (positive, negative, or zero).
Z,: the set of integers from 0 to n — 1 inclusive.
The objects in a set are often called its elements or its
members. If x is an element of the set S$, we write x e S, which is
read ‘x belongs to S’ or ‘x belonging to S’ as the context requires.
If x is not an element of S we write x¢éS. Thus 2¢€ Z but 4¢Z.
Two sets are equal if they contain precisely the same elements.
The set consisting precisely of elements x,,%,...,x, is often
denoted by {x,,%.,...,x,}. For example, Z;= {0,1,2}. Also
Z, = {0, 2,1} = {2, 1, 0}.
If S is a set and P a property (or combination of properties)
which elements x of S may or may not possess, we can define a
new set with the notation
{x «S| P(x)}
which denotes ‘the set of all elements belonging to S which have
property P’. For example, the set of positive integers could be
written {x € Z|x >0} which we read as ‘the set of elements x
belonging to Z such that x is greater than 0’. The set of all even
integers can be denoted by {2n |ne€ Z}.
A set T is called a subset of a set S if all the elements of T
belong to S. We then say that ‘T is contained in S’ and write
T cS, or that ‘S contains 7’ and write $a T.
If S and T are sets we define the union S UT of S and T to be
the set of all elements in either S or 7. We define the intersection
ST of S and T to be the set of all elements which are members
of both S$ and T. Thus
SUT ={x|xeSorxeT},
SOT ={x|xeS
and x eT}
Xl Notation
|S x T| = [S| -|T7|
for, in forming an element (s, t) of S x T, we have |S| choices for
s and |T| choices for ¢. In particular |S?| = |S|?.
More generally we define the Cartesian product of n sets
S,,S5,...,8, to be a set of ordered n-tuples thus:
S, X S, Xx - XS, = {(51, 8, . oe ,5,)|5,;€8;,i=1,2,. ee jn}.
S"|
= |S|".
Finally we remark that in this book we shall often write an
ordered n-tuple (x1, %»,...,%,) simply as x,x,---X,.
1 Introduction to error-correcting codes
Figure 1.1
Noise
1 Received Decoded
Message Message Codeword vector message
source ——> | Encoder | —————» | Channel | —————-» | Decoder | ——--—» User
Example 1.2
\
Here two errors have occurred and the decoder has decoded the
received vector 01001 as the ‘nearest’ codeword which is 00000 or
YES.
2 A first course in coding theory
A binary code is just a given set of sequences of Os and 1s
which are called codewords. The code of Example 1.2 is
{00000, 11111}. If the messages YES and NO are identified with
the symbols 0 and 1 respectively, then each message symbol is
encoded simply by repeating the symbol five times. The code is
called a binary repetition code of length 5. This is an example of
how ‘redundancy’ can be added to messages to protect them
against noise. The extra symbols sent are themselves subject to
error and so there is no way to guarantee accuracy; we just try to
make the probability of accuracy as high as possible. Clearly, a
good code is one in which the codewords have little resemblance
to each other.
More generally, a g-ary code is a given set of sequences of
symbols where each symbol is chosen from a set F, = {A;, Ao,
...,4A,} of q distinct elements. The set F, is called the alphabet
and is often taken to be the set Z,={0,1,2,...,q—-1}.
However, if g is a prime power (i.e. q=p” for some prime
number p and some positive integer ) then we often take the
alphabet F, to be the finite field of order gq (see Chapter 3). As
we have already seen, 2-ary codes are called binary codes; 3-ary
codes are sometimes referred to as ternary codes.
Example 1.3. (1) The set of all words in the English language is
a code over the 26-letter alphabet {A,B,..., Z}.
(ii) The set of all street names in the city of Salford is a
27-ary code (the space between words is the 27th symbol) and
provides a good example of poor encoding, for two street names
on the same estate are HILLFIELD DRIVE and MILLFIELD
DRIVE.
A code in which each codeword is a sequence consisting of a
fixed number n of symbols is called a block code of length n.
From now on we shall restrict our attention almost exclusively to
such codes and so by ‘code’ we shall always mean ‘block code’.
A code C with M codewords of length n is often written as an
M Xn array whose rows are the codewords of C. For example,
the binary repetition code of length 3 is
000
111.
Let (F,)” denote the set of all ordered n-tuples a= aja): - a,
where each a;¢€ F,. The elements of (F,)” are called vectors or
Introduction to error-correcting codes 3
words. The order of the set (F,)” is gq”. A q-ary code of length n
is just a subset of (F,)”.
Figure 1.6
4 A first course in coding theory
That is, we identify the four messages N, W, E, S with the four
vectors of (F,)*. Let us see how, as in Example 1.1, redundancy
can be added to protect these message vectors against noise.
Consider the length 3 code C, obtained by adding an extra digit
as follows.
000
O11
101
110.
00000
01101
3=
10110
11011.
The first two conditions are very easy to verify. The third,
known as the triangle inequality, is verified as follows. Note that
d(x, y) is the minimum number of changes of digits required to
change x to y. But we can also change x to y by first making
d(x,z) changes (changing x to z) and then d(z,y) changes
(changing z to y). Thus d(x, y) =d(x, z) + d(z, y).
The Hamming distance will be the only metric considered in
this book. However, it is not the only one possible and indeed
may not always be the most appropriate. For example, in (Fi)°
we have d(428, 438) = d(428, 468), whereas in practice, e.g. in
dialling a telephone number, it might be more sensible to use a
metric in which 428 is closer to 438 than it is to 468.
Let us now consider the problem of decoding. Suppose a
codeword x, unknown to us, has been transmitted and that we
receive the vector y which may have been distorted by noise. It
seems reasonable to decode y as that codeword x’, hopefully x,
such that d(x’,y) is as small as possible. This is called nearest
neighbour decoding. This strategy will certainly maximize the
decoder’s likelihood of correcting errors provided the following
assumptions are made about the channel.
(i) Each symbol transmitted has the same probability p(<4)
of being received in error.
(ii) If a symbol is received in error, then each of the gq —1
possible errors is equally likely.
Such a channel is called a g-ary symmetric channel. The binary
symmetric channel is shown in Fig. 1.7.
6 A first course in coding theory
Figure 1.7
1-p
0 > 0
1 —> 1
sent 1-p received
d(C)
= min {d(x, y)|x, ye C, x#y}.
For example, it is easily checked that for the codes of Example
1.5, d(C,) =1, d(C) =2 and d(C;) = 3.
{Note: The reader may find Remark 2.12 helpful in clarifying this
proof.|
8 A first course in coding theory
Corollary 1.10 If acode C has minimum distance d, then C can
be used either (i) to detect up to d — 1 errors, or (11) to correct up
to |(d —1)/2| errors in any codeword.
(|x| denotes the greatest integer less than or equal to x).
OO
NO
©
WNF&F
QW
&
&
KR
On
NO
na
DN
TON
W
=
Exercises 1
0011000001 10001111111101100100110010011001011110001
00100010010001001001100110
1.2 Suppose the binary repetition code of length 5 is used for
a binary symmetric channel which has symbol error
probability p. Show that the word error probability of the
code is 10p* — 15p* + 6p.
1.3 Show that a code having minimum distance 4 can be used
simultaneously to correct single errors and detect double
errors.
1.4 The code used by Mariner 9 will correct any received
32-tuple provided not more than ... (how many?) errors
have occurred.
1.5 (i) Show that a 3-ary (3, M, 2)-code must have M <9.
(ii) Show that a 3-ary (3, 9, 2)-code does exist.
(iii) Generalize the results of (i) and (ii) to q-ary
(3, M, 2)-codes, for any integer g =2.
2 The main coding theory problem
Example 2.2 We will determine the value A,(5, 3). The code C,
of Example 1.5 is a binary (5, 4, 3)-code and so A,(5, 3) =4. But
can we do better? To show whether there exists a binary
(5,5,3)-code a brute-force method would be to consider all
subsets of order 5 in (4)° and find the minimum distance of each.
Unfortunately there are over 200 000 such subsets (see Example
2.11(iii)), but, by using the following notion of equivalence, the
search can be considerably reduced. We will return to Example
2.2 shortly.
12 A first course in coding theory
Equivalence of codes
00100
00011
11111
11000
Proof Choose any codeword x,x,-- +x, and for each x,;#0 apply
the permutation
/0 xi J
1 J J for all 740, x;
x, O J
to the symbols in position 1.
Table 2.4
5 4 2 —
6 8 2 —
7 16 2 2
8 20 4 2
9 40 6 2
10 72-79 12 2
11 144-158 24 4
12 256 32 4
13 512 64 8
14 1024 128 16
15 2048 256 32
16 2560-3276 256-340 36-37
The main coding theory problem 15
MacWilliams and Sloane (1977). Where the value of A,(n, d) is
not known, the best available bounds are given; for example, the
entry 72—79 indicates that 72 = A,(10, 3) <79.
Many of the entries of Table 2.4 will be established during the
course of this book (we have already verified the first entry in
Example 2.2). In Chapter 16 we shall again consider Table 2.4
and review the progress we have made.
The reason why only odd values of d need to be considered in
the table is that if d is an even number, then A,(n,d)=
A,(n —1,d—1), a result (Corollary 2.8) towards which we now
proceed.
Taking F, to be the set {0,1}, we define two operations on
(F,)". Let x=x,X,-+-x, and y=y,jy.---y, be two vectors in
(F,)". Then the sum x + y is the vector in (F,)” defined by
x+y= (x; + V1, X_ + yo, 22 0 Xp + y,),
Binomial coefficients
If n and m are integers with 0<m <n, then the binomial coeffi-
. n ,
cient ( ), pronounced ‘n choose m’, is defined by
m
(") =
where m! =m(m — 1):-+3.2.1 for m>0
and Q!=1.
ways, for the first object can be chosen in any of n ways, then the
second in any of n—1 ways, and so on. Since there are
m(m—1)::+:2.1=m! ways of ordering the m objects chosen,
the number of unordered selections is
n!}
m!(n—m)!-
Definition. For any vector u in (F,)” and any integer r=0, the
sphere of radius r and centre u, denoted S(u,r), is the set
{v € (F,)” | d(u, v) <r}.
Figure 2.13
—»~
ey
Figure 2.14
So if t or fewer errors occur in a codeword x, then the received
vector y may be different from the centre of the sphere S(x, fr),
but cannot ‘escape’ from the sphere, and so is ‘drawn back’ to x
by nearest neighbour decoding (see Fig. 2.14).
© Ge (anae Canoe
Remark The numbers (”) are called binomial coefficients
Perfect codes
Figure 2.22
Blocks
Bi B, Bs By, Bs Be B,
(1 1 0 0 0 1 0 1
2 1 1 0 0 0 1 0
3 0 1 1 0 0 0 1
Varieties 4 4 1 0 1 1 0 0 0
5 0 1 0 1 1 0 0
6 0 0 1 0 1 1 0
7 0 0 0 1 0 1 1
The 7 X 7 matrix of Os and 1s thus obtained is called an incidence
matrix of the design. More formally we have:
Example 2.23 Let A be the incidence matrix of Fig. 2.22 and let
B be the 7 X7 matrix obtained from A by replacing all Os by 1s
and all 1s by Os. Let C be the length 7 code whose 16 codewords
are the rows a,,@,...,a, of A, the rows b,, b,,...,b, of B and
the additional vectors 0 = 0000000 and 1= 1111111. Thus
C=0000000=0 010110 0=a;, 100111 0=b,
1111111=1 0010110=a 0100111=b,
1000101=a, 0001011=a 101001 1=b,
1100010=a 0111010=b, 110100 1=b,
0110001=a,0011101=b1110100=b,
101100 0=a,
24 A first course in coding theory
We will show that the minimum distance of C is 3, 1.e. that
d(x, y)=3 for any pair of codewords x,y. By the incidence
properties of the (7,7, 3,3, 1)-design, each row of A has exactly
3 1s and any two distinct rows of A have exactly one 1 in
common. Hence, by Lemma 2.6,
d(a;,a,)=3+3-2.1=4 fori¥j.
Since distances between codewords are unchanged if all Os are
changed to 1s and all 1s to Os, we have also that
d(b;,b;) =4 for iF].
It is clear that
16{(;) +(;)) =”
we have equality in (2.18) and so the code is perfect.
The existence of a perfect binary (7, 16,3)-code shows that
A,(7, 3) = 16 and so we have established another of the entries of
Table 2.4.
In leaving the code of Example 2.23 we note that it has the
remarkable property that the sum of any two codewords is also a
codeword! Interestingly, the (5, 4,3)-code of Example 2.2 has
the same property. Such codes are called linear codes and play a
central role in coding theory. We shall begin to study the theory
of such codes in Chapter 5.
Notes
(1) From now on we will generally write a - b simply as ab.
(2) We can regard a field F as having the four operations +, —,
- and +, where — and + are given by (vii) and (viii)
respectively with the understanding that a—b=a+(-—b)
and a + b, or a/b, =a(b“") for b40.
32 A first course in coding theory
(3) The reader who has done any group theory will recognize
that a field can be more concisely defined to be a set of
elements such that
(a) itis an abelian group under +,
(b) the non-zero elements form an abelian group under -,
(c) the distributive law holds.
(4) The following two further properties of a field are easily
deduced from the definition.
0 Ola b 0 0000
1 10ba 1 Olab
a abol a Oabil
b bail10 b Obla
x |) 123456789 10
x7! | 16439287510
To illustrate the use of this table, we will divide 6 by 8 in the field
GF(11). We have
§=6:8'=6:7=42=9.
We can give an immediate application of the use of modulo 11
arithmetic in an error-detecting code.
The left-hand side of (3.7) is called the weighted check sum of the
number X,X.°*-*X 9. Thus for the 9-digit number x,x,--: Xp
already chosen, x, is defined by
9
= >) ix, (mod 11)
to get the ISBN. i=l
The publisher 1s forced to allow a symbol X in the final
position if the check digit x,) turns out to be a ‘10’; e.g.
Chambers Twentieth Century Dictionary has ISBN 0550-10206-X.
The ISBN code is designed to detect (a) any single error and
(b) any double-error created by the transposition of two digits.
The error detection scheme is simply this. For a received vector
yiy2°** Yio calculate its weighted check sum Y=) }°, iy,. If
Ye0 (mod 11), then we have detected error(s). Let us verify that
this works for cases (a) and (b) above. Suppose x = x,x, ++ + X49 iS
the codeword sent.
(a) Suppose the received vector y = y,y2-- + yo is the same as x
except that digit x; is received as x;+a with a#0. Then
Y= }2, i, = (} 0 ix,) + ja = ja (mod 11), sincej and a
are non-zero.
(b) Suppose y is the same as x except that digits x, and x, have
been transposed Then
x= =7-6'=7-2=14=3.
Exercises 3
vV,=—a;' Say;
i=1,i4j
and so v, is a linear combination of the other v;. Thus vy; is
redundant as a generator and can be omitted from the set
{V,,V2,...,V,} to leave a smaller generating set of C. In this
way we can omit redundant generators, one at a time, until we
reach a linearly independent generating set. The process must
end since we begin with a finite set.
Since any subspace C of V(n,q) contains a finite generating
set (e.g. C itself), it follows from Theorem 4.2 that every
non-trivial subspace has a basis.
A basis can be thought of as a minimal generating set, one
which does not contain any redundant generators.
Then (a, — b,)v, + (@ — b2)v. +--+ + (a — by)v, =0. But the set
{v,,V>,...,V,} is linearly independent and so a,—b,=0 for
1=1,2,...,k;ie.a,=b,fori=1,2,...,k.
(ii) By (i), the q* vectors U*_, av; (a,;€ GF(q)) are precisely
the distinct vectors of C.
Exercises 4
Notes (i) A q-ary [n,k, d]-code is also a q-ary (n, g*, d)-code
(by Theorem 4.3), but, of course, not every (n, q*, d)-code is an
[n, k, d]-code.
(ii) The all-zero vector 0 automatically belongs to a linear
code.
(iii) Some authors have referred to linear codes as ‘group
codes’.
The weight w(x) of a vector x in V(n, q) is defined to be the
number of non-zero entries of x. One of the most useful
properties of a linear code is that its minimum distance is equal
to the smallest of the weights of the non-zero codewords. To
prove this we need a simple lemma.
Proof The row operations (R1), (R2) and (R3) preserve the
linear independence of the rows of a generator matrix and simply
replace one basis by another of the same code (see Exercise 4.5).
Operations of type (C1) and (C2) convert a generator matrix to
one for an equivalent code.
0 O eee O 8k e 8 Lkn _
Exercises 5
0100111
00101107
0001011
56 A first course in coding theory
A message vector (U,, Up, U3, U4) is encoded as
Fig. 6.2
Noise
Message Y
Message vector Encoder: Codeword C
> _ aa ———enenmeemc hannel
source U=U U5" U, U—>X = uG X=X1°"'Xp
a+z=(b—x)+z=b+(z—-x)eb+C.
Hence a+Ccb+C, andsob+C=aC.
The following theorem is a particular case of Lagrange’s
well-known theorem for subgroups.
G=() 10 i
i.e. C = {0000, 1011, 0101, 1110}.
58 A first course in coding theory
Then the cosets of C are
0000 + C = C itself,
1000 + C = {1000, 0011, 1101, 0110},
0100 + C = {0100, 1111, 0001, 1010},
and 0010 + C = {0010, 1001, 0111, 1100}.
Note that the coset 0001 + C is {0001, 1010, 0100, 1111}, which is
the same as the coset 0100+ C. This could have been predicted
from Lemma 6.3, since 0001 € 0100 + C. Similarly we must have,
for example, 0111+ C =0010+ C.
0 1 1 p
Suppose now that a binary linear code is to be used only for error
detection. The decoder will fail to detect errors which have
occurred if and only if the received vector y is a codeword
different from the codeword x which was sent, 1.e. if and only if
the error vector e = y — x is itself a non-zero codeword (since C is
linear). Thus the probability Pyadetee(C) that an incorrect code-
word will be received is independent of the codeword sent and is
given by the following theorem.
64 A first course in coding theory
Theorem 6.14 Let C be a binary [n, k]-code and let A; denote
the number of codewords of C of weight i. Then, if C is used for
error detection, the probability of an incorrect message being
received undetected is
(Note that, unlike the formula of Theorem 6.7 for P.,,,(C), the
summation here starts at i= 1).
and so only one word in about 10 000 will be accepted with errors
undetected.
Exercises 6
((, + , ~ ai1)p™
66 A first course in coding theory
where @,,, 1s the number of coset leaders of C of weight
t+1.
6.5 Show that if the perfect binary [7, 4]-code is used for error
detection, then if p = 0.01, Pyndetec = 0.00 000 68 and about
7% of words have to be retransmitted.
[Hint: The codewords of such a code are listed in
Example 2.23.]
6.6 We shall see in Chapter 9 that there exists a perfect binary
(23, 12, 7]-code, called the binary Golay code. Show that,
if p=0.01, the word error rate for this code is about
0.000 08.
6.7 If standard array decoding is used for a binary [n, k]-code
and the messages are equally likely, show that P,,,,, does
not depend on which codeword was sent and that
12
Pomp = Em F; iP;
= >) 1,0=0.
i=1
G=
1111
(ii) if
000
110 __ [900
C=) or, > thence’ = ti
101
oo
is both a generator matrix and a parity-check matrix, while in
(ii), [111] is a parity-check matrix.
The rows of a parity check matrix are parity checks on the
codewords; they say that certain linear combinations of the
co-ordinates of every codeword are zero. A code is completely
specified by a parity-check matrix; e.g. if
y= ont f
0011
then C is the code
Proof Suppose
1 0 ayy GQ n—k
G= :
0 1 Ak Qk n—k
Let
—Ay, —Ayy 1 0)
H=
The dual code and syndrome decoding 71
Then H has the size required of a parity-check matrix and its
rows are linearly independent. Hence it is enough to show that
every row of H is orthogonal to every row of G. But the inner
product of the ith row of G with the jth row of H is
O+---+0+(-a;)+0+---+0+4,+0+---+0=0.
1110
H=]|0111|
1101
(Note that the minus signs are unnecessary in the binary case.)
Syndrome decoding
S(y)=yH"
is called the syndrome of y.
72 A first course in coding theory
Notes (i) If the rows of H are h,,hy,...,h,_,, then S(y)=
(y-h,,y-°hy,...,y-h,_,).
Gi) S(y)=OSyeEC.
(iii) Some authors define the syndrome of y to be the column
vector Hy’ (i.e. the transpose of S(y) as defined above).
1011
G= oio1
a= [10]
~ £11014"
The dual code and syndrome decoding 73
Hence the syndromes of the coset leaders (see Example 6.6) are
(0000) = 00
S$(1000) = 11
(0100) = 01
(0010) = 10.
The standard array becomes:
0 0 0000
11 1000
01 0100
1 0 0010
Incomplete decoding
ort
oot
A standard array for C is
coset leaders
The dual code and syndrome decoding 75
If 11110 is received, we decode as 10110, but if 10011 is
received, we seek re-transmission. Note that in this example, if a
received vector y found in the bottom part were ‘corrected’, then
owing to the presence of two vectors of weight 2 in each such
coset, we would have less than an ‘evens’ chance of decoding y to
the codeword sent; e.g. if 10011 is received, then, assuming two
errors, the codeword sent could have been 01011 or 10110.
An incomplete decoding scheme is particularly well-suited to a
code with even minimum distance. For if d(C) = 2t+2, then it
will guarantee to correct up to ¢ errors and simultaneously to
detect any t+ 1 errors.
When we carry out incomplete decoding by means of a
syndrome look-up table, we can dispense with the standard array
not only in the decoding scheme but also in the actual construc-
tion of the table. This is because we know precisely what the
coset leaders are in the top part of the array (namely, all those
vectors of weight <t), while those in the bottom half are not used
in decoding and so need not be found. In other words we just
store the ‘top part’ of a syndrome look-up table as we now
illustrate.
HT = | 11010 }.
01001
Calculating syndromes of coset leaders via S(y) =yH’, we get
(the ‘top part’ of) the syndrome look-up table thus (the second
column was written down first):
000 00000
110 10000
O11 01000
100 00100
010 00010
001 00001
_ 4 ee7eses 2 1 OF
mmr 1324567891001
The dual code and syndrome decoding 77
Using Theorem 7.6,
T 2 87]
3.7
46
G= EF 5 5
6 4
7 3
8 2
= 914
and so C= {(%,%,...,%g, 2X, +3x,+-:++9xg, 8x,
+ 7x, +
-+++x)}, where x,,%),...,Xg run over the values 0,1,2,...,9
and those words are omitted which give the digit ‘10’ in either of
the last two coordinate places.
Then
i=1 i=1
10 10
Exercises 7
1000111
0100110
0010101
000101 1.
b 11 |
2011)
0
0
eel
0
|
1 1---1] 1
S The Hamming codes
0111100
H=|101101 0}.
1101001
1000011
0100101
G=
00101107
0001111
Theorem 8.2 The binary Hamming code Ham (r, 2), for r=2,
that is
h, =h, (mod 2) fors=1,2,...,r.
Hence the ith and jth columns of H are identical, again
contradicting the definition of H.
Thus d(Ham (r, 2))=3. On the other hand, Ham (r, 2) does
contain codewords of weight 3. For example, if the first three
columns of H are
000
000
011
101
then the vector 11100---0 is orthogonal to every row of H and
so belongs to Ham (r, 2).
(iii) To show Ham (r, 2) is perfect, it is enough to show that
equality holds in the sphere-packing bound (2.18). With ¢=1,
n=2'—1 and M=2"~’, the left-hand side of (2.18) becomes
H—>H= H
[11 --- 11
A fundamental theorem
b 11
1012)
So1234s678910
1012345678910)
(iii) A parity-check matrix for Ham (3, 3) is
0000111111111
0111000111222).
1012012012012
88 A first course in coding theory
Theorem 8.6 WHam(r,q) is a perfect single-error-correcting
code.
Shortening a code
Example 8.8 Let us have another look at the [10, 8]-code over
GF (11) considered in Example 7.12. This was defined to have
parity-check matrix
wafer
112345678910
and it now follows instantly from Theorem 8.4 that this code has
minimum distance at least 3, for clearly any two columns of H
are linearly independent. In fact, we see that it is a doubly
shortened Hamming code, for H is obtained from the parity-
check matrix of Ham (2,11), as given in Example 8.5(ii), by
deleting the first two columns. This doubly shortened Hamming
code has two practical advantages over Ham (2, 11); first, it has
an even simpler decoding algorithm, as described in Example
7.12, and, secondly, it not only corrects any single error but also
detects any double error created by the transposition of two
digits. On the other hand, Ham (2, 11) has far more codewords
than its doubly shortened version.
90 A first course in coding theory
The 11-ary [10, 8, 3]-code of Example 8.8 is optimal in that the
number of its codewords is equal to the value of A,,(10, 3) (see
Exercise 7.8), a result which is generalized in Exercise 8.10.
While shortening an optimal code will certainly not in general
produce an optimal code, it is interesting to note a recent result
of Best and Brouwer (1977) that the triply shortened binary
Hamming code is optimal; thus
A,(2’ —s,3)=2%-"-5 for s =1,2,3, 4. (8.9)
For s =1, (8.9) merely states the optimality of Ham (r, 2), of
which we are already aware, while for s =2, 3 and 4, (8.9) tells
us that three successive shortenings of Ham(r,2) are also
optimal. The result was proved by the use of linear program-
ming, a technique which has been used to great effect recently in
obtaining improved upper bounds on A,(n,d) for a number of
cases. For a good introduction to the method, see Chapter 17 of
MacWilliams and Sloane (1977).
Taking r =4 in (8.9) gives the values of A,(14, 3), A,(13, 3)
and A,(12,3) as shown in Table 2.4. However, if Ham (4, 2) is
shortened four times, the resulting (11, 128,3)-code is not
optimal, for we see from Table 2.4 that there exists a binary
(11, 144, 3)-code.
n@=14("\aq-y+('5')q-
fee ed (5 )(4 — 1)
A,(n,d)= q“,
a<a"/(S@-0("7')).
Corollary 8.12 gives a general lower bound on A,(n, d) when q is
a prime-power and is the best available for large n (see, e.g.,
Chapter 17, Theorem 30 of MacWilliams and Sloane 1977).
However, for specific values of g, n and d one can usually do
much better by constructing a good code in some other way. For
example, taking g = 2, n = 13 and d =5, Corollary 8.12 promises
only the existence of a binary (13, M,5)-code with M = 16,
whereas we see from Table 2.4 that the actual value of A,(13, 5)
is 64. We shall construct such an optimal binary (13, 64, 5)-code
in Exercise 9.10.
For a weaker version of the Gilbert-Varshamov bound, but
one which applies for any size g of alphabet, see Exercise 8.12.
The Hamming codes 93
Exercises 8
8.1 Write down a parity-check matrix for the binary [15, 11]-
Hamming code. Explain how the code can be used to
correct any single error in a codeword. What happens if
two or more errors occur in any codeword?
8.2 With the code of Example 8.3, use an incomplete decod-
ing algorithm to decode the following received vectors.
8.3 Show that the code of Examples 2.23, 5.3(ii) and 5.6(ii) is
a Hamming code.
8.4 Suppose C is a binary Hamming code of length n and that
C is its extended code of length n+1. For a binary
symmetric channel with symbol error probability p, find
Pror(C) and Pror(C) in terms of p and n, and show that,
surprisingly, Pro(C) = Pror(C).
8.5 (i) Write down a parity-check matrix for the 7-ary
[8, 6]-Hamming code and use it to decode the re-
ceived vectors 35234106 and 10521360.
(ii) Write down a parity-check matrix for the 5-ary
[31, 28]-Hamming code.
8.6 Use Theorem 8.4 to determine the minimum distance of
the binary code with generator matrix
a 11007
1010
0110
LL 1111
1101
0101
L 1001.
12403
02141}.
20314
94 A first course in coding theory
Let C, be the code over GF(3) generated by
120210
201201).
111212
Find a parity-check matrix for each code and determine
the minimum distance of each code.
8.8 Use Theorem 8.4 to construct a [6, 3, 4|-code over GF(5).
8.9 Let R, denote the rate of the binary Hamming code
Ham (r, 2). Determine lim,_,.. R,.
8.10 Prove that if g is a prime power and if 3Sn <q +1, then
A,(n,3)=q"’.
8.11 (The ‘football pool problem’) Suppose there are ¢ football
matches and that a bet consists of forecasting the outcome,
home win (1), away win (2) or draw (X), of each of the t¢
matches. Thus a bet can be regarded as a ternary f-tuple
over the alphabet {1, 2, X}.
The ‘t-match football pool problem’ is the following.
‘What is the least number f(t) of bets required to
guarantee at least a second prize (i.e. a bet having at most
one incorrect forecast)?’
(a) (i) By using Hamming codes over GF(3), find the
value of f(t) for values of t of the form (3’ — 1)/2
for some integer r=2; 1.e. for t=4, 13, 40,
121,....
(ii) Enter in the coupon below a minimum number
of bets which will guarantee at least 3 correct
forecasts in some bet.
Arsenal Luton
Coventry Ipswich
Liverpool Chelsea
Watford Everton
Theorem 9.2 There does not exist a binary linear [90, 78, 5]-
code.
90
() =2" and so X is precisely the set V(12, 2) of all binary
12-tuples. Hence the number of vectors of odd weight in X is 2’
(see e.g. Exercise 2.4 or Exercise 5.5). We now calculate this
number in a different way. Suppose m of the columns of H have
odd weight, so that 90—m of them have even weight. As in
Lemma 2.6, w(H; + H,) = w(H,) + w(H,) — 2w(H; 1 H,), and so
w(H, + H,) is odd if and only if exactly one of w(H;) and w(H,)
is odd. Thus another expression for the number of vectors of odd
weight in X is m + m(90 —m). Hence
m(91 —m)=2"!
Perfect codes 99
and so both m and 91—™m are powers of 2. This is clearly
impossible for any integer m and so the desired linear code
cannot exist.
Remark The non-existence of a non-linear (90, 2’8, 5)-code will
be demonstrated in Theorem 9.7.
So G3 1s a perfect code.
With just a little trial and error it is not difficult to make use of
Theorem 8.4 and to construct the parity-check matrix of an
[11, 6, 5]-code over GF(3) (see Exercise 9.3).
102 A first course in coding theory
However, to bring out the similarities of the binary and ternary
Golay codes, we exhibit a generator matrix for a ternary
[12, 6, 6]-code G,., which may be punctured to get the perfect
ternary Golay code G,, with parameters [11, 6, 5].
1 0111111]
1 0 101221
1 110122
G=[I,| A]=
1 121012
0 1 122101
Lo 17112210
is a [12, 6, 6|-code.
pth Ue eane’
if m is a positive integer
m!
=] if m = 0.
L¢> s
(ry
g= x-1
("7 *)("—*)
has ¢ distinct integer roots in the interval 1=x <n.
Using Lloyd’s theorem, it was shown that an unknown perfect
code over GF(q) must have t=11, gq <8 and n < 485. However,
by the computer search mentioned earlier, the only parameters
in this range satisfying the sphere-packing condition are those of
trivial, Hamming or Golay codes and also the parameters
(n, M, d) = (90, 2”, 5) with gq =2. [Remark: It has been shown
by H. W. Lenstra and A. M. Odlyzko (unpublished) that the
computer search can be avoided by tightening the inequalities.|
We have already established the non-existence of a linear
(90, 2’8, 5)-code. The non-existence of a non-linear code with
these parameters follows from Lloyd’s theorem, for with t=2
and n = 90,
Theorem 9.7 There does not exist a binary (90, 278, 5)-code.
ID| =3|X1.
Hence 3 |X|=88, giving |X| =88/3, which is a contradiction,
since |X| must be an integer. Thus a (90, 278, 5)-code cannot
exist.
t-designs
Problem 9.9 Find all perfect codes having the parameters of the
Hamming and Golay codes.
Theorem 9.12 There does not exist a 6-ary (7, 6°, 3)-code.
Concluding remarks
Exercises 9
111107
pe
x * * GC *
i
* Oo * *
x
pe
b>
lI
* oO * * *
Se
QO * * * *
=
and the asterisks represent non-zero entries.]
9.4 (a) Show that if y is a vector in V(23,2) of weight 4,
then there exists a unique codeword x of weight 7 in
G,3 which covers y. Deduce that the number of
codewords of weight 7 in G,; is 253.
(b) Let M be a matrix whose columns are the codewords
of weight 7 in G53. Show that M is the incidence
matrix of a design which has 23 points, 253 blocks, 7
points in each block, and such that any 4 points lie
together in exactly one block; thus we have con-
structed a Steiner system S(4, 7, 23).
9.5 Show that if there exists a perfect binary ¢t-error-correcting
code of length n, then
(a) there exists a Steiner system S(¢ +1, 2t+ 1,7);
n-l ei
(b) ("Gar is an integer fori=0,1,...,¢.
[Remark: Putting n = 90, t=2 and i =2 in part (b) is
the case considered in proving Theorem 9.7.]
9.6 Construct a Steiner system S(5, 8,24) from the extended
binary Golay code G»,.
9.7 Show that the number of codewords of weight 3 in the
Hamming code Ham (r, 2) is (2” — 1)(2”~' — 1)/3.
9.8 Show that the number of vectors of weight 5 in the ternary
Golay code is 132.
9.9 We shall construct the Nordstrom—Robinson (15, 256, 5)-
code N,, in the following steps.
(i) Show that if the order of the coordinates of the
binary Golay code G,, is changed so that one of the
weight 8 codewords is 1111111100---0, then G,,
has a generator matrix having its first 8 columns as
110 A first course in coding theory
shown below.
‘ 1 7]
1 0 1
1 1
1 1
1 1
G- 0 1 1
11
0
0
0 0
0
L 0 |
[Hint: Since G,, is self-dual, (a) the first seven
columns of G must be linearly independent and (b)
the codeword 1111111100---0 is orthogonal to
every codeword.|
(ii) Show that the total number of codewords of Gy,
whose first eight coordinates are one of 00000000,
10000001, 01000001, 00100001, 00010001, 00001001,
00000101 or 00000011 is 256.
(iii) Take these 256 codewords and delete the first 8
coordinates of each of them. Show that the resulting
code is a (16, 256, 6)-code. This is the extended
Nordstrom—Robinson code Ng.
(iv) Puncture N,, (e.g. delete the last coordinate) to get
the (15, 256, 5)-code Ns.
[Remark: N,, and N,; are non-linear codes. They are
both optimal, cf. Table 2.4.]
9.10 Construct from N,;5 a (12, 32, 5)-code. [This code is called
the Nadler code, having originally been constructed in
another way by Nadler (1962). The Nadler code is both
optimal (see Chapter 17, §4 of MacWilliams and Sloane
1977) and unique (Goethals 1977).|
9.11 (i) Show that there does not exist a binary linear
Perfect codes 111
(13, 64,5)-code. [Hint: Suppose C is a_ binary
[13, 6, 5]-code with generator matrix
it 1100000000
G, G, }
Show that G, generates an [8,5,3]-code, whose
parameters violate the sphere-packing condition.|
(ii) Deduce that there is no linear code with the
parameters of the Nordstrom—Robinson code.
(iii) Can the non-existence of a [12,5,5]-code (i.e. a
linear code with the parameters of the Nadler code)
be proved by the method of (i)?
10 Codes and Latin squares
Latin squares
Definition A Latin square of order q is a q Xq array whose
entries are from a set F, of q distinct symbols such that each row
and each column of the array contains each symbol exactly once.
A 1 3
NN
B 1 3
C 1 2. 3.z
But in addition to testing the effect of different drugs on the same
subject, we also want to have some measurement of the effects of
the drugs when taken on different days of the three-day period.
So we would like each drug to be used exactly once each day, i.e.
114 A first course in coding theory
we require a Latin square for the schedule, e.g.
M T W
A 1 2 3
B 2 3 #1
C 3 1 2.
Proof We-can take 12--:q as the first row and cycle this round
once for each subsequent row to get
123--: q
234-:. ql
345---q12
qi2-:-- q-tl.
Alternatively, the addition table of Z, is a Latin square of order
q.
Theorem 10.7 There exists a q-ary (4, g*, 3)-code if and only if
there exists a pair of MOLS of order q.
012 021
A=12 0 and B=102
201 21 0.
Example 10.11
012 012 . of
_ _ is a pairo
A;=120 and A,=201 MOLS of order 3.
201 120
0123 0123
1032 _ 2301 = isa pair of
B=, 301 and B= 3210 MOLS of order 4.
3210 1032
20 ‘00 ' 10
Q= ! !
10 20 ‘ 00
for some (ig, jo). After a little thought, the reader should be able
to show that the partial 6 x 6 arrays A =[a,;] and B =[b,], each
having the (i, jo)th entry missing, can be completed to Latin
squares which must be mutually orthogonal. This contradicts
Tarry’s non-existence result.
Summarizing our results concerning A,(4, 3), we have
Exercises 10
A=] at az-::.@
(a, —a,4)X1
= I] (a; — a;).
i>j
iF]
i=]
L1a.--- 1
12 3--- 10
™=1 4 2232... 10 |
1 23 33 ---
10°
As usual, if we desire a decimal code rather than one over
GF(11), we simply omit those codewords containing the symbol
10 so that our decimal code is
10
i=1 i=]
i= p=]
i=
Notes (1) It does not matter which way round we take i and j
in (9); we need not insist, for example, that i<j.
(2) As usual, all arithmetic is carried out modulo 11, division
being carried out with the aid of the table of inverses as in
Example 7.12. We need further here a table of square roots
modulo 11. By first calculating the squares of the scalars as
shown below
x | 12345678910
wel] 149533594 1
we may take the table of square roots to be
x | 1 3459
Vx | 15243
We could equally well use the negative of any of these square
roots; the presence of the ‘+’ in (9) shows that it does not matter
which of the two roots is taken. Note that if, in (9), QO? — 4PR is
not a square (i.e. it is one of 2, 6, 7, 8, 10), then at least three
errors must have occurred.
0) = + freed
1— X,6 . )1
my, Mp» m,
0) = Pi
+ P2
+++ + Pi
.
9(9) 1-—q,0 1-4q,0 1—q,0
Mm, = Pr X,= 4:
and the system (11.5) is solved.
m, m, m, _— A,+A,0+A;6?
p(8) = 1-—X,0 1-— X,0 1— X30 1+ B,0 + B,6? + B03’
2+76+967
p(9) = 1+560+ 1007 + 863°
It will not be obvious from the received vector, nor from the
syndrome, what the number e of errors is, but if e<t, then only
the first e equations of (11.7) will be linearly independent, the
remaining t—e equations being dependent on these. So when
solving the system (11.7) we must find the maximum number e of
136 A first course in coding theory
linearly independent equations and put B,,,= B.4.=-:-=B,=
0.
For example, suppose in Example 11.9 that the syndrome has
been found to be (5, 6, 0,3, 7,5). Then equations (11.7) become
6B, + 5B3,=8
3B, + 6B3= 4
7B, + 3B, = 6.
Eliminating B, from the last two equations gives
3B, +8B;,=4
which is just a scalar multiple of the first. So we put B,=0 and
solve the first two equations for B, and B, to get B,=5 and
B,=5. We then have A, =5 and A, =9. So
5 +96
(9) = 7564562”
which gives, on splitting into partial fractions,
2 1 3
1-@ 1-50
Thus we assume that there are just two errors, in position 1 of
magnitude 2, and in position 5 of magnitude 3.
(2) When the error-locator and error-evaluator polynomials
o(@) and w(@) (defined in Remark 11.8) have been found, and
the error locations X,, X,,...,X, determined, then, as we saw in
Example 11.9, the error magnitudes are given by
yeJ
w(x;XE)
[| GQ - x77) forj=1,2,...,e. (11.10)
‘Fi
This is why w(@) is called the error-evaluator polynomial.
We now summarize the general algorithm.
Concluding remarks
(1) Apart from the ISBN code, modulus 11 decimal codes are
now widely used, mainly for error detection rather than correc-
tion. One of the earliest uses was in the allocation of registration
numbers to the entire population of Norway in a scheme devised
by Selmer (cf. 1967). Selmer’s code, defined in Exercise 11.6,
satisfies two parity-check equations and is designed to detect all
single errors and various types of commonly occurring multiple
errors. Before devising his code, in order to ascertain which
psychological errors occurred most frequently, Selmer analysed
the census returns of 1960 for the population of Oslo. In this
census, the public had filled in the date of birth themselves, and
comparison of these entries with those in the public register had
revealed about 8000 inconsistencies, which were on record in
Oslo. Selmer actually received only 7000 of these; the remaining
A double-error-correcting decimal code 139
thousand were people who had also written their name incor-
rectly and so belonged to another file!
(2) For a survey of various types of error-detecting decimal
codes, see Verhoeff (1969). This includes, in Chapter 5, the first
example of a pure decimal code which detects all single errors
and all transpositions.
(3) In 1970, Goppa discovered codes which are an important
generalization of BCH codes, and whose decoding can be carried
out in essentially the same way. McEliece (1977) asserts that ‘it is
fairly clear that the deepest and most impressive result in coding
theory is the algebraic decoding of BCH-—Goppa codes’. It has
been the aim of this chapter to give the essential flavour of this
result assuming nothing more than standard results from first-
year undergraduate mathematics.
Exercises 11
11.1 Using the code of Example 11.3, decode the received
vector 1204000910.
11.2 Find a generator matrix for the [10, 6]-code of Example
11.3.
11.3. For the code of Example 11.9, find the error vectors
corresponding to the syndromes
(1,7,5,2,3,10) and (9,7,7, 10,8, 3).
11.4 Suppose we wished to give each person in a population of
some 200 000 a personal identity codeword composed of
letters of the English alphabet. Devise a suitable code of
reasonably short length which is double-error-correcting.
11.5 When decoding a BCH code of minimum distance 2¢ + 1,
suppose the error locations are found to be
X,,X,...,X,. Show that the error magnitude m, in
position X; is given by
m, = —X,w(X;"")/0'(X;"),
where w(@) is the error-evaluator polynomial and o'(@)
denotes the derivative of the error-locator polynomial
o(@).
11.6 Every person in Norway has an 11-digit decimal registra-
tion number x,x,--:x,,;, where x,x,---Xx, is the date of
140 A first course in coding theory
birth, x7XgX¥9 iS a personal number and xX,9 and x,, are
check digits defined by
X10 = —(2Xo + 5X8 + 4x, + 9x6 + 8X5 + X4 + 6x3 +7X> + 3x4)
(mod 11)
and
x?7+x4+1 x3 +x +1
xet+x74+x
x? +]
x7+x+ 1
Xx
Cyclic codes 143
Hence x7+x+1=(x+1)(x?+x+1)+x is the desired expres-
sion of x7 +x+1 as g(x)(x*+x4+1)+7r(x).
+ 0 1 x 1+x 0 1 x 1+x
0 0 1 x i1+x 0 |0 O 0 0
1 1 Q iI+x x 1 j0 1 x 1+x
x x 1+x O 1 x 10 x 14+x 1
lT+x!i1l+x x ] 0 1+xl0 1+x 1 x
We see that this is more than just a ring. Every non-zero element
has a multiplicative inverse and so F[x]/(x* +x +1) is actually a
field. In fact, we have precisely the field of order 4 given in
Example 3.6(3), with x and 1+.x corresponding to a and b
respectively.
It is certainly not the case that F[x]/f(x) is a field for any
choice of f(x); consider, for example, the multiplication table of
F[x]/(x?2 +1) (see Exercise 12.2). The special property of f(x)
which makes F[x]/f(x) a field is that of being ‘irreducible’, which
we now define.
Lemma 12.3
(i) A polynomial f(x) has a linear factor x —a if and only if
f(a) =0.
(ii) A polynomial f(x) in F[x] of degree 2 or 3 is irreducible if
and only if f(a) ¥0 for all a in F.
(iii) Over any field, x” —1=(« —1)(x""14+x"-74---+x41)
(the second factor may well be further reducible).
Proof (i) If f(x) =(x —a)g(x), then certainly f(a) =0. On the
other hand, suppose f(a) =0. By the division algorithm, f(x) =
Cyclic codes 145
q(x)(x —a)+r(x), where degr(x)<1. So r(x) is a constant,
which must be zero since 0 = f(a) = r(a).
(ii) A polynomial of degree 2 or 3 is reducible if and only if it
has at least one linear factor. The result is now immediate from
(i).
(iii) By (i), x —1 is a factor of x” —1 and long division of
x” —1 by x —1 gives the other factor.
Example 12.10 We will find all the binary cyclic codes of length
3. By Example 12.4(i), x7 -1=(x« + 1)(x?+x+1), where x +1
and x? +x +1 are irreducible over GF(2). So, by Theorem 12.9,
the following is a complete list of binary cyclic codes of length 3.
Generator Corresponding
polynomial Code in R3 Code in V(3, 2)
go 81 82 °°° g, 0 0---0 1]
O 8o 8:1 82 °°" Sr O--- 0
G=| 0 0 8 §1 §2 °°" Sr
| 0
Bo O--: 0 go g Bocce
0gy |
iB _
-1 1 0 O
x-1 O-1 1 O
| 0 O-1 JL
(1 10 0
x+1 0 1 1 0
| O 0 1 1
4 (1 01 0
L909 10 1
Then
(i) a parity-check matrix for C is
mh, hy» *** My 0 0--- 07
O hy My-1-++ho O--- 0
H= Lo ,
Lo . O
LO--- Oh, hye: ho
We now show that the ternary Golay code G,;, may also be
constructed as a cyclic code. Our starting point is the factoriza-
tion of x!'— 1 over GF(3):
xP =a 1? 42x47 - 0 4x? -DO-— xP +x? -x- 1)
= (x — 1)g,(*)g2(x), say.
Note that g(x) = —x°g,(x~') and so (g,(x)) and (g,(x)) are
equivalent [11, 6]-codes. We shall show that the code (g;(x)) has
minimum distance 5.
a,
and consider the binary r X (2’ — 1) matrix
H=[1 a@ a?--- a? 77].
Let C be the binary linear code having H as parity-check matrix
160 A first course in coding theory
Since the columns of H are precisely the distinct non-zero vectors
of V(r,2), C is a Hamming code Ham(r, 2). Putting n =2’—1
we have
C= {fifi + fr-1€ Vn, 2) | fot fiat: ++ +f"? = 0}
= {f(x) eR, |f(@) = 0 in F[x]/p(x)}. (12.23)
If f(x) eC and r(x) eR,, then r(x)f(x) € C because r(a) f(a) =
r(~)-0=0. So, by Theorem 12.6, this version of Ham (7, 2) is
cyclic.
1101000
0110100
0011010)
0001101
Exercises 12
=Apjp tA ,zZ+-°:+A,z",
where A, denotes the number of codewords in C of weight i.
Another way of writing W-(z) is
Welz) = Dd 2”™.
xEC
—7}\xy —
(" ifye C+
&
xEC (-1) 0 ifyé Ct
> (-)*¥=|C|-1=2*.
xeEC
d (-1""=0.
xeC
Weight enumerators 167
Lemma 13.4 Let x be a fixed vector in V(n, 2) and let z be an
indeterminate. Then the following polynomial identity holds:
Proof
1 1
Sy z”0)(-1)*¥ = 2 SS: . ZU tA HIN — EDI Hn
ye V(n,2) =0 y2=0 yn=0
y,=90 n=0
“(2 0)
=(1-—z)"(1 +z)",
1 . . 1 +Z if Xx; = 0
since
;
2 2 J(—1Wx
1) =
{ 2. ifx,=1 .
f= xeC
(Sayre)
\yeV(7,2)
in two ways.
On the one hand, using Lemma 13.4,
=(1+z)" > (- ~ zy
xeC 1+2z
~assrw(ts3}
168 A first course in coding theory
On the other hand, reversing the order of summation, we have
fz)= »
yeV(n,2)
2¥0(SxEC
(-1)*)
= >) z”2* (by Lemma 13.3)
yeC"
= 2*W ¢.(2).
For the very small codes just considered, the use of the
MacWilliams identity is an inefficient way of calculating their
weight enumerators, which can be written down directly from the
lists of codewords. But suppose we are required to calculate the
weight enumerator of an [n, k]-code C over GF(q) where k is
large. To enumerate all g* codewords by weight may be a
formidable task. However, if k is so large that n —k is small,
then the dual code C~ may be small enough to find its weight
enumerator, and then the MacWilliams identity can be used to
find the weight enumerator of C.
For example, the binary Hamming code Ham (r, 2) has dimen-
sion 2’ —1—r, and so the number of codewords in Ham (r, 2) is
271". a large number even for moderately small values of r.
But the dual code has only 2’ codewords and, as we shall soon
see, it has a particularly simple weight enumerator. From this,
the weight enumerator of Ham (r, 2) itself is easily determined.
First we look at a particular case.
Theorem 13.10 Let C be the binary Hamming code Ham (r, 2).
Then every non-zero codeword of C+ has weight 2’~*.
Proof Let
h, hy hy. es Ain
h, hy hy se hyn
Since
A; =A, -i,
fori=O0,1,...,n.
13.2 Find the weight enumerator of the code whose generator
matrix is
10011
01001
00101
(a) directly,
(b) by using the MacWilliams identity.
13.3 Let C be the binary [9,7]-code having the generator
matrix _ O17
01
10
L 10
11
11
- 11.
Let )}?_) A,z' denote the weight enumerator of C. Use the
MacWilliams identity to find the values of Ag, A,, A, and
A3. Show that C contains the vector consisting of all 1s
and hence, or otherwise, determine the full weight
enumerator of C.
13.4 Using the result of Example 13.9, write down the weight
enumerator of the extended binary Hamming code of
length 8.
13.5 Prove Corollary 13.11.
13.6 Find the number of codewords of each of the weights 0,
1, 2, 3 and 4 in the binary Hamming code of length 15.
13.7 Let C be a binary linear code and let Cy denote the
subcode of C consisting of all codewords of C of even
weight. Show that
Corollary 14.2. For given values of qg, d and r, the largest value
of n for which there exists an [n,n —r,d]-code over GF(q) is
max,_; (7, q).
001
010 100
H=| 012124
302211
|.
The MLCT problem for d=4
maxs
4,q)=|
(4, 4)
q*>+1,
q*+1,
qodd_
qeven
:
(Bose 1947)
(Qvist 1952)
max; (5, 3) = 20 (Pellegrino 1970)
max; (6, 3) = 56 (Hill 1973)
Fig. 14.9. The known values of max; (r, q).
Proof
(i) is immediate from Theorem 14.10.
(ii) m<max,y_,(r,2)@there exists a binary
[n,n —r, d]-code
<> there exists a binary
(7 —-1,n —r,d— 1]-code
$n —-1smax,_>(r— 1, 2)
©n<max,_>(r—1,2)+1.
0
_ H :
H= oP
g +1, if g is odd
Corollary 14 14
max; (3, 7)’ = | gq +2, if1 g is} even.
Theorem 14.15
(i) For any prime power q, max; (3,q)<q +2.
(ii) If g is odd, then max; (3,q)<q +1.
H= b, b, 7. b,,-3 0 1 0) .
Ci Co oe Cn-3 0) 0) 1
where the b,s and c;s are non-zero. As the determinant formed
by the last column and two of the first n — 3 columns is non-zero,
the 5;s must be distinct non-zero elements of GF(q). Hence
n—-3<q-—1landsonsq+2.
The main linear coding theory problem 185
(ii) (Adapted from Fenton and Vamos, 1982). Now suppose
q is odd. Suppose, for a contradiction, that a [¢ +2, q—1,4]-
code C exists. Then, as in (i), we may assume that C has a
parity-check matrix
11-:.; 1 100
H= |b, b2--:+ b,-,01 0
Cy C2 *** Cg-y 001
an.4)
a(n, 4)
=| nS
q
gq’*
for 4<n<qg+1
= forg+2<n<q’* +1.
The main linear coding theory problem 189
If g is even, then
q’> = for 45n<q+2
B,(n,4)=
q’* = forg+3<n<q*
+1.
Exercises 14
Note that the conjecture has already been proved for r=2
(Theorem 14.4) and for r=3 (Theorem 14.16). Before consider-
ing the conjecture further let us dispose of the rather uninterest-
ing cases outside the range to which it applies. For redundancies
0 and 1, MDS codes exist of any length n over any field GF(q)
(for r=0, V(n, q) is an [n, n, 1]-code, while for r = 1, the matrix
1
[h-1 :
Theorem 15.3 If r=q, then max, (r,qg) =r+1. Any MDS code
of redundancy r =q is equivalent to a repetition code of length
r+.
G=| 1011-:::1
O1a,a,°-::a,
|
In order that any linear combination of the rows of G has weight
at least r+1, the as must be distinct non-zero elements of
GF(q). This implies that r <q — 1, contrary to hypothesis.
Ay, Az, 0 O
6 ee eee e@
5 eeeeee
4 eeeeee
3 ee.8e8 ee @
2 eeeee @
1 eee ee e@ © 0 © 0 fe -o-—e--~
Exercises 15
16251
A=/]143
3 6
15515
over GF(7). Check that every square submatrix of A is
non-singular. Hence write down generator matrices for
[8, 3] and [8, 5] MDS codes over GF(7).
15.2 Show that if max, (7, q)=q+1, then max,,._,(q¢+2-
r,qv=qrtil.
15.3 Suppose g =2",h>1. Assuming known results about
max, (7, q) for r <4, show that max,-;(¢—1, q)=q +2.
15.4 Given that GF(8)= {0, a,=1, a5, a@3,...,4@,}, write
down a parity-check matrix for an [n, n — 7, 8]-code over
GF(8) with n = max, (7, 8).
15.5 Prove that max,,, (r+ 1, q) S max, (7, g) +1.
15.6 Use Theorem 13.6 to find (a) the weight enumerator of
an [8, 3, 6]-code over GF(7) and (b) the weight enumera-
tor of an [8,5, 4]-code over GF(7). Check your answers
by using the formulae (15.13).
15.7 For each integer k =2, specify an [n, k,n —k + 1]-code
over GF(11) having n as large as possible.
Concluding remarks, related topics,
1 6 and further reading
The main aims of this final chapter are to review the progress
made in the earlier chapters and to mention some related topics,
with suggestions for further reading.
The treatment presented in the book has been motivated
mainly by two recurring themes:
(1) the problem of finding codes which are optimal in some
sense;
(2) the problem of decoding such codes efficiently.
This has led to a rich interplay with several well-established
branches of mathematics, notably algebra, combinatorics, and
geometry.
With regard to optimal codes, the main emphasis has been on
finding values of A,(n,d), the largest size M of an (n, M, d)-
code over an alphabet of gq letters. jn the case of binary codes,
we gave in Table 2.4 the state of knowledge regarding values of
A,(n,d) for small n and d. We now consider this table again
(Table 16.1), for d<5, in order to indicate those places in the
text where results have been proved.
Remarks 16.2 (1) All of the bounds in Table 16.1 have been
proved in the text or exercises with the exceptions of (i) the
upper bounds obtained by linear programming methods and (ii)
the lower bounds for d=3 and n=9, 10, and 11. A rather
complicated construction of an (11, 144,3)-code was given by
Golay (1954). Successive shortenings of this code give codes with
parameters (10, 72, 3), (9, 38, 3) and (8, 20, 3). For a long time it
was believed that the (9,38, 3)-code was optimal, but recently
Best (1980) found a (9, 40, 3)-code (despite a publication of 1959
which claimed that 39 was an upper bound on A,(9, 3)!).
(2) It is conjectured that the Plotkin bound is always attained
in the range dSn=<2d+1. Indeed it has been shown by
Levenshtein (1964) that there exist codes which meet the Plotkin
202 A first course in coding theory
Table 16.1
Values of A,(n, d)
n d=3 d=5
3 R 2 P —
4 R* 2 P —
5 SH 4 P R 2 P
6 SH 8 P R* 2 P
7 H 16 S R** 2 P
8 G 20 L, E, 4 P
9 B 40 EB; SD 6 P
10 G 72-79 L SD 12 P
11 G 144-158 E, D 24 P
12 SH 256 L, SNR 32 L,
13 SH 512 E, SNR 64 E,
14 SH 1024 EB, SNR 128 E,
15 H 2048 S NR 256 EB,
16 Ey 2560-3276 L, NR* 256-340 L,
Upper Bounds
P: Plotkin bound (Exercise 2.22).
Related topics and further reading 203
Key to Table 16.1 (Contd.)
S: | sphere-packing bound (Theorem 2.16).
L: linear programming bound (L,: see Best et al. (1978) or
MacWilliams and Sloane (1977); L,: see Best (1980)).
E,: A,(n,d)<2A,(n — 1, d) (Exercise 2.2).
Convolutional codes
Cryptographic codes
MORSE CODE
HUFFMAN CODES
Exercises 16
ay 0.5 0 00 0 0
a, 0.25 1 01 10 01
a, 0.125 00 10 110 011
a, 0.125 11 11 111 0111
Chapter 1
1.1
O
Ce et
ia ee OM
| @ @ @
Cee
PPS a em
ite eee ee
(x MO
Chapter 2
2.1 (i) {000000, 111111}. (ii) (4%). (iii) Add overall parity-
check to (F)°. (iv) Not possible. Suppose C were a
(5,3, 4)-code. There is no loss in assuming 00000 is a
codeword. But then the other two codewords each have at
least four 1s, which implies that they differ in at most 2
places. (v) Not possible. A binary (8, M, 3)-code satisfies
the sphere-packing bound, M(1+8)<2°, which implies
that M <= 28.
2.2 Suppose C is a binary (n, M,d)-code. Partition the code-
words of C into two disjoint sets, those ending with a 0
and those ending with a 1. One or other of these sets
contains at least M/2 of the codewords. Take this set and
delete the last coordinate to get an (n — 1, =M/2, d)-code
Solutions to exercises 213
(3)/('5) >”
50 10 5
2.5
2.6 Let C be a binary (n, M, d)-code with d even. Delete a
suitable coordinate from all codewords to get an (n —
1, M,d —1)-code and then add an overall parity check (cf.
proof of Theorem 2.7).
2.7 Any such code is equivalent to {00---0,11---100-- - 0},
where the number of 1s in the second word is one of
1,2,...,n.
2.8 Suppose C is a binary (8, M,5)-code, with M = 4. We may
assume O00000000eEC. At most one codeword has
weight = 6, for two words of weight = 6 could differ in at
most four places. So C has at least two codewords of
weight 5. Up to equivalence, we may assume these are
11111000 and 11000111. It is now easy to show that the
only further codeword possible is 00111111.
2.9 Let C be an (n, g, n)-code over F, = {1,2,...,q} and let
A be a matrix whose rows are the codewords of C. Since
d(C)=n, the g elements of any column of A must be
distinct and so must be precisely the symbols 1,2,...,q
in some order. For each column of A a suitable permuta-
tion of the symbols may be performed to give
2...
A=** :
q 4 ce G.
2.18 Let C, be the (8, 128, 2)-code E, (see Exercise 2.4) and let
C, be the (8, 20, 3)-code of Exercise 2.16. Apply Exercise
2.17 to get a (16, 2560, 3)-code.
2.19 C, = (4, 8, 2)-code, C, = (4, 2, 4)-code >
C; = (8, 16, 4)-code.
C, = (8, 16, 4)-code, C, = (8, 2, 8)-code >
C; = (16, 32, 8)-code.
C, = (16, 32, 8)-code, C, = (16, 2, 16)-code >
C; = (32, 64, 16)-code.
2.20 Since w(x; + x;) = d(x;, x;) 2d, we have
Chapter 4
4.1 Show that this single condition holds if and only if both
conditions (1) and (2) of Theorem 4.1 hold.
4.2 Suppose x,yéF,, so that w(x) and w(y) are even
numbers. By Lemma 2.6, w(x+y)=w(x)+w/(y)-
2w(x My) = an even number. So x+ ye E, and hence E,, is
a subspace. By Exercise 2.4, |E,,| =2"~' and so dim (E,,) =
n—1.
The rows of
100-:-:--01
010---01
00:---011
form a basis (other answers are possible).
218 A first course in coding theory
4.3 (1, 2,0, 1) =2(0,1,2,1)+(,0,2,2). So {(0,1,2,1),
(1,0, 2, 2)} is a basis and dim (C) =2.
4.4 Show that {u, v} is linearly dependent if and only if either
u Or Vv is zero or V is a Scalar multiple of u.
4.5 In each case show that the new set is still both a spanning
set and a linearly independent set.
4.6 In F, let n denote the element 1+1+---+1(n1s). Then
the subset {0,1,...,p-—1} of F may be regarded as the
field GF(p), since addition and multiplication are carried
out modulo p. It follows at once that F is a vector space
over GF(p), all the axioms following immediately from
the field properties of F and GF(p). If the vector space F
over GF(p) has dimension h, then it follows, as in the
proof of Theorem 4.3, that |F| =p”.
4.7 We omit the proof of the general result here, as it will be
given in Chapter 14. The points of P, are {000, 100},
{000, 010}, {000, 001}, {000, 110}, {000, 101}, {000, 011},
and {000,111}. The lines are {000, 100, 010, 110},
{000, 100, 001, 101}, etc. That this 7-point plane is the
same as that of Example 2.19 may be seen from Fig. 14.8,
wherein a vector x stands for the point {0, x}.
Chapter 5
l
5.3 We use Theorem 4.1.
x,yeCS>(x+y)H’
=xH' +yH’ =0+0=0
>xtyec.
=(x+y)e€.
So C is linear.
Adding an overall parity check to the code of Example
5.6(ii) gives an [8, 4, 4]-code with generator matrix
10001011
01001110
00101101
0001011 Iu.
5.5 Let Ev and Od denote the subsets of C consisting of words
of even and odd weights respectively. Suppose Ev #C.
Then there exists a codeword, y say, of odd weight. Now
the set Eu + y = {x+y|xe Ev} is contained in C (since C
is linear). But all words in Ev + y are odd (via w(x + y) =
w(x) + w(y) — 2w(xN y), cf. Lemma 2.6), and so we have
Eu +ycOQOd. Hence |Ev|=|Eu +y|<|Od|. Also Od+
yc Ev and so |Od| <|Ev|. Hence |Ev| = |Od| = 3 |CI.
5.6 00000 d(C,)
= minimum non-
11110 zero weight
‘00111 =3
11001
0000000
1001101=x,
0101011=x,
001011 1=x;
= 110011 0=x,+% d(Cy) = 4.
101101 0=x,+x;
011110 0=x,+x;
111000 1=x,+x,+x;
220 A first course in coding theory
5.7 0000 d(C) = minimum non-zero
1011=x, weight= 3.
Since 9[1 + 2 - 4] = 3*, the sphere-
O112=x, packing bound is attained and so C
202 2=2x, is perfect.
022 1=2x,
112 0=x,+x,
221 0=2x,
+ 2x,
120 2=x,+2x,
2101=2x,+x,
Chapter 6
p‘*?
(, . , 7 a1 |p — p)"~*~* + terms involving
n
P... = (, 1 y — O41 fo for small p.
P corr
= (1— p)?°(1540p? + 210p? + 20p
+ 1) ~ 0.99992
if p = 0.01.
So P,,,= 0.00008 [Remark: A fair approximation is ob-
. . . 23\ 0 2
tained by using Exercise 6.4; namely ( 4 )10 ,
6.7 Suppose x = x,x.-:+ +X, 1S sent and that the received vector
is decoded as x’ = x;x5---x,. Then
Pomp =
eeV(n,2)
pa
k i=
<7k dix EP SDi=2 P,
and hence the result.
Solutions to exercises 223
Chapter 7
7.1
n n
=A> uw,t+
pu >, uw, =Au-wt uvew.
i=1 i=1
000 0000000
111 1000000
110 0100000
101 0010000
011 0001000
100 0000100
010 0000010
001 0000001
224 A first course in coding theory
S$ (0000011) = 011; decode as
0000011 — 0001000 = 0001011.
The other three vectors are decoded as 1111111, 0100110,
0010101.
1022 1110
7.6
(a) lonat. >) Lot:
(c) A listing of the codewords reveals that d(C) =3. So
the 9 vectors of weight = 1 are all coset leaders. Since
the total number of coset leaders = 3*/37=9, the
vectors of weight =1 are precisely the coset leaders
(in fact the code is perfect). The look-up table is now
easily constructed, and the given vectors decoded as
0121, 1201, 2220.
7.7 0612960587.
7.8 Let C be a q-ary (10, M, 3)-code. Consider the M vectors
of length 8 obtained by deleting the last two coordinates.
These vectors must be distinct (or the corresponding
vectors of C would be distance <2 apart). So M <q? (this
is a particular case of the Singleton bound, Theorem
10.17). In particular, A,.(10,3)<10°, A,,(10,3)<11%.
[Remark: The sphere-packing bound is not as good in
these cases.] We have A,,(10, 3) = 11° because the linear
[10, 8]-code over GF(11) having
n=[t |
~ £123--- 10
is an 11-ary (10, 11%, 3)-code.
7.9 For example, 0 and 0505000000 are codewords only
distance 2 apart.
7.10 Let e, =0---01---1 (Gls). We require a code such that
@o,€;,..-,@7 are all in different cosets (we could then
decode via syndrome decoding with the es as coset
leaders). This requires that 27/2* = 8, i.e. k <4, and so the
rate cannot be greater than 4. To achieve rate 4+ we would
need a 3 X7 parity-check matrix H such that eH’ #e,H7
if iA~j, i.e. such that (e, —e;)H’ 40 for all i4j. Note that
each e;
— e; is a vector of the form 0---Q01---10---0.A
Solutions to exercises 225
suitable H is
0001000
0100010 |
1010101
If e; — e; is orthogonal to the first row of H, then all its 1s
are to the left or to the right of centre. If also e; —e; is
orthogonal to the second row of H, then there can only be
one 1, in one of the Ist, 3rd, 5th or 7th positions. But then
e; —e; is not orthogonal to the third row of H. (Note: a
similar code of maximum possible rate may be constructed
of any given length.)
7.11 If C is an [n, k]-code, then C is an [n + 1, k]-code and so a
parity-check matrix of C is an (n + 1—k) X (n +1) matrix
whose rows form a linearly independent set of codewords
in C“. It is easily seen that H is such a matrix.
Chapter 8
000000011111111
000111100001111
8.1 H=
011001100110011 |
101010101010101
When y is received, calculate yH’; this gives the binary
representation of the assumed error position. If two or
more errors have occurred, then y will be decoded as a
codeword different from that sent.
8.2 11100001, 01111000, at least two errors, 00110011.
8.3 From the standard form generator matrix (see Example
5.6(i1)), write down a parity-check matrix (via Theorem
7.6) and observe that its columns are the non-zero vectors
of V(3, 2).
8.4 For C, a&=1 and a,=n, giving P,,,(C)=(1-p)” ‘((1-
p+np). Because every vector in V(n, 2) has distance = 1
from a codeword of C, it follows that every vector in
V(n+1,2) has distance<2 from a codeword of C.
Consequently, the coset leaders for C all have weight <2
226 A first course in coding theory
and sO @=1, a@,=n+1, @ =n, which leads to
Poor(C) =(1—p)*'(1-—p+np). [Remark: This result
will be generalized to any perfect binary code in Exercise
9.1.]
01111111
8.5 (i); |po1s346 “| 35234106,
34106, 10561360.
10561360
ii) f000000111111111
011111000001111
1012340123401 23
1111111111111111
1222223333344444
4012340123401234
8.6
8.7 Sood 1110 0 0
3 20 0 1)’ 100 2 1 0
02010 1
[For the code C,, a column operation (e.g. interchange of
columns 3 and 4) is necessary during the reduction of G to
a standard form of G’. So, after applying Theorem 7.6 to
get a parity check matrix H’ corresponding to G’, the
above column operation must be reversed in H’ in order
to get a parity-check matrix for the original code C).]
d(C,) =2, d(C) =3.
(other answers possible)
8.8 For example,
100111
H={010123
001134
has the property that any three columns form a linearly
independent subset of V(3,5), and so H is the parity-
check matrix of a [6, 3, 4]-code.
k
8.9 R,= == (2-1 -ni(2-1)=1-5— > lasr>
8.10 As in solution to Exercise 7.8, A,(n,3)<q"*. Now
suppose g is a prime power. Then the bound is achieved
forn=q+1 by Ham (2, qg) and for n<q +1 by shorten-
ings of Ham (2, q).
Solutions to exercises 227
NWR eR
xKx
me
hm
Chapter 9
S()-2
9.1 Suppose C is a perfect ¢t-error-correcting [n, k]-code, so
that t
ai
228 A first course in coding theory
As in Exercise 8.4, for C,
n+1
a = (" ) for 0<i<r,
l
and
O,.,=2"t1k#- >)
f (”
+1
i=0 l
=2->(")-3(F)-2G y=):t
n .(n f n
2, l 2, Ly i=
Hence
, , n
pil —p)yrri + ( pa — py"
t
nh . .
"\p'( —p)r*t
9.8
9.9
a Ga(e
(i) Assume 1111111100---O0¢G,,. Let G be a gener-
ator matrix of G,,. Since d(G,,) = 8 and since Gy, is
self-dual, it follows by Theorem 8.4 that any 7
230 A first course in coding theory
columns of G are linearly independent. In particular,
the first 7 columns are linearly independent and so
by elementary row operations, G may be trans-
formed to a matrix having its first 7 columns as
shown. Since 1111111100 - - - 0 is orthogonal to every
row of G, the eighth column of G must also be as
shown.
(ii) Let the rows of G be r,,h%,...,¥yp. The set of
codewords with one of the given starts is given by
adding to 0, or to one of ,1r,...,9r,, all vectors of
the form ))j2,A,r;, A; € GF(2). So for each of the 8
starts, there are 2° codewords.
(iii) Immediate, since d(G,,)=8, and any two of the
chosen 256 codewords differ in at most 2 of the first
8 positions.
(iv) Immediate.
9.10 Shorten N,; thrice (cf. Exercise 2.2) to get a (12, 232, 5)-
code.
9.11 (i) Let the rows of G be r,,1r,...,9r¢. To show that G,
generates an [8, 5, 3]-code, it is enough to show that
if x is any non-zero codeword of C generated by
r,,13,.-..,¥.¢, then x has at least three 1s in the last 8
positions. If x had at most two ls in the last 8
positions, then either x or x +r, would be a code-
word of C having weight = 4, a contradiction.
(il) If there existed a [15,8,5]-code, then it could be
twice shortened to give a [13, 6, 5]-code, contrary to
the result of part (i).
(iii) Not immediately, for in this case G, would generate
a [7,4, 3]-code, and a code with these parameters
does exist. However, further considerations do lead
to a contradiction; see, e.g., van Lint (1982), §4.4.
Chapter 10
012 012
A,=B,= 12 O}, A,=B,= 201 .
201 120
Solutions to exercises 231
Chapter 11
11.1 0204006910.
11.2
i 479 1
1081 2
977 9
C= fs 218 10
197 4
E 767 1
11.3 0000001000, 1005000003.
11.4 Identify the letters A,B,...,Z with the field elements
0,1,...,25 of GF(29). Let H be the parity-check matrix
11 1 1
12 3 8
1 2? 3? 8?
1 23 3° 8°
i
hy}
They are 5, 10, 2, 6, 9, 7, 3, 4, 8, 6, 0. It follows that a
double-error vector will go undetected if and only if it is
of the form (0, 0, 0, A, 0, 0, 0, 0, 0, —A, 0) for some
Ae {1,2,..., 10}.
Chapter 12
12.1 (i) No, No (not linear), (11) No, No, (iii) No, Yes, (iv)
Yes, provided the alphabet is a field, (v) Yes, (vi) No,
No, (vii) Yes.
22 + |O0 1 x 1+x 1 +x has no inverse
0/0 0 0 0
1 0 1 x 1+x
x |O x 1 1+x
1+x|O 1+x 1+x 0
12.3 Just imitate the proof of Theorem 3.5.
12.4 If f(x) had an even number of non-zero coefficients, then
we would have f(1) = 0 and so x — 1 would be a factor of
f(x).
234 A first course in coding theory
12.5 Because p(x) =f(x)g(x) > deg p(x) = deg f(x) + deg g(x)
> either deg f(x) <4deg p(x) or
deg g(x) <2deg p(x).
12.6 x, 1+x, l+x4+x7, 14+x4+x°, 1+x%*%4+%7, 1t+x4+x74,
1+x°4+x4, 1+x4+%x74+2%3+x*. (Using Lemma 12.3 and
Exercise 12.4, it easily follows that the irreducible
polynomials of degrees 2, 3 and 4 are precisely those with
constant coefficient 1 and with an odd number of
non-zero coefficients, with the exception of (1+x+
x”)? =1+x7+x*). For example, F[x]/(1+x+x°) is a
field of order 8.
12.7 (i) By Exercise 3.12, (x? —1)=(x—-1).
(ii) From Fermat’s theorem (Exercise 3.8) and Lemma
12.3(i), it follows that x?~*=(x — 1) —-2)---(«-
(p — 1)).
12.8 By Lemma 12.3(i), x°-—1=(« —1)(x*4+x°4+2%7+x +1),
and the second factor is irreducible by Exercise 12.6. So
the only cyclic codes are {0}, (x —1) (the even weight
code), (x*+x°+x7+x+1) (the repetition code), and
the whole of V(5, 2).
12.9 Yes, (x — 1)g(x).
12.10 2°. (In a factor of x” — 1, each of the ¢ distinct irreducible
factors may or may not be present).
12.11 (1) = whole space
(x —1) =even weight code E,
(x3 +x+1)
}ooth are Hamming codes Ham (3, 2)
(x? +x°+1)
((x —1)(x?+%x+1)) yan are even weight subcodes of
((x — 1)(x? + x* + 1))J Ham (3, 2) (alternatively, both are
duals of Ham (3, 2))
((x3 +x + 1)(4° +x7+1)) =repetition code of length 7
(x7—1) = {0}.
12.12 x8—1=(x4- 14741) = -1D(e + D074 12 4+%4+
2)(x* + 2x + 2), 32.
12.13 Straightforward application of Theorem 12.15.
12.14 Not in general; Yes, C+ is obtained from (h(x)) by
writing the codewords backwards.
12.15 Let g(x) be the generator polynomial of C. Then g(x) isa
Solutions to exercises 235
111 1
5° 9 2°29}
Now
Chapter 13
13.3 C* is generated by
SO oortioL
110011101)
Solutions to exercises 237
We(z) = » (A;
+ Aj_1)2’
ieven
ieven j odd
=4[W-(z) + We(—z)] + 4z[We(z) — We(-z)].
«Woi((1-725)/(+755))
—(1-p)’
Chapter 14
14.1 No; Exercises 9.9 and 9.11 show that A,(15, 5)=256,
B,(15, 5) = 128.
14.2 (i) V(n,q) is an [n, n, 1]-code.
(ii) C= {xyx.--+-x, | xy +x.4+---+x,=0} is an
[n,n —1,2]-code. Since there cannot exist an
[n, n, 2]-code, we have B,(n, 2) =q""'.
Solutions to exercises 239
q-1 q-1
q-1 q-1
?
Chapter 15
15.4 t 1111]
1 a, a3
H= L 1 a; a3}.
: 1 dg ag |
15.5 Let H=[A | J] be a standard form parity-check matrix for
an [n,n—r,r+1]-code with n=max,(r,q). Deleting
the last row and last column of H gives a matrix whose
columns form an (n—1,r—1)-set in V(r—1,q) and so
n—1<max,_,(7—1,q).
15.6 Let C be an [8, 3, 6]-code over GF(7). By Corollary 15.7,
C+ is an [8,5,4]-code. Let W-(z)=NA,z' and
W -:(z) =X B,z'. By Theorem 13.6,
8
r(1 +> Bz’) = (1+ 6z)®+ A,(1 — z)°(1 + 6z)”
~ + A,(1—z)"(1+6z)+Ag(1—z)® (1)
Equating coefficients of 1, z and z* and solving for A,, A;
and Ag, gives W.(z) =1+ 168z° + 48z’ + 126z°. We.(z)
is now easily obtained directly from (1).
15.7 For2s<k 11,
1 1 1 10
1 2 :++ 10 00
Chapter 16
At the end of each entry the number in square brackets gives the
chapter which refers to this entry.
decoder 1 ISBN 36
decoding ideal 146
BCH codes 131 principal 147
Berlekamp—Massey algorithm 138 identity element 31
- incomplete 74 information theory 65
linear codes 56 inner product 67
maximum likelihood 6 intersection of vectors 15
nearest neighbour 5 inverse element 31
syndrome 71
design
block 21 Jupiter 10
Hadamard 26, 203
symmetric 26
t- 104 Latin square 113
dimension 44 leading coefficient 142
disjoint xii length 2
distance linear combination 42
Hamming 5 linearly dependent 42
minimum 7 linearly independent 42
division algorithm 142
double-adjacent error 163 MLCT problem 175
dual of a code 67 MOLS 114
MacWilliams identity 165, 167, 168
Mariner 9
element xi Mars 9
Elias 204 matrix
encoder 1 generator 49
encoding a linear code 55 Hadamard 203
equivalent codes 12, 50 incidence 23
error vector 56 non-singular 194
Euler 107, 121 parity-check 69
Euclidean algorithm 39 Vandermonde 125
max, (r,q) 176
message digits 55
F, 2 modulo 33
(F)" 2
field 31
finite 32, 145 NASA 9, 205
Galois 33 (n, s)-set 176
prime 33 Neptune 10
Fisher 26 Norwegian registration
football pools 18, 27, 94 numbers 138
Index 251
officers problem 107 ring 32
optimal (n, s)-set 176 ring of polynomials modulo f(x) 143
order xii
of a field 32
of a plane 26 Saturn 10
orthogonal 67 scalar 41
set XI
Shannon vii, 62, 64
Poor 60 Slepian 56
P.. 60 sphere 18
Pretrans 64 standard array 58
standard form 50, 71
Pangerec 63, 171
symb
Steiner system 105
PG(r—-1, q) 178 submatrix 194
packing problem 176 subset xi
parity-check 70 subspace 42
overall 16 sum of vectors 15
parity-check equations 70 symbol error rate 63
parity-check matrix 69 syndrome 71
partial fractions 133, 135 syndrome look-up table 73
permutation 12
persymmetry 137
photographs 9 telephone numbers 3
plane 186 theorem
Fano 22 Assmus—Mattson 105
projective 26, 45, 123, 179 Bruck—Ryser—Chowla 26
seven point 22 Fermat 39, 40
polynomial 142 Lagrange 57
check 151 Levenshtein 201
degree of 142 van Lint-Tietavainen 102
error-evaluator 134 Lloyd 103
error-locator 133 Shannon 62
generator 148 triangle inequality 5
irreducible 144
monic 142
primitive 160 Uranus 10
reciprocal 153
reducible 144 V(n, q) 41
prefix 209 vector 2, 41
primitive element 38 vector space 41
probability Viking 9
symbol error 6 Voyager 10
word error 6, 60
projective geometry 178
weight 15, 47
weight enumerator 165
quadric, elliptic 188 of binary Hamming code 171
of binary Golay code 173
of MDS code 198
R,, 146 word 3
Ramanujan 125
rate of a code 61
received vector 1
redundancy 1, 2, 55, 81
Algebraic coding theory is a new and rapidly developing
subject, motivated by immediate practical applications
but also fascinatingly rich in mathematical structure. It is
not surprising that the subject is becoming increasingly
taught in undergraduate courses in mathematics,
engineering, and computer science.
Discrete mathematics
Revised edition
Norman L. Biggs