Coding Theory Tohoku June 09
Coding Theory Tohoku June 09
Notes
Vladimir D. Tonchev
Department of Mathematical Sciences
Michigan Technological University
Houghton, Michigan 49931, USA
http://www.math.mtu.edu/∼tonchev/Coding-Theory-Tohoku-June-09.pdf
May 16, 2009
Contents
1 Error-correcting codes 12
2 Linear codes 14
6 Vasil’ev codes 27
1
10 Perfect codes and data compression 39
11 MacWillimas identities 40
15 Quadratic-residue codes 51
16 Cyclic codes 56
17 Factoring xn − 1 58
2
Often, when I say my name, Vladimir, over the phone, I am asked the
question:
3
Often, when I say my name, Vladimir, over the phone, I am asked the
question:
Then I reply:
• V as in Victor
• L as in Lancing
• A as in Apple
• D as in David
• I as in Igor
• M as in Mary
• I as in Igor
• R as in Richard
4
The original message (essential information) is:
V ladimir
( 8 information symbols ).
5
The original message (essential information) is:
V ladimir
( 8 information symbols ).
V ictorLancingAppleDavidIgorMaryIgorRichard
(42 symbols).
6
The original message (essential information) is:
V ladimir
( 8 information symbols ).
V ictorLancingAppleDavidIgorMaryIgorRichard
(42 symbols).
7
Questions:
8
Questions:
9
Questions:
10
A basic model of a Communication Channel
11
1 Error-correcting codes
The mathematical theory of error-correcting codes originated in a paper by
Claude Shannon [25] from 1948.
A code (or a block code) C of length n over a finite alphabet Fq of size q
is a subset C of the set Fqn of all n-letter words with components from Fq .
We refer to the elements of C as words, codewords, or vectors. A code over
Fq is called a q-ary code. A code is binary if q = 2, ternary if q = 3, etc.
The Hamming distance d(x, y) between x = (x1 , . . . , xn ), y = (y1 , . . . , yn )
is defined as the number of positions in which x and y differ:
d(x, y) = |{i | xi 6= yi}|.
The Hamming distance enjoys the usual properties of a distance function:
1. d(x, y) ≥ 0, and d(x, y) = 0 if and only if x = y.
2. d(x, y) = d(y, x).
3. d(x, y) ≤ d(x, z) + d(z, y) for arbitrary x, y, z ∈ Fqn ; (the triangle in-
equality).
A Hamming sphere Srn,q (x) of radius r with center x ∈ Fqn is defined as
the set of all words being at distance at most r from x:
Srn,q (x) = {y | y ∈ Fqn , d(x, y) ≤ r}.
Exercise 1.1 Prove that a sphere of radius r in Fqn is of size
r
!
n
(q − 1)i
X
(1)
i=0 i
The minimum distance d of a code C is defined as the smallest Hamming
distance between pairs of words from C:
d = min d(x, y) : x, y ∈ C, x 6= y.
A code can be thought as a collection of messages that are being transmitted
over a communication channel. If the channel is subject to noise, some of the
components of a message x = (x1 , . . . , xn ) ∈ C may be corrupted. Thus, the
received message y = (y1 , . . . , yn ) may differ from x, and the distance d(x, y)
counts the number of errors in y.
The process of recovering the original message x from the received mes-
sage y is called decoding.
12
Theorem 1.2 If C is a code with minimum distance d ≥ 3, there is a de-
coding algorithm that corrects up to [(d − 1)/2] errors.
The proof of Theorem 1.2 implies the following simple decoding algorithm,
known as maximum likelihood decoding: the received vector y is decodes as
x ∈ C where x is the closest codeword to y:
Exercise 1.3 Show that a code with minimum distance d can detect up to
d − 1 errors.
Exercise 1.4 Prove the triangle inequality for the Hamming distance.
Exercise 1.6 Give an example of a binary code of length 7, size 17, and
minimum distance 3, or prove that such a code does not exist.
13
2 Linear codes
A field is a set F with two operations, addition +, and multiplication ·,
satisfying the following axioms:
F2 = {0, 1}.
0 · 0 = 0 · 1 = 1 · 0 = 0, 1 · 1 = 1.
Addition is modulo 2:
0 + 0 = 1 + 1 = 0, 0 + 1 = 1 + 0 = 1.
14
If Fq is a field of order q, the set
Fqn = { (x1 , . . . , xn ) | xi ∈ Fq }
Exercise 2.4 Find the number of distinct generator matrices of a q-ary lin-
ear [n, k] code.
Definition 2.5 Given a code C ⊆ Fqn , the dual code C ⊥ is defined as the
orthogonal space of C:
x · y = x1 y1 + · · · + xn yn (2)
is the ordinary scalar product in Fqn (note that other inner products are used
sometimes).
15
Definition 2.7 The Hamming weight w(x) of a vector x ∈ Fqn is defined as
the number of its nonzero components:
Theorem 2.9 The minimum distance of a linear code is equal to its mini-
mum weight.
We use the notation [n, k, d] for a linear [n, k] code with minimum distance,
or equivalently, minimum weight d. For example, the whole space Fqn is an
[n, n, 1] code.
In the binary case (q = 2), the weight function satisfies the following
identity:
w(x + y) = w(x) + w(y) − 2w(x ∗ y) (4)
for arbitrary vectors x = (x1 , . . . , xn ), y = (y1 , . . . , yn ), x, y ∈ F2n , where x∗y
is defined as
x ∗ y = (x1 y1 , . . . , xn yn ).
Exercise 2.11 (i) Show that the set C of all binary vectors of length n ≥ 2
of even weight form an [n, n − 1, 2] code.
(ii) Find a parity check matrix of C.
(iii) Find a generator matrix of C.
16
column of H, 1 ≤ i ≤ n. Let x be a nonzero vector from C of weight w, and
let xi1 , . . . , xiw be the nonzero components of x. We have
hence, the columns hi1 , . . . , hiw are linearly dependent. This implies the
following simple, but very useful result.
Theorem 2.12 The minimum weight of a linear code with a parity check
matrix H is equal to the largest integer d such that every d − 1 columns of
H are linearly independent.
Corollary 2.13 A linear code with a parity check matrix H can correct sin-
gle errors if every two columns of H are linearly independent. In particular,
a binary linear code can correct single errors if all columns of its parity check
matrix are nonzero and distinct.
00111
are nonzero and distinct. Thus, H is a parity check matrix of a binary code
with minimum weight d ≥ 3.
Exercise 2.15 Determine the minimum distance of the code from Example
2.14.
d ≤ n − k + 1. (5)
17
Definition 2.17 An [n, k, d] code with d = n − k + 1 is called maximum
distance separable code, or an MDS code.
Exercise 2.18 Give a generator matrix of a binary [5, 4, 2] MDS code.
Definition 2.19 A generator matrix of the form G = (Ik |B), where Ik is
the identity matrix of order k, is called a standard generator matrix.
Exercise 2.20 If G = (Ik |B) is a generator matrix of an [n, k] code C then
H = (−B T |In−k ) is a parity check matrix of C.
For the next definition, it is convenient to think of a code C of length n as
an array with n columns having as rows the words of C.
Definition 2.21 Two codes C ′ C ′′ ⊆ Fqn are permutation equivalent, if C ′′
can be obtained by permuting the columns of C ′ . If Fq is a finite field of
order q, two codes C ′ , C ′′ ∈ Fqn are monomially equivalent if C ′′ can be
obtained by permuting the columns of C ′ and multiplying some columns of
C ′ by nonzero elements from Fq .
Definition 2.22 An automorphism of a code is any any equivalence of the
code to itself. The set of ll automorphisms of a code forms a group under
composition, called the automorphism group of the code.
Exercise 2.23 Find the automorphism group of the binary [6, 3] code with
generator matrix G = (I3 |J3 − I3 ).
Exercise 2.24 (1) Show that every linear [n, k] code is equivalent to a code
which has a standard generator matrix.
(2) Give an example of a code which does not have a standard generator
matrix.
Definition 2.25 A set of k coordinate positions i1 , i2 , . . . ik of a linear [n, k]
code C ⊆ Fqn is called an information set if the k columns of G with indices
i1 , i2 , . . . ik are linearly independent over Fq .
Clearly, an [n, k] code admits a standard generator matrix if and only if the
first k coordinate positions form an information set.
The meaning of an information set is the following: any codeword is ob-
tained by recording in the k information positions any of the possible q k
words of length k over Fq , and the remaining n − k coordinates are calcu-
lated as linear combinations of the k information symbols. The exact linear
combinations are determined by using a parity check matrix of the code.
18
Exercise 2.26 List all information sets of the binary [5, 2] code with gener-
ator matrix !
11010
G= .
10111
19
3 Syndrome decoding of linear codes
The decoding algorithm implied by Theorem 1.2 requires computing the
Hamming distances between the received message and all codewords. This
algorithm is inefficient for codes containing a large number of words. There
is a more efficient decoding algorithm for linear codes known as syndrome
decoding .
Suppose that C ⊆ Fqn is a linear [n, k] code over a finite field Fq , and let
b ∈ Fqn be a vector. The coset of C with representative b is defined as the set
of vectors
C + b = {c + b | c ∈ C}. (6)
The main properties of cosets are summarized in the following lemma.
Fqn = C ∪ (C + b1 ) ∪ · · · ∪ (C + bqn−k −1 ).
Example 3.3 The cosets of the binary [4, 2] code C with generator matrix
!
1011
G=
0101
are given in Table 3.4. For each coset, a leader is chosen as a representative
and listed in the first column. Note that the coset with a leader 0001 contains
a second vector of weight one, 0100, which also is a leader.
20
Leader Coset
0000 0000 1011 0101 1110
0001 0001 1010 0100 1111
0010 0010 1001 0111 1100
1000 1000 0011 1101 0110
Suppose that C ⊆ Fqn is an [n, k] code with a parity check matrix H. The
syndrome s(b) of a vector b ∈ Fqn is defined as the (n − k) × 1 column vector
equal to
s(b) = HbT .
Lemma 3.5 All vectors in a given coset have the same syndrome.
Example 3.6 The following is a parity check matrix of the binary [4, 2] code
from Example 3.3: !
1010
H= .
1101
The syndromes of the coset leaders are listed in Table 3.7.
Table 3.7 Coset leaders and their syndromes
Leader Syndrome
!
0
0000
0 !
0
0001
1 !
1
0010
0 !
1
1000
1
21
Suppose now that a vector x ∈ Fqn belonging to a linear code C with a parity
check matrix H has been sent over a noisy channel, and a vector y ∈ Fqn has
been accepted at the receiving end. The vector
e = y − x,
called the error vector, determines whether any errors have occurred in the
process of transmitting x. If e = 0 no errors have occurred, hence y = x.
Otherwise, the weight of e is equal to the number of errors, i.e., the number
of coordinates of x which have been altered during the transmission. Note
that
Hy T = HeT .
This observation is the base of the following decoding algorithm, known as
Syndrome Decoding.
1. Compute the syndrome s(y) = Hy T of the received vector y.
2. Find a coset leader e having the same syndrome as y.
3. If e is the only leader in the coset with syndrome s(y), decode y as
x = y − e. Otherwise, conclude that an error pattern has been detected
that cannot be corrected.
Theorem 3.8 The syndrome decoding algorithm determines correctly the
initial codeword x provided that the number of errors t does not exceed [(d −
1)/2], where d is the minimum distance of the code.
Proof. Note that any two distinct vectors of weight t ≤ [(d − 1)/2] belong
to distinct cosets. Thus, the error vector e is equal to the unique coset leader
having the same syndrome as y.
22
Example 3.10 The binary Hamming code of length 7 is a linear [7, 4] code
with parity check matrix H having as columns all distinct nonzero (0, 1)-
vectors with three components, ordered lexicographically. Since the columns
of H are nonzero and distinct, the minimum distance d of the code is at least
3. On the other hand, there are triples of linearly dependent columns, hence
d = 3 and the code can correct any single error. There are 27−4 = 23 = 8
cosets, with coset leaders the zero vector (for the code itself), and the seven
vectors in F27 of weight 1. The syndrome of a leader of weight one having ith
nonzero coordinate (1 ≤ i ≤ 7), is equal to the ith column of H. Thus, the
syndrome decoding algorithm for correcting single errors with the Hamming
code reads as follows:
23
4 The sphere-packing bound
The length n, the minimum distance d, and the total number of codewords
(or size) M = |C| are the main parameters of a code C. Increasing d is
generally possible at the expense of decreasing M or increasing n. If d and
M are fixed, the most interesting codes are those of shortest length n. If d
and n are fixed, one looks for a code of largest possible size M. Thus, there
are three fundamental optimization problems imposed by fixing two of the
parameters n, d, M and optimizing with respect to the third. Explicit
solutions of any of these optimization problems are rarely known in general.
However, there are estimates, or bounds for the optimal values in terms of
inequalities.
The following theorem gives an upper bound on the size of a q-ary code
of given length and minimum distance.
i=0 i 2
24
Nontrivial examples of perfect codes with d = 3 are discussed in the next
section.
25
5 The Hamming codes
In this section, we describe a class of linear perfect single error-correcting
codes (d = 3) known as Hamming codes.
We know from 2.13 that a linear binary code has minimum distance at
least 3 if and only if all columns in the parity check matrix are nonzero and
distinct.
The binary Hamming code Hm (2) of length n = 2m − 1, (m ≥ 2) and
dimension k = n − m is defined as a linear code with a parity check matrix
H having as columns all distinct nonzero vectors with m components. By
Definition 2.21, all binary Hamming codes of given length n = 2m − 1 are
equivalent. It is convenient to assume that the columns of H are ordered
lexicographically, that is, the ith column of H is the binary presentation
of the number i, 1 ≤ i ≤ 2m − 1. Clearly, the first three columns of H
are linearly dependent over the field of order 2, F2 = GF (2). By 2.13, the
minimum distance of Hm (2) is equal to 3. A sphere of radius 1 in F2n is of
size n+ 1. Since
2n m
= 22 −1−m = 2n−m ,
n+1
the Hamming code Hm (2) is perfect.
Clearly, any binary linear code of length n = 2m −1, dimension k = n−m,
and minimum distance d = 3, is equivalent to Hm (2).
The binary Hamming codes were introduced by Richard Hamming [6] in
1950, who proposed also a simple decoding algorithm for such codes. Suppose
that y ∈ F2n (n = 2m − 1) is a vector obtained from some codeword x ∈ F2n
by changing at most one coordinate of x (from 0 to 1 or vice versa). Then x
can be recovered from y as fallows. We compute the column-vector S, called
the syndrome of y, as
S = Hy T , (8)
where H is the parity check matrix of Hm (2).
If S is the zero vector then y ∈ Hm (2) and we assume that no errors have
occurred, i.e., x = y. Otherwise, S is identical with one of the columns of H.
If S is equal to the ith column of H then x is obtained from y by replacing
the ith component yi of y by 1 − yi .
The decoding algorithm of the Hamming code is a special case of the
syndrome decoding.
26
Nonbinary Hamming Codes.
For every prime power q and every length n = (q m − 1)/(q − 1), (m ≥ 2),
there are linear perfect single-error-correcting codes over the finite field of
order q, GF (q), being analogues of the binary Hamming codes.
The q-ary Hamming code Hm (q) is defined as a linear code over GF (q)
with parity check matrix H having as columns representatives of all 1-
dimensional vector spaces of the m-dimensional vector space GF (q)m .
Exercise 5.1 Verify that Hm (q) is perfect.
Exercise 5.2 Describe a decoding procedure for correcting single errors us-
ing Hm (q).
6 Vasil’ev codes
All examples of nontrivial perfect codes discussed so far are linear codes.
Exercise 6.1 If C is a perfect code, any coset C + y, where y ∈
/ C, is a
perfect nonlinear code.
Vasil’ev [29] described the following “doubling” construction that starts
from a binary single-error-correcting perfect code of length n and produces
a perfect code of length 2n + 1 which is often nonlinear and not a coset of
any linear code.
Let E be a perfect binary code of minimum distance 3 and length n =
2m − 1 containing the zero vector (for example, E could be the Hamming
code Hm (2)). Let f be a function that assigns value 0 or 1 to every vector
from E, such that f (0̄) = 0, where 0̄ denotes the zero vector. Let π be the
function defined on F2n that assigns 0 to all vectors of even weight, and 1 to
all vectors of odd weight. Equivalently, if x = (x1 , . . . , xn ) ∈ F2n then
π(x) = (x1 + · · · + xn ) mod 2.
Theorem 6.2 Let C be a binary code of length 2n + 1 defined as follows:
C = {(v, (v + a) mod 2, (π(v) + f (a)) mod 2) | a ∈ E, v ∈ F2n }. (9)
Then
(i) C is a perfect binary single error-correcting code.
(ii) If f is nonlinear then the code C is nonlinear, and is not a coset of a
linear code.
27
Proof. Let x, y ∈ C, where
x = (v, v+a, π(v)+f (a)), y = (u, u+b, π(u)+f (b) : a, b ∈ E; u, v ∈ F2n . (10)
The Hamming distance d(x, y) between x and y is equal to
d(x, y) = d(v, u) + d(v + a, u + b) + d(π(v) + f (a), π(u) + f (b)).
If u = v then x 6= y only if a 6= b, in which case
d(x, y) ≥ d(a, b) ≥ 3.
If u 6= v, but a = b, we have
d(x, y) = 2d(v, u) + d(π(v), π(u)),
hence d(x, y) ≥ 4 whenever d(u, v) ≥ 2.
If d(v, u) = 1 then the Hamming weights of v and u are of different parity
modulo 2, hence d(π(v), π(u)) = 1 and d(x, y) = 3.
If a 6= b then d(a, b) = w(a − b) ≥ 3, and
d(x, y) ≥ w(v−u)+w(v−u+a−b) ≥ w(v−u)+w(a−b)−w(v−u) = w(a−b) ≥ 3.
Thus, the minimum distance of C is 3. The size of C is
m+1 −m−2
2n · 2n−m = 22n−m = 22 ,
hence C is a perfect code.
To prove (ii), we note that choosing v = a = 0 in (9) gives the zero vector,
thus C is either linear, or a nonlinear code that is not a coset of a linear code.
Let x, y ∈ C be defined as in (10). We have
x + y = (v + u, v + u + a + b, π(v) + π(u) + f (a) + f (b)),
where all additions are modulo 2. Since
π(v) + π(u) = π(v + u),
the vector x + y belongs to C if and only if a + b ∈ E and
f (a) + f (b) = f (a + b).
Thus, the code C is linear if E is linear and f is a linear function, and
nonlinear if f is nonlinear.
28
Exercise 6.3 Let C be a binary linear code of dimension k and
f : C → {0, 1} be a function such that f (0̄) = 0 and
f (a + b) = f (a) + f (b)
for all a, b ∈ C, where all additions are modulo 2. Prove that either f is
constant or f takes value 1 at exactly 2k−1 vectors from C.
Exercise 6.4 Show that a Vasil’ev code of length 7 is necessarily linear.
Exercise 6.5 Find an explicit example of a nonlinear Vasil’ev code of length
15.
Note 6.6 There are exactly nineteen equivalence classes of Vasi’ev codes of
length 15 (F. Hergert [8]).
Note 6.7 All perfect binary single-error-correcting codes of length 15 have
been enumerated recently by Östergard and Pottonen [19].
Note 6.8 Nonlinear perfect single-error-correcting q-ary codes exist for ar-
bitrary prime power q (Schönheim [27], Lindström [9]).
29
Note 7.3 Equation (11) implies that all vectors in a binary self-orthogonal
code are of even weight, and all vectors in a ternary self-orthogonal code have
weights divisible by 3.
Exercise 7.4 Prove that in a binary linear code either all codewords are of
even weight or exactly half of the codewords are of even weight.
Definition 7.6 A code C is called even if all vectors in C have even weights,
and doubly-even if all vectors in C have weights divisible by 4.
The extended binary Golay code G24 is a linear [24, 12] code with a gen-
erator matrix
1
I ..
G= 12 . A
, (12)
1
0 1 ... 1
where A is an 11 by 11 circulant matrix with six nonzero entries (equal to 1)
in the first row located positions 2, 6, 7, 8, 10, 11.
Theorem 7.9 The extended Golay code is a doubly-even self-dual code with
minimum distance 8.
Proof. The last row of G is of weight 12, while all other rows are of weight 8.
The inner product of the last row of G with any other row is 6. The product
of any two distinct rows of A is 3, hence the product of the corresponding
rows of G is 4. It follows from 7.7 and 7.8 that G generates a doubly-even
30
self-orthogonal code, and since the rank of G is 12 = 24/2, this code is
self-dual. Consequently, the matrix
1 ... 1 0
1
H= .. (13)
AT . I12
1
is both a parity check matrix and another generator matrix of G24 . Since G24
is doubly-even and G has rows of weight 8, the minimum weight of G24 is
either 4 or 8.
Assume that x = (x1 , . . . , x12 , x13 , . . . , x24 ) ∈ G24 is a codeword of weight
4. Let i be the weight of the first 12 positions of x, (x1 , . . . , x12 ). Then x is
the sum of i of rows of G and 4 − i rows of H. Since neither G nor H has
any rows of weight 4, it follows that i = 2. Using formula (4), one verifies
that the weight of the sum of any two rows of G is 8, a contradiction. Thus,
the minimum weight of G24 is 8.
The Golay code G23 of length 23 is a [23, 12, 7] code having a generator
matrix obtained by deleting one of the columns of G (12). Since
223 223
23
23
23
23
= 11
= 212 ,
+ + + 2
0 1 2 3
Exercise 7.12 Prove that if C is a binary linear [n, k] code with a generator
matrix having a nonzero ith column (1 ≤ i ≤ n), there are exactly 2k−1
vectors in C with ith coordinate equal to zero.
Exercise 7.13 Find the weight distribution of the extended Golay code G24 .
31
Exercise 7.14 Find the weight distribution of the perfect Golay code G23 .
sup(x) = {i | xi 6= 0}.
Exercise 7.17 Prove that if D is a t-(v, k, λ) design with point set X and s
is an integer in the range 0 ≤ s ≤ t, any s-subset of X is contained in
v−s
t−s
λs =
k−s
t−s
Exercise 7.18 Show that the collection of the supports of vectors of weight
8 in G24 is a 5-(24, 8, 1) design.
Exercise 7.19 Show that the collection of the supports of vectors of weight
7 in G23 is a 4-(23, 7, 1) design.
Note 7.20 The full automorphism group of G24 is the 5-transitive Mathieu
group M24 [18], while the full automorphism group of G23 is the 4-transitive
Mathieu group M23 [18].
32
8 The ternary Golay codes
In [5], Golay described also a ternary perfect double-error-correcting code,
namely an [11, 6, 5] code, widely known in the literature as the ternary Golay
code.
The extended ternary Golay code G12 is a linear ternary [12, 6] code with
a generator matrix
1
I ..
6 . A
G= , (14)
1
0 1 ... 1
where A is the 5 by 5 circulant matrix with first row 012210.
Theorem 8.1 The extended ternary Golay code is a self-dual code with min-
imum distance 6.
Proof. Since all rows of G are of weight 6 (a multiple of 3), and the inner
product of every two rows of G is a multiple of 3, G12 is self-dual, with
minimum weight D equal to 3 or 6. A codeword of weight 3 has to be either
a row of G (14), or a row of the parity check matrix H given by (15).
2 ... 2 0
2
H= .. (15)
−AT . I6
2
Since neither G nor H has any rows of weight 3, it follows that d = 6.
33
is a generator matrix of a ternary self-dual [12, 6, 6] code.
Exercise 8.3 Let H12 be an Hadamard matrix of order 12. Show that H12
is a generator matrix of a ternary self-dual [12, 6, 6] code.
Exercise 8.4 Find the weight distribution of the extended Golay code G12 .
Exercise 8.6 Prove that the supports of all vectors of weight 5 in G11 are
the blocks of a 4-(11, 5, 1) design.
Exercise 8.7 Prove that the supports of all vectors of weight 6 in G12 are
the blocks of a 5-(12, 6, 1) design.
Note 8.9 In [5], Golay introduced not only the perfect binary [23, 12, 7] and
ternary [11, 6, 5] codes, but also all linear binary and q-ary perfect single-
error-correcting codes, widely known in the literature as Hamming codes.
Note 8.10 The parameters of all perfect codes over a finite filed were de-
termined in a series of papers by van Lint [10], [11], [12], Tietäväinen [28],
and Zinoviev and Leontiev [30]. The main result is that a nontrivial linear
perfect code is either a Hamming code or a Golay code. In addition, any
nonlinear perfect code with minimum distance greater than 3 is a coset of a
Golay code, and any perfect single-eerror-correcting codes has the parame-
ters of a Hamming code. For a proof of the uniqueness (up to equivalence) of
the Golay codes see Pless [22], [23, Chapter 10], and Delsarte and Goethals
[4]. A more recent survey on perfect codes is the paper by Heden [7].
34
9 The Assmus-Mattson characterization of per-
fect codes
Suppose that q is a prime power, and let C ⊆ GF (q)n be a linear q-ary code
of length n. Let w be an integer, 0 < w < n. If q > 2 and x ∈ C is a vector
of weight w, all q − 1 nonzero multiples αx of x, where α ∈ GF (q), α 6= 0,
share the same support. We associate with x and its multiples the support
sup(x), and define a collection of w-subsets D of the set of coordinate indices
{1, 2, . . . , n}, consisting of the supports of all codewords in C of weight w.
The next theorem, due to Assmus and Mattson [2], describes a relation-
ship between perfect codes and t-designs supported by their codewords of
minimum weight.
Theorem 9.1 A linear code C over GF (q) of length n and minimum dis-
tance d = 2e + 1 is perfect if and only if the collection of supports of all
codewords of weight d is a simple (e + 1) − (n, 2e + 1, (q − 1)e ) design.
35
z of minimum weight which coincides with y in all positions from T :
Corollary 9.3 The supports of minimum weight vectors of the binary Golay
code G23 form a 4-(23, 7, 1) design.
Corollary 9.4 The supports of minimum weight vectors of the ternary Go-
lay code G11 form a 3-(11, 5, 4) design.
Note 9.5 The 3-(11, 5, 4) design from 9.4 is actually a 4-(11, 5, 1) design.
Corollary 9.7 The supports of minimum weight vectors of any Vasil’ev code
of length 2m − 1 form a 2-(2m − 1, 3, 1) design.
Note 9.8 A 2-design with block size 3 and λ = 1, i.e., a 2-(v, 3, 1) design is
also called a Steiner triple system, and is often denoted by ST S(v).
Exercise 9.9 (i) Use the construction from [9] or [27] to find a nonlinear
perfect single-error-correcting ternary code of length 13 that contains the
zero vector.
(ii) Find the weight distribution of the code.
(iii) Verify whether the supports of codewords of weight 3 support a 2-design.
36
Definition 9.10 Given a binary code C of length n, the extended code Ĉ
is defined as a code of length n + 1 obtained by adding to each codeword
x = (x1 , . . . , xn ) ∈ C a new coordinate xn+1 equal to the overall parity check,
that is, xn+1 = 0 if the weight of x is even, and xn+1 = 1 if the weight of x
is odd.
Clearly, all vectors of the extended code are of even weight. If C is a linear
[n, k] code with minimum distance d, the extended code Ĉ is a linear [n+1, k]
code with minimum distance d, ˆ with d=d
ˆ if d is even, and dˆ = d + 1 if d is
odd.
If C is a binary perfect code, the extended code Ĉ also yields a design.
Theorem 9.11 (Assmus and Mattson [2]). If C is a perfect binary code
of length n and minimum weight d = 2e + 1 containing the zero vector, the
supports of the codewords of weight 2e + 2 in the extended code Ĉ form an
(e + 2)-(n + 1, 2e + 2, 1) design.
and
w(c ∗ u) ≤ e + 2,
hence
i
e+1+ ≤ w(c ∗ u) ≤ e + 2.
2
Thus, i = 2, w(c) = 2e + 2, and the support of û is covered by the support of
ĉ ∈ C, where w(ĉ) = 2e + 2 and ĉ is obtained by extending c with an overall
parity check equal to zero.
Assume now that ûn+1=1. The shortened vector u is of weight e + 1, and
according to Theorem 9.1, the support of u is covered by the support of a
37
codeword c ∈ C of weight 2e + 1. The extended word ĉ is of weight 2e + 2
and has (n + 1)st coordinate equal to 1, and the support of ū is contained in
the support of c̄.
Corollary 9.12 The minimum weight vectors of the extended code of a bi-
nary perfect single-error-correcting code of length 2m − 1 containing the zero
vector support a 3-(2m , 4, 1) design.
Corollary 9.14 The minimum weight vectors in the extended Golay code
G24 support a 5-(24, 8, 1) design.
Exercise 9.17 Find the weight distribution of the dual code of the binary
Hamming code of length 2m − 1.
38
10 Perfect codes and data compression
The major use of error-correcting codes is, as their name suggests, for de-
tection and correction of random errors that may occur in the encoded data
during transmission or while the data is being stored on some memory device.
However, codes can also be used for data compression, a process that allows
for adding some noise to the data with the purpose of achieving a higher
transmission rate or saving memory space. In this application, perfect codes
have some advantages, as noted by Shannon in 1959 [26].
Suppose that some data of nature that can tolerate up to a certain degree
of noise is to be stored or transmitted, and the purpose is to save memory
space or increase the transmission speed, hence reduce the cost of storage or
transmission. A typical example is data being transmitted over a telephone
line, or other type of audio or visual data.
Let us assume that data is recorded in messages of length n over a finite
field GF (q) of order q. Assume further that C is a perfect [n, k, d = 2e + 1]
code over GF (q). Let y ∈ GF (q)n be an arbitrary data string of length n.
There exist a unique codeword x ∈ C such that x differs from y in at most
e positions. The message y is compressed to a string x̄=(xi1 , . . . , xik ) of k
information symbols of x, where i1 , . . . , ik are k linearly independent columns
of a generator matrix of C, and x̄ is then transmitted over a noiseless channel
or stored instead of y. At the receiving end, x̄ is decompressed to the whole
codeword x of length n, and x is being tilized instead of y. Assuming that
no errors have occurred during transmission or while x̄ was being stored, this
procedure can alter up to e components of the original data y. For many
applications, such a loss of precision may be tolerable.
Example 10.2 Using the binary perfect Golay code G23 , any message of 23
bits is compressed to a shorter message of 12 bits only, and the decompressed
message differs from the original data in at most 3 out of 23 bits.
Exercise 10.3 Use the binary Hamming code of length 7 to compress and
decompress the data message (1, 1, 0, 0, 0, 1, 1).
39
11 MacWillimas identities
In this section, we discuss a relation between the weight distribution of a
linear code and that of its dual code, discovered by F. J. MacWilliams [13],
[14].
The weight enumerator of a code C of length n is a polynomial
n
ai xi ,
X
A(x) =
i=0
Proof. There are several identities equivalent to (16), all known as MacWilliams
identities. We will prove one such identity, from which (16) will follow.
Comparing the coefficients of xi in the left and right-hand sides of equa-
tion (16), we can find a formula expressing b0 , . . . , bn in terms of a0 , . . . , an .
For this purpose, we expand (16) as follows:
n n
bi xi = q −k aj (1 − x)j (1 + (q − 1)x)n−j =
X X
i=0 j=0
j n−j
n X
! !
j n−j
−k
(−1)s xs (q − 1)t xt .
X X
q aj
j=0 s=0 t=0 s t
Let s + t = i. Then
n n n−j+s
n X
! !
i j n−j
−k
(−1)s (q − 1)i−s xi =
X X X
bi x = q aj
i=0 j=0 s=0 i=s s i−s
n Xn Xn
! !
j n−j
−k
(−1)s (q − 1)i−s xi =
X
q aj
j=0 s=0 i=0 s i−s
n n n
! !
i j n−j
−k
(−1)s (q − 1)i−s .
X X X
q x aj
i=0 j=0 s=0 s i−s
40
Note that extending the summation from i = s to n − j + s, to i = 0 to n
is possible because all additional terms are equal to 0. After this, we can
change the order of summation. Comparing the coefficients of xi , we have
n n
! !
j n−j
−k
(−1)s (q − 1)i−s .
X X
bi = q aj
j=0 s=0 s i−s
i=0 j=0
i=0 j=0
which implies
n−m m
! !
n−i n−j
= q n−k−m
X X
bi aj . (17)
i=0 m j=0 n−m
(C ∩ Fs )⊥ = C ⊥ ⊕ Fs ⊥ = C ⊥ ⊕ Ft ,
U ⊕ V = {αu + βv | u ∈ U, v ∈ V ; α, β ∈ GF (q).}
41
Let ds denote the dimension of C ∩Fs , and let dt be the dimension of C ⊥ ∩Ft .
Since (C ⊥ ⊕ Ft )⊥ = C ∩ Fs , the dimension of C ⊥ ⊕ Ft is equal to n − ds . On
the other hand,
thus
n − ds = (n − k) + (n − m) − dt ,
or
dt = ds + n − k − m.
Let us count in two was the ordered pairs (s, v), where s is an m-subset of
N = {1, . . . , n}, and v ∈ C ∩ Fs . For any given s, there are q ds such pairs.
The total number of pairs is
q ds .
X
s⊂N
q dt = q ds +n−k−m = q n−k−m q ds ,
X X X
42
where S(r, v) is a Stirling number of the second kind,
v
!
1 X v r
S(r, v) = (−1)v−i i.
v! i=1 i
Exercise 11.4 Find the weight enumerators of the binary Hamming codes
of length 3 and 7 and their dual codes, and then use (16) to verify your
results.
Exercise 11.5 Find the weight distribution of the dual code of the binary
Hamming code H4 (2) of length 15 by a direct computation, and then use
(16) to find the weight distribution of H4 (2).
Exercise 11.6 Use the results from 11.4 and 11.5 to make a conjecture for
the weight enumerator of the dual code of the binary Hamming code of length
n = 2m − 1, for any m ≥ 2.
Proof. Suppose the contrary, that is, the rank of G′ is smaller than k. Then
there exists a nonzero linear combination of the rows of G′ which is equal to
the zero vector of length n − d + 1. The linear combination with the same
coefficients of the corresponding rows of G is a nonzero vector of weight at
most d − 1, a contradiction.
43
Lemma 12.2 Let C be a q-ary [n, k, d] code. Let u0 be the largest integer
such that
u0
u0 − ⌈ ⌉ < d,
q−1
where ⌈x⌉ denotes the smallest integer number greater than or equal to x. If
a, b ∈ C are codewords having the same weight u ≤ u0 and share the same
support, then a = βb for some β ∈ GF (q), β 6= 0.
There exists a nonzero element β ∈ GF (q) which occurs at least ⌈u/(q − 1)⌉
times in M. It follows that the weight of a − βb is at most u − ⌈u/(q − 1)⌉.
Since u ≤ u0 , we have
u
u−⌈ ⌉ < d.
q−1
Thus, u − ⌈u/(q − 1)⌉ = 0, and a = βb.
Theorem 12.3 (Assmus and Mattson [3]). Let C be a linear [n, k, d] code,
and let d¯ be the minimum distance of the dual code C ⊥ . Denote by u0 the
largest integer such that u0 −⌈u0 /(q−1)⌉ < d, and let w0 be the largest integer
satisfying w0 − ⌈w0 /(q − 1)⌉ < d. ¯ If q = 2, we set u0 = w0 = n. Suppose
that the number s of distinct nonzero weights in C ⊥ which are smaller than
or equal to n − t, satisfies s ≤ d − t. Then, for each weight u, such that
d ≤ u ≤ u0 the supports of codewords of weight u in C, yield a t-design.
Furthermore, for each weight w such that d¯ ≤ w ≤ min{n − t, w0 }, the
supports of codewords of weight w in the dual code C ⊥ , also yield a t-design.
44
Since the dimension of (C0⊥ )′ is greater than or equal to n − k − t, we have
(C0⊥ )′ = (C ′ )⊥ .
Let wi, 1 ≤ i ≤ r be all distinct nonzero weights in C ⊥ which are smaller
than or equal to n − t. These are also the only possible nonzero weights of
(C0⊥ )′ . Since the minimum weight of C ′ is greater than or equal to d − t,
we know the first d − t coefficients of the weight enumerator of C ′ . The
number d − t is greater than or equal to the number of nonzero coefficients
of the weight enumerator of (C0⊥ )′ . The MacWilliams identities (17) give a
system of independent linear equations with a unique solution which does
not depend on the choice of T , but only on its size t. Thus, the weight
distribution of (C0⊥ )′ is independent of the choice of T . Since C ′ = ((C0⊥ )′ )⊥ ,
the same holds for the weight distribution of C ′ . In particular, the number
of codewords of weight d − t in C ′ does not depend on the choice of T , hence
every t-subset of the set of coordinate indices is contained in the supports of
a constant number of codewords of minimum weight d. Thus, the supports
of minimum weight vectors in C form a t-design.
Suppose now that w is an integer in the range d¯ ≤ w ≤ min{n − t, w0 },
and let D be the collection of supports of all codewords of weight w in C ⊥ .
We consider the family D ′ consisting of the complements of the sets in D. If
T is a t-subset of X = {1, . . . , n}, the number of bocks of D ′ containing T
is equal to the number of codewords of weight w in (C0⊥ )′ divided by q − 1
according to Lemma 12.2, and this number does not depend on the choice of
T . Thus, D ′ is a t-design, and consequently, D is also a t-design.
We now prove that the supports of codewords of C of any weight u,
d ≤ u ≤ u0 , form a t-design. We already know that this is true for u = d. We
prove the statement by induction. Suppose that the supports of all codewords
of C of any weight u′ such that d ≤ u′ < u form a t-design, and let D be the
collection of supports of all codewords of C of weight u. By Lemma 12.2, the
number of blocks of D containing a given t-subset T ⊂ {1, . . . , n} is equal to
the number of codewords of weight u − t in C ′ divided by q − 1. The total
number of words of weight u −t in C ′ is independent of the choice of T . Thus
D is a t-design.
Example 12.4 The extended binary Golay code G24 is a self-dual [24, 12, 8]
code with nonzero weights 8, 12, 16, and 24. There are three nonzero weights
smaller than n = 24, and d − 5 = 8 − 5 = 3. Hence, the supports of any
45
given weight form a 5-design. The weight distribution of the code is
It follows from Theorem 12.3 that the codewords of weight 8 form a 5-(24, 8, 1)
design (or a Steiner system S(5, 8, 24)), while the codewords of weight 12 form
a 5-(24, 12, 48) design. The design supported by codewords of weight 16 is a
5-(24, 16, 78) design having as blocks the complements of blocks of the design
supported by codewords of weight 8.
Example 12.5 The extended ternary Golay code G12 is a self-dual [12, 6, 6]
code. The nonzero weights are 6, 9, and 12, hence the Assmus-Mattson
Theorem 12.3 applies for t = 5. The weight distribution is
Exercise 12.7 Prove that the code from Exercise 12.6 is equivalent to the
extended code of the binary Hamming code of length 7.
Exercise 12.8 Prove that the codewords of any nonzero weight smaller than
2m −1 of the binary Hamming code of length 2m −1 form a 2-design. In partic-
ular, the minimum weight codewords support a Steiner system S(2, 3, 2m −1).
46
Exercise 12.9 Prove that the codewords of any nonzero weight smaller
than 2m of the extended binary Hamming code of length 2m form a 3-
design. In particular, the minimum weight codewords support a Steiner
system S(3, 4, 2m).
Exercise 12.10 Prove that for any prime power q ≥ 2, and any m ≥ 2, the
codewords of any nonzero weight smaller than (q m − 1)/(q − 1) of the q-ary
Hamming code of length (q m − 1)/(q − 1) form a 2-design.
Theorem 13.1 Let C be a self-dual [n, n/2, d] code over GF (q), where q =
2, 3, or 4.
(i) If q = 2 and C is singly-even, then d ≤ 2⌊n/8⌋ + 2.
(ii) If q = 2 and C is doubly-even, then d ≤ 4⌊n/24⌋ + 4.
(iii) If q = 3, then d ≤ 3⌊n/12⌋ + 3.
(iv) If q = 4 and C is Hermitian self-dual, then d ≤ 2⌊n/6⌋ + 2.
47
A self-dual code whose minimum distance meets the corresponding upper
bound in 13.1 is called extremal.
The extended binary and ternary Golay codes, as well as the extended
[8, 4, 4] Hamming code, are all extremal.
Exercise 13.2 Verify that the [6, 3] code over GF (4) = {0, 1, α, α2} with a
generator matrix
1 0 0 1 1 1
G= 0 1 0 1
α α2
0 0 1 1 α2 α
is Hermitian self-dual and extremal.
Theorem 13.3 An extremal self-dual [n, n/2] code yields t-designs, where:
(a) if q = 2 and C is singly-even, then t = 3 if n ≡ 0 (mod 8), t = 2 if
n ≡ 2 (mod 8), and t = 1 if n ≡ 4 (mod 8);
(b) if q = 2 and C is doubly-even, then t = 5, 3, or 1 according to n ≡ 0, 8,
or 16 (mod 24);
(c) t = 5 if q = 3 and n ≡ 0 (mod 12);
(d) t = 5 if q = 4 and n > 6 and n ≡ 0 (mod 6).
48
Table 13.5 Some 5-Designs derived from self-dual codes
49
14 Pless symmetry codes
The symmetry codes are a class of ternary self-dual codes introduced by Pless
[21]. The smallest symmetry code is the extended ternary Golay code, and
a few more symmetry codes of larger length also yield 5-designs.
Let p > 2 be a prime, and let χ be the Legendre symbol, defined as follows:
0 if i = 0,
χ(i) = 1 if i is a quadratic residue (mod p), (20)
−1 if i is not a quadratic residue (mod p).
Since half of the integers between 1 and p − 1 are quadratic residues, and the
other half are non-residues, we have
p−1
X
χ(i) = 0.
i=0
50
Let Q = (qij ) be the p × p matrix qi,j = χ(j − i) for 0 ≤ i, j ≤ p − 1.
Using Lemma 22, it is easy to prove the following.
Given an odd prime p ≡ 2 (mod 3), the symmetry code C(p) [21] is defined
as the ternary code with generator matrix
0 1 ··· 1
χ(−1)
G= Ip+1 .. .
. Q
χ(−1)
Exercise 14.6 Show that the symmetry code C(5) is equivalent to the ex-
tended ternary Golay code.
The minimum distances of C(11), C(17), C(23), and C(29) are 9, 12, 15,
and 18, respectively. Thus, all these codes are extremal and yield 5-designs.
15 Quadratic-residue codes
Let p > 2 be a prime, and let χ be the Legendre symbol (22). Let Q =
(qij )p×p , where qij = χ(j − i).
Lemma 15.1 (
T Q if p ≡ 1 (mod 4),
Q = (23)
−Q if p ≡ 3 (mod 4).
51
Proof. We have
Lemma 15.2
p−1 p−1
(
T 4
I + 4
J − M if p ≡ 1 (mod 4),
MM = p+1 p−3 (25)
4
I + 4
J if p ≡ 3 (mod 4).
52
A 2-(v, k, λ) design having equal number of points and blocks, v = b, is
called symmetric. If D is a symmetric design, every point is contained in k
blocks, every two blocks share exactly λ points, and k(k − 1) = λ(v − 1).
Thus, the incidence matrix A of a symmetric 2-(v, k, λ) design satisfies the
equations
AJ = JA = kJ, AAT = AT A = (k − λ)I + λJ. (26)
Lemma 15.4 Let p be a prime and let A be the incidence matrix of a sym-
metric 2-(v, k, λ) design such that p | k −λ, but p2 6 |k −λ and p 6 |k. Then the
rank of A over GF (q), rankq (A)), where q = ps , s ≥ 1, is equal to (v + 1)/2.
Proof. The determinant of AAT can be found easily by using (26) and
applying elementary row operations (adding multiples of rows to other rows):
BAC = diag(d1 , d2 , . . . , dv )
53
Note that k(k − 1) = λ(v − 1) implies
and since p 6 |k, we have p 6 |λ, hence p|(v − k), and p|(v − 2k + λ = (v − k) −
(k − λ)). Thus, the weight of every row of J − A, as well as the product of
every two rows of J − A, is divisible by p, hence the row space of J − A over
GF (p) is a self-orthogonal code, hence rankp (J − A) ≤ v/2. Equation (27)
implies that k − λ is a square if v is even. Thus, by the assumptions of the
theorem, v is odd and
v−1
rankp (J − A) ≤ .
2
Since p 6 |k, the all-one vector 1̄ is contained in the row (and column) space
of A over GF (q), and since p 6 |v, the vector 1̄ is not contained in the row (or
column) space of J − A over GF (q). Thus
v+1
rankp (A) = rankp (J − A) + 1 ≤ ,
2
which completes the proof.
Corollary 15.5 (Assmus and Maher [1]). Let A be the incidence matrix
of a symmetric 2-(v, k, λ) design and let p be a prime such that p | k − λ,
p2 6 |k − λ, p 6 |k, and −λ is a square in GF (p). The code C over GF (q) of
length (v + 1)/2 with a generator
√ matrix obtained by adding to A a constant
v+1
column with entries equal to −λ, is a self-dual (v + 1, 2 ) code.
54
Exercise 15.8 Prove Theorem 15.7.
55
16 Cyclic codes
A code C ⊆ GF (q)n is cyclic if the permutation (1, 2, . . . , n) is an automor-
phism of the code. Thus, for every vector (a0 , a1 , . . . , an−1 ) ∈ C, we have
also (an−1 , a0 , . . . , an−2 ) ∈ C. Consequently, along with every codeword, the
code contains all of its cyclic shifts.
A cyclic code does not have to be linear, but an elegant algebraic theory
has been developed for linear cyclic codes. If a = (a0 , . . . , an−1 ) is a vector
of a cyclic code C ⊆ GF (q)n , we can associate with a the polynomial
56
hence r(x) = a(x) − b(x)g(x) ∈ C. The choice of g(x) now implies that
r(x) = 0.
Note that if g1 (x) is another monic polynomial of minimum degree in C
then g1 (x) = b(x)g(x) implies deg(b(x)) = 0 and b(x) = 1, thus, g1 (x) = g(x),
and the polynomial g(x) is the unique monic polynomial of minimum degree
in C.
The polynomial g(x) from Theorem 16.2 is called the generator polynomial
of the cyclic code C. By definition, the zero polynomial is the generator
polynomial of the cyclic (n, 0] code consisting of the zero vector only. The
constant 1 is the generator polynomial of the whole space, the [n, n] code
Rn = GF (q)n .
Theorem 16.3 If g(x) is the generator polynomial of a cyclic [n, k] code
C ⊆ Rn with k ≥ 1, then
(i) The degree of g(x) is equal to n−k, and if g(x) = g0 +g1 x+. . . gn−k−1xn−k−1 +
xn−k , the following circulant k × n matrix G is a generator matrix of C:
g0 g1 . . . gn−k−1 1 0 ... 0
0 g0 . . . 0 gn−k−1 1 ... 0
G= .. . (28)
.
0 0 ... g0 ... ... 1
(ii) g(x) divides xn − 1.
Proof. (i) Since |C| = q k , it follows from Theorem 16.2 that the degree
of g(x) is equal to n − k. Thus, a generator matrix must have k linearly
independent rows, all being vectors from C, and the matrix (28) has these
properties.
(ii) We can divide xn − 1 by g(x) in the ring F [x]:
xn − 1 = h(x)g(x) + r(x), (29)
where deg(r(x)) < deg(g(x)). Equation (29) implies that in the ring Rn we
have
r(x) = −b(x)g(x) ∈ C,
hence r(x) must be the zero polynomial and xn − 1 = h(x)g(x).
57
Theorem 16.4 If h(x) = h0 +h1 x+. . . hk−1 xk−1 +xk is the check polynomial
of a cyclic [n, k] code then the following (n − k) × n circulant matrix H,
1 hk−1 . . . h0 0 . . . 0
0 1 . . . h1 h0 . . . 0
H= .. , (30)
.
0 0 ... 1 ... h0
is a parity check matrix of C.
Exercise 16.5 Prove Theorem 16.4.
If a(x) is a polynomial of degree m, the polynomial xm a( x1 ) is called the
reciprocal of a(x).
Exercise 16.6 Prove that if h(x) is the check polynomial of a cyclic code C
then the reciprocal polynomial of h(x) is a generator polynomial of the dual
code C ⊥ .
Exercise 16.7 Find generator polynomials for all binary cyclic codes of
length 7.
Exercise 16.8 Find generator polynomials for all ternary cyclic codes of
length 11.
17 Factoring xn − 1
Finding cyclic codes of length n over a finite field GF (q) requires factoring
xn − 1 in the ring of polynomials Fq [x] over GF (q).
Lemma 17.1 If f (x) ∈ Fps [x] then
s s
f (xp ) = (f (x))p .
Exercise 17.2 Prove Lemma 17.1.
If β ∈ GF (q), where q = ps , s ≥ 1, and p is a prime, then
β q = β,
hence β is a root of the polynomial xq − x ∈ Fp [x].
The minimal polynomial m(x) = mβ (x) over GF (p) of an element β ∈
GF (ps ) is defined as a monic polynomial of smallest degree with coefficients
in GF (p) having β as a root.
58
Lemma 17.3 The minimal polynomial m(x) = mβ (x) of an element β ∈
GF (ps ) has the following properties.
(a) m(x) is irreducible over Fp [x].
(b) m(x) divides every polynomial in Fp [x] having β as a root.
(c) m(x) is unique.
s
(d) m(x) divides xp − x.
(e) The degree of m(x) does not exceed s.
Exercise 17.4 Prove Lemma 17.3.
Corollary 17.5
s
xp − x =
Y
mβ (x). (31)
β∈GF (ps )
Exercise 17.6 Let q be a prime power. How many distinct cyclic codes of
length n = q − 1 over GF (q) are there?
Exercise 17.7 How many distinct cyclic codes of length 40 over GF (41) of
dimension 35 are there?
The multiplicative group of GF (q) is a cyclic group. Any generator of this
group is called a primitive element of GF (q). Thus, β ∈ GF (q) is primitive
if β i 6= 1 for 0 < i < q − 1, and
GF (q) = {0, β, β 2, . . . , β q−2 , β q−1 = 1}.
Exercise 17.8 List the primitive elements of GF (17).
An element β ∈ GF (q) is a primitive nth root of unity if β n = 1 and β i 6= 1
for 0 < i < n. It follows that n divides q − 1, and n = q − 1 if and only if
β is a primitive element of GF (q). If β is a primitive element of GF (q) then
γ = β d is a primitive nth root of unity with n = (q − 1)/d.
Given a prime power q and a positive integer n relatively prime to q, the
order of q modulo n is defined as the smallest positive integer d such that
q d ≡ 1 (mod n).
Let s be an integer with 0 ≤ s < n. The q-cyclotomic coset of s modulo
n is the set
Cs = {s, sq, . . . , sq d−1 (mod n)},
where d is the smallest positive integer such that sq d ≡ s (mod n). Note
that the order of q modulo n is equal to the size of the q-cylotomic coset of
1.
59
Lemma 17.9 Let n be a positive integer such that gcd(n, q) = 1. Let t be
the order of q modulo n, and let β be a primitive nth root of unity in GF (q t ).
For every integer s with 0 ≤ s < n, the minimal polynomial of β s over GF (q)
is given by
(x − β j ).
Y
mβ s (x) =
j∈Cs
xn − 1 =
Y
mβ s (x),
s
Exercise 17.16 How many distinct cyclic binary linear codes of length 17
are there? List the dimensions of these codes.
Exercise 17.17 Give the generator polynomial g(x), check polynomial h(x),
and the parity check-matrix matrix associated with h(x), of a linear binary
cyclic code length 15 which is equivalent to the Hamming code of length 15.
60
Exercise 17.18 (i) Find a generator polynomial for a cyclic ternary [11, 6]
code.
(ii) Show that a cyclic ternary [11, 6] code has minimum distance 5 (conse-
quently, it is equivalent to the perfect ternary Golay code).
Exercise 17.22 Determine the number of cyclic ternary codes of length 13.
Exercise 17.23 Give the generator polynomial of a cyclic ternary [13, 10]
code.
Theorem 18.1 Let q be a prime power and n be a positive integer such that
gcd(n, q) = 1, and let C be a linear cyclic code of length n over GF (q). There
exists an idempotent e(x) ∈ C such that
Proof. If C is the code of dimension zero then e(x) is the zero polynomial.
If C = Rn is the whole space, we can take e(x) = 1. Suppose that C is a
code of dimension k, 1 < k < n. The generator polynomial g(x) and check
polynomial h(x) of C are both nonzero polynomials such that g(x)h(x) =
xn − 1. Since all roots of xn − 1 in Rn are distinct (by Corollary 17.12), it
follows that gcd(g(x), h(x)) = 1. By the Euclidean algorithm, there exist
polynomials a(x), b(x) ∈ Fq [x] such that
61
in Fq [x]. Consider the polynomial e(x) = a(x)g(x) ∈ C. Multiplying both
sides of (32) by e(x) gives
e2 (x) = a2 (x)g 2 (x) + a(x)g(x)b(x)h(x) = a(x)g(x) = e(x). (33)
Since
a(x)g(x)b(x)h(x) = (a(x)b(x))(g(x)h(x)) = 0
in Rn , e(x) = a(x)g(x) is an idempotent in Rn . Since e(x) is a multiple of
g(x) in Rn , it follows that e(x) ∈ C and < e(x) >⊆ C.
If c(x) ∈ C then c(x) = f (x)g(x) for some f (x) ∈ Rn . Multiplying both
sides of (32) by c(x) = f (x)g(x) gives
f (x)g(x)a(x)g(x) + f (x)g(x)b(x)h(x) = c(x),
and since f (x)g(x)b(x)h(x) = 0 in Rn , we have
c(x) = (f (x)g(x))e(x) ∈< e(x) > .
Thus, C ⊆< e(x) >, and consequently, C =< e(x) >.
An idempotent e(x) of a cyclic code C such that C =< e(x) > is called
an idempotent generator of C.
Exercise 18.2 Prove that a cyclic code has only one idempotent generator.
Exercise 18.3 Find an idempotent generator for the ternary Golay code of
length 11.
62
Theorem 18.5 If C is a cyclic code with an idempotent generator e(x), the
generator polynomial of C is g(x) = gcd(e(x), xn − 1).
Exercise 18.6 Prove Theorem 18.5.
Example 18.7 The generator polynomial of the binary cyclic code of length
7 with idempotent generator x3 + x6 + x5 is
gcd(x3 +x6 +x5 , x7 −1) = gcd(x3 (1+x2 +x3 ), (x−1)(x3 +x+1)(x3 +x2 +1) = x3 +x2 +1.
Idempotent generators are used in the traditional definition of binary quadratic
residue ( QR ) codes. Let n ≡ ±1 (mod 8) be a prime. Then 2 is a quadratic
residue modulo n. We denote by Q the set of quadratic residues, and by N
the set of quadratic nonresidue modulo n:
Q = { i | 1 ≤ i ≤ n−1, i ≡ a2 (mod n), a ∈ Z}, N = { j | 1 < j ≤ n−1, j ∈
/ Q}.
The binary cyclic codes CQ , CN having as idempotent generators the poly-
nomials
xi , eN = xj
X X
eQ =
i∈Q j∈N
63
References
[1] E.F. Assmus, Jr., and D. P. Maher, Nonexistence proofs for projective
designs, Amer. Math. Monthly, 85 (1978), 110-12.
[2] E.F. Assmus, Jr., H.F. Mattson, Jr., Coding and Combinatorics, SIAM
Review, 16 (1974), 349-388.
[3] E. F. Assmus, Jr., and H. F. Mattson, Jr., New 5-designs, J. Combin.
Theory, 6, (1969), 122-151.
[4] P. Delsarte and J. -M. Goethals, Unrestricted codes with the Golay
parameters are unique, Discrete Math., 12 (1975), 211-224.
[5] M. J. E. Golay, Notes on digital coding, Proc. IEEE, 37 (1949), 657.
[6] R. W. Hamming, Error detecting and error correcting codes, Bell Syst.
Tech. J., 29 (1950), 147-160.
[7] O. Heden, A survey of perfect codes, Advances in Mathematics of Com-
munications, 2 (2008), 223-247.
[8] F. Hergert, The equivalence classes of the Vasil’ev codes of length 15,
Lecture Notes in Math., 969 (1982), 176-186.
[9] B. Lindström, On group and nongroup perfect codes in q symbols, Math.
Scand., 25 (1969), 149-158.
[10] J.H. van Lint, On the nonexistence of perfect 2- and 3-Hamming-error-
correcting codes over GF (q), Information and Control, 16 (1970), 396-
401.
[11] J.H. van Lint, A survey of perfect codes, Rocky Mountain J. Math. 5
(1975), 199-224.
[12] J.H. van Lint, Introduction to Coding Theory, Springer-Verlag, Berlin,
1982.
[13] F. J. MacWilliams, Combinatorial problems of elementary group theory,
PhD Thesis, Department of Math., Harvard University, May 1962.
[14] F. J. MacWilliams, A theorem on the distribution of weights in a sys-
tematic code, Bell Syst. Tech. J., 42 (1963), 79-94.
64
[15] F.J. MacWilliams, A.M. Odlyzko, N.J.A. Sloane, and H.N. Ward, Self-
dual codes over GF (4), J. Combin. Theory A 25 (1978), 288-318.
[16] C.L. Mallows and N.J.A. Sloane, An upper bound for self-dual codes,
Information and Control 22 (1973), 188-200.
[19] Patric R.J. Östergard, Olli Pottonen, The perfect binary one-error-
correcting codes of length 15: Part I - classification, arXiv:0806.2513v1
[cs.IT], 16 June 2008.
[21] V. Pless, Symmetry codes over GF (3) and new five-designs, J. Combin.
Theory 5 (1968), 215-228.
[26] C. Shannon, Coding theorems for a discrete source with a fidelity crite-
rion, IRE Nat. Conv. Rec., Part 4, (1959), 142-163.
65
[29] J. L. Vasil’ev On nongroup close-packed codes (in Russian), Probl.
Kibernet., 8 (1962), 337-339, translated in Probleme der Kibernetik 8
(1965), 375-378.
[30] V.A. Zinoviev, V.K. Leontiev, The nonexistence of perfect codes over
Galois fields, Problems of Control and Information 2 (1973), 123-132.
66
Index
automorphism group, 18 maximum likelihood, 13
syndrome, 20
bound design
Hamming, 24 t-(v, k, λ), 32
Singleton, 17 simple, 32
sphere-packing, 24 symmetric, 53
code, 12 equivalent, 18
automorphism, 18 monomially, 18
block, 12 permutation, 18
cyclic, 56 error, 12
doubly-even, 30, 47
dual, 15 generator matrix, 15
even, 30 standard, 18
extended, 37 generator polynomial, 57
Hamming, 23, 26 Golay
linear, 15 binary
maximum distance separable, 18 extended, 30
MDS, 18
Hamming distance, 12
perfect, 24
Hermitian inner product, 47
quadratic residue, 63
quadratic-residue, 54 idempotent, 61
extended, 54 generator, 62
repetition, 24 information set, 18
self-dual, 29
extremal, 48 Legendre symbol, 50
self-orthogonal, 29
MacWilliams identities, 40
singly-even, 47
minimal polynomial, 58
size of, 24
minimum distance, 12
ternary Golay, 33
monic polynomial, 56
Vasil’ev, 28
coset, 20 overall parity check, 37
leader, 20
cyclotomic coset, 59 parity check matrix, 15
primitive n-th root of unity, 59
decoding, 12 primitive element, 59
67
reciprocal polynomial, 58
representative, 20
Singleton Bound, 17
sphere, 12
sphere-packing bound, 24
Steiner system, 32
Steiner triple system, 36
support, 32
symmetry code, 51
syndrome, 20, 21, 26
decoding, 22
syndrome decoding, 26
weight, 16
minimum, 16
weight distribution, 31
weight enumerator, 40
68