Skip to main content
Logo image

Section 22.2 Polynomial Codes

With knowledge of polynomial rings and finite fields, it is now possible to derive more sophisticated codes than those of Chapter 8. First let us recall that an (n,k)-block code consists of a one-to-one encoding function E:Z2kZ2n and a decoding function D:Z2nZ2k. The code is error-correcting if D is onto. A code is a linear code if it is the null space of a matrix HMk×n(Z2).
We are interested in a class of codes known as cyclic codes. Let ϕ:Z2kZ2n be a binary (n,k)-block code. Then ϕ is a cyclic code if for every codeword (a1,a2,,an), the cyclically shifted n-tuple (an,a1,a2,,an1) is also a codeword. Cyclic codes are particularly easy to implement on a computer using shift registers [2, 3].

Example 22.14.

Consider the (6,3)-linear codes generated by the two matrices
G1=(100010001100010001)andG2=(100110111111011001).
Messages in the first code are encoded as follows:
(000)(000000)(100)(100100)(001)(001001)(101)(101101)(010)(010010)(110)(110110)(011)(011011)(111)(111111).
It is easy to see that the codewords form a cyclic code. In the second code, 3-tuples are encoded in the following manner:
(000)(000000)(100)(111100)(001)(001111)(101)(110011)(010)(011110)(110)(100010)(011)(010001)(111)(101101).
This code cannot be cyclic, since (101101) is a codeword but (011011) is not a codeword.

Subsection Polynomial Codes

We would like to find an easy method of obtaining cyclic linear codes. To accomplish this, we can use our knowledge of finite fields and polynomial rings over Z2. Any binary n-tuple can be interpreted as a polynomial in Z2[x]. Stated another way, the n-tuple (a0,a1,,an1) corresponds to the polynomial
f(x)=a0+a1x++an1xn1,
where the degree of f(x) is at most n1. For example, the polynomial corresponding to the 5-tuple (10011) is
1+0x+0x2+1x3+1x4=1+x3+x4.
Conversely, with any polynomial f(x)Z2[x] with degf(x)<n we can associate a binary n-tuple. The polynomial x+x2+x4 corresponds to the 5-tuple (01101).
Let us fix a nonconstant polynomial g(x) in Z2[x] of degree nk. We can define an (n,k)-code C in the following manner. If (a0,,ak1) is a k-tuple to be encoded, then f(x)=a0+a1x++ak1xk1 is the corresponding polynomial in Z2[x]. To encode f(x), we multiply by g(x). The codewords in C are all those polynomials in Z2[x] of degree less than n that are divisible by g(x). Codes obtained in this manner are called polynomial codes.

Example 22.15.

If we let g(x)=1+x3, we can define a (6,3)-code C as follows. To encode a 3-tuple (a0,a1,a2), we multiply the corresponding polynomial f(x)=a0+a1x+a2x2 by 1+x3. We are defining a map ϕ:Z23Z26 by ϕ:f(x)g(x)f(x). It is easy to check that this map is a group homomorphism. In fact, if we regard Z2n as a vector space over Z2, ϕ is a linear transformation of vector spaces (see Exercise 20.5.15, Chapter 20). Let us compute the kernel of ϕ. Observe that ϕ(a0,a1,a2)=(000000) exactly when
0+0x+0x2+0x3+0x4+0x5=(1+x3)(a0+a1x+a2x2)=a0+a1x+a2x2+a0x3+a1x4+a2x5.
Since the polynomials over a field form an integral domain, a0+a1x+a2x2 must be the zero polynomial. Therefore, kerϕ={(000)} and ϕ is one-to-one.
To calculate a generator matrix for C, we merely need to examine the way the polynomials 1, x, and x2 are encoded:
(1+x3)1=1+x3(1+x3)x=x+x4(1+x3)x2=x2+x5.
We obtain the code corresponding to the generator matrix G1 in Example 22.14. The parity-check matrix for this code is
H=(100100010010001001).
Since the smallest weight of any nonzero codeword is 2, this code has the ability to detect all single errors.
Rings of polynomials have a great deal of structure; therefore, our immediate goal is to establish a link between polynomial codes and ring theory. Recall that xn1=(x1)(xn1++x+1). The factor ring
Rn=Z2[x]/xn1
can be considered to be the ring of polynomials of the form
f(t)=a0+a1t++an1tn1
that satisfy the condition tn=1. It is an easy exercise to show that Z2n and Rn are isomorphic as vector spaces. We will often identify elements in Z2n with elements in Z[x]/xn1. In this manner we can interpret a linear code as a subset of Z[x]/xn1.
The additional ring structure on polynomial codes is very powerful in describing cyclic codes. A cyclic shift of an n-tuple can be described by polynomial multiplication. If f(t)=a0+a1t++an1tn1 is a code polynomial in Rn, then
tf(t)=an1+a0t++an2tn1
is the cyclically shifted word obtained from multiplying f(t) by t. The following theorem gives a beautiful classification of cyclic codes in terms of the ideals of Rn.

Proof.

Let C be a linear cyclic code and suppose that f(t) is in C. Then tf(t) must also be in C. Consequently, tkf(t) is in C for all kN. Since C is a linear code, any linear combination of the codewords f(t),tf(t),t2f(t),,tn1f(t) is also a codeword; therefore, for every polynomial p(t), p(t)f(t) is in C. Hence, C is an ideal.
Conversely, let C be an ideal in Z2[x]/xn+1. Suppose that f(t)=a0+a1t++an1tn1 is a codeword in C. Then tf(t) is a codeword in C; that is, (a1,,an1,a0) is in C.
Theorem 22.16 tells us that knowing the ideals of Rn is equivalent to knowing the linear cyclic codes in Z2n. Fortunately, the ideals in Rn are easy to describe. The natural ring homomorphism ϕ:Z2[x]Rn defined by ϕ[f(x)]=f(t) is a surjective homomorphism. The kernel of ϕ is the ideal generated by xn1. By Theorem 16.34, every ideal C in Rn is of the form ϕ(I), where I is an ideal in Z2[x] that contains xn1. By Theorem 17.20, we know that every ideal I in Z2[x] is a principal ideal, since Z2 is a field. Therefore, I=g(x) for some unique monic polynomial in Z2[x]. Since xn1 is contained in I, it must be the case that g(x) divides xn1. Consequently, every ideal C in Rn is of the form
C=g(t)={f(t)g(t):f(t)Rn and g(x)(xn1) in Z2[x]}.
The unique monic polynomial of the smallest degree that generates C is called the minimal generator polynomial of C.

Example 22.17.

If we factor x71 into irreducible components, we have
x71=(1+x)(1+x+x3)(1+x2+x3).
We see that g(t)=(1+t+t3) generates an ideal C in R7. This code is a (7,4)-block code. As in Example 22.15, it is easy to calculate a generator matrix by examining what g(t) does to the polynomials 1, t, t2, and t3. A generator matrix for C is
G=(1000110001101011010100100001).
In general, we can determine a generator matrix for an (n,k)-code C by the manner in which the elements tk are encoded. Let xn1=g(x)h(x) in Z2[x]. If g(x)=g0+g1x++gnkxnk and h(x)=h0+h1x++hkxk, then the n×k matrix
G=(g000g1g00gnkgnk1g00gnkg100gnk)
is a generator matrix for the code C with generator polynomial g(t). The parity-check matrix for C is the (nk)×n matrix
H=(000hkh000hkh00hkh0000).
We will leave the details of the proof of the following proposition as an exercise.

Example 22.19.

x71=g(x)h(x)=(1+x+x3)(1+x+x2+x4).
Therefore, a parity-check matrix for this code is
H=(001011101011101011100).
To determine the error-detecting and error-correcting capabilities of a cyclic code, we need to know something about determinants. If α1,,αn are elements in a field F, then the n×n matrix
(111α1α2αnα12α22αn2α1n1α2n1αnn1)
is called the Vandermonde matrix. The determinant of this matrix is called the Vandermonde determinant. We will need the following lemma in our investigation of cyclic codes.

Proof.

We will induct on n. If n=2, then the determinant is α2α1. Let us assume the result for n1 and consider the polynomial p(x) defined by
p(x)=det(1111α1α2αn1xα12α22αn12x2α1n1α2n1αn1n1xn1).
Expanding this determinant by cofactors on the last column, we see that p(x) is a polynomial of at most degree n1. Moreover, the roots of p(x) are α1,,αn1, since the substitution of any one of these elements in the last column will produce a column identical to the last column in the matrix. Remember that the determinant of a matrix is zero if it has two identical columns. Therefore,
p(x)=(xα1)(xα2)(xαn1)β,
where
β=(1)n+ndet(111α1α2αn1α12α22αn12α1n2α2n2αn1n2).
By our induction hypothesis,
β=(1)n+n1j<in1(αiαj).
If we let x=αn, the result now follows immediately.
The following theorem gives us an estimate on the error detection and correction capabilities for a particular generator polynomial.

Proof.

Suppose that
g(ωr)=g(ωr+1)==g(ωr+s1)=0.
Let f(x) be some polynomial in C with s or fewer nonzero coefficients. We can assume that
f(x)=ai0xi0+ai1xi1++ais1xis1
be some polynomial in C. It will suffice to show that all of the ai’s must be 0. Since
g(ωr)=g(ωr+1)==g(ωr+s1)=0
and g(x) divides f(x),
f(ωr)=f(ωr+1)==f(ωr+s1)=0.
Equivalently, we have the following system of equations:
ai0(ωr)i0+ai1(ωr)i1++ais1(ωr)is1=0ai0(ωr+1)i0+ai1(ωr+1)i2++ais1(ωr+1)is1=0ai0(ωr+s1)i0+ai1(ωr+s1)i1++ais1(ωr+s1)is1=0.
Therefore, (ai0,ai1,,ais1) is a solution to the homogeneous system of linear equations
(ωi0)rx0+(ωi1)rx1++(ωis1)rxn1=0(ωi0)r+1x0+(ωi1)r+1x1++(ωis1)r+1xn1=0(ωi0)r+s1x0+(ωi1)r+s1x1++(ωis1)r+s1xn1=0.
However, this system has a unique solution, since the determinant of the matrix
((ωi0)r(ωi1)r(ωis1)r(ωi0)r+1(ωi1)r+1(ωis1)r+1(ωi0)r+s1(ωi1)r+s1(ωis1)r+s1)
can be shown to be nonzero using Lemma 22.20 and the basic properties of determinants (Exercise). Therefore, this solution must be ai0=ai1==ais1=0.

Subsection BCH Codes

Some of the most important codes, discovered independently by A. Hocquenghem in 1959 and by R. C. Bose and D. V. Ray-Chaudhuri in 1960, are BCH codes. The European and transatlantic communication systems both use BCH codes. Information words to be encoded are of length 231, and a polynomial of degree 24 is used to generate the code. Since 231+24=255=281, we are dealing with a (255,231)-block code. This BCH code will detect six errors and has a failure rate of 1 in 16 million. One advantage of BCH codes is that efficient error correction algorithms exist for them.
The idea behind BCH codes is to choose a generator polynomial of smallest degree that has the largest error detection and error correction capabilities. Let d=2r+1 for some r0. Suppose that ω is a primitive nth root of unity over Z2, and let mi(x) be the minimal polynomial over Z2 of ωi. If
g(x)=lcm[m1(x),m2(x),,m2r(x)],
then the cyclic code g(t) in Rn is called the BCH code of length n and distance d. By Theorem 22.21, the minimum distance of C is at least d.

Proof.

(1) (2). If f(t) is in C, then g(x)f(x) in Z2[x]. Hence, for i=1,,2r, f(ωi)=0 since g(ωi)=0. Conversely, suppose that f(ωi)=0 for 1id. Then f(x) is divisible by each mi(x), since mi(x) is the minimal polynomial of ωi. Therefore, g(x)f(x) by the definition of g(x). Consequently, f(x) is a codeword.
(2) (3). Let f(t)=a0+a1t++an1vtn1 be in Rn. The corresponding n-tuple in Z2n is x=(a0a1an1)t. By (2),
Hx=(a0+a1ω++an1ωn1a0+a1ω2++an1(ω2)n1a0+a1ω2r++an1(ω2r)n1)=(f(ω)f(ω2)f(ω2r))=0
exactly when f(t) is in C. Thus, H is a parity-check matrix for C.
(3) (1). By (3), a code polynomial f(t)=a0+a1t++an1tn1 is in C exactly when f(ωi)=0 for i=1,,2r. The smallest such polynomial is g(t)=lcm[m1(t),,m2r(t)]. Therefore, C=g(t).

Example 22.23.

It is easy to verify that x151Z2[x] has a factorization
x151=(x+1)(x2+x+1)(x4+x+1)(x4+x3+1)(x4+x3+x2+x+1),
where each of the factors is an irreducible polynomial. Let ω be a root of 1+x+x4. The Galois field GF(24) is
{a0+a1ω+a2ω2+a3ω3:aiZ2 and 1+ω+ω4=0}.
By Example 22.8, ω is a primitive 15th root of unity. The minimal polynomial of ω is m1(x)=1+x+x4. It is easy to see that ω2 and ω4 are also roots of m1(x). The minimal polynomial of ω3 is m2(x)=1+x+x2+x3+x4. Therefore,
g(x)=m1(x)m2(x)=1+x4+x6+x7+x8
has roots ω, ω2, ω3, ω4. Since both m1(x) and m2(x) divide x151, the BCH code is a (15,7)-code. If x151=g(x)h(x), then h(x)=1+x4+x6+x7; therefore, a parity-check matrix for this code is
(000000011010001000000110100010000001101000100000011010001000000110100010000001101000100000011010001000000110100010000000).