Você está na página 1de 9

EE 387 October 29, 2012

Algebraic Error-Control Codes Handout #14


Sample Midterm Examination Solutions
1. Groups, rings, elds, vector spaces.
a. For the integers with the subtraction operator, which group axiom(s) are not satised?
b. The number of vectors in a vector space V is 125. What is the dimension of V ?
c. What is the smallest eld that contains both GF(27) and GF(81) as subelds?
d. List the subelds of GF(4
6
).
Solution
a. Subtraction is not associative. For example, (1 1) 1 = 1 ,= 1 = 1 (1 1).
Also, subtraction does not have a left identity element, since e a = a only when a = e/2.
b. Every nite-dimensional vector space is isomorphic to the n-tuples over the eld of scalars.
A nite vector space has a nite eld of scalars, GF(q), and therefore q
n
elements.
Since V has 125 = 5
3
elements, the scalar eld is GF(5) and the dimension of V is 3. (A less
satisfying but technically correct answer: scalars are GF(5
3
) and the dimension of V is 1.)
c. Since GF(27) = GF(3
3
) and GF(81) = GF(3
4
), these are elds of characteristic 3. Any
extension eld GF(3
m
) of GF(3
3
) has an exponent m that is a multiple of 3, and any extension
eld GF(3
m
) of GF(3
4
) has an exponent m that is a multiple of 4. If GF(3
m
) contains both
GF(3
3
) and GF(3
4
) then m is a multiple of both 3 and 4. The least common multiple is 12,
so the smallest common extension eld is GF(3
12
) = GF(531 441).
d. The trick is to realize that GF(4
6
) = GF(2
12
). The subelds of GF(2
12
) are GF(2
m
) where m
is a divisor of 12, namely, GF(2
12
), GF(2
6
), GF(2
4
), GF(2
3
), GF(2
2
), and GF(2). Note that
not every subeld of GF(4
6
) is of the form GF(4
m
); for example, GF(2
3
).
2. Arithmetic in GF(25). Let GF(25) be represented by polynomials of degree < 2 with arithmetic
modulo the polynomial p(x) = x
2
+ x + 2, which is prime over GF(5). Perform the following
calculations in GF(25).
a. Find (2x + 3) (3x + 4).
b. Find (3x + 1)
1
.
c. Find the multiplicative order of x + 1.
Solution
a. Arithmetic modulo x
2
+ x + 2 is based on the equation x
2
= x 2 = 4x + 3. Thus
(2x + 3) (3x + 4) = 6x
2
+ 17x + 12 = x
2
+ 2x + 2 = (4x + 3) + (2x + 2) = 6x + 5 = x.
Note arithmetic on polynomial coecients is performed modulo 5.
b. Reciprocals in elds of dimension 2 can be found by several methods. First we use the extended
Euclidean algorithm with inputs 3x+1 and p(x), which requires only one polynomial division.
x
2
+ x + 2 = (2x + 3)(3x + 1) + 4 .
Therefore modulo x
2
+ x + 2 over GF(5),
(2x + 3)(3x + 1) + 4 = 0 (2x + 3)(3x + 1) = 4 = 1
We conclude that (3x + 1)
1
= 2x + 3.
Another method is to use direct substitution. Because the dening polynomial is of degree 2,
all elements can be represented as polynomials over GF(5) of degree 1. Let (3x + 1)
1
=
ax + b, where a and b must be determined. Then
1 = (3x + 1)(ax + b) = 3ax
2
+ (a + 3b)x + b = 3a(4x + 3) + (a + 3b)x + b
= 12ax + 9a + (a + 3b)x + b = (13a + 3b)x + (9a + b) = (3a + 3b)x + (4a + b) .
By equating coecients on both sides of the expression, we obtain a system of linear equations.
3a + 3b = 0
4a + b = 1
Solving this system of equations yields a = 2 and b = 3. Thus (3x + 1)
1
= 2x + 3.
c. Hint: 24 = 2 12 = 3 8. The order of x + 1 is a divisor of 24, the order of the multiplicative
group of GF(25). Therefore we need consider only powers that are proper divisors of 24,
namely, 2, 3, 4, 6, 8, and 12.
(x + 1)
2
= x
2
+ 2x + 1 = (4x + 3) + (2x + 1) = x + 4
(x + 1)
3
= (x + 1)(x + 4) = x
2
+ 5x + 4 = (4x + 3) + 4 = 4x + 2
(x + 1)
4
= ((x + 1)
2
)
2
= (x + 4)
2
= x
2
+ 8x + 16 = (4x + 3) + (3x + 1) = 2x + 4
(x + 1)
6
= ((x + 1)
3
)
2
= (4x + 2)
2
= 16x
2
+ 16x + 4 = (4x + 3) + (x + 4) = 2
(x + 1)
8
= ((x + 1)
4
)
2
= (2x + 4)
2
= 4x
2
+ 16x + 16 = (16x + 12) + (x + 1) = 2x + 3
(x + 1)
12
= ((x + 1)
6
)
2
= 2
2
= 4
Since (x + 1)
d
,= 1 for every proper divisor d of 24, we conclude that the order of x + 1 is 24,
that is, x + 1 is a primitive element of GF(25).
3. Arithmetic in GF(2
20
). The polynomial x
20
+ x
3
+ 1 is primitive over GF(2). Therefore the
polynomial x is a primitive element of GF(2
20
).
a. Find x
1
as a polynomial in x.
b. Find x
3
. Hint: do not use the Euclidean algorithm.
c. Find

x
3
.
d. Find the multiplicative order of x + 1 .
e. In this eld, evaluate (x
12
+ x
7
+ 1)(x
12
+ x
5
). Hint: nd x
20
, x
21
, x
22
, x
23
, x
24
.
Page 2 of 9 EE 387, Autumn 2012
Solution
a. Since x
20
+ x
3
+ 1 = 0 ,
1 = x
3
+ x
20
= x(x
2
+ x
19
) .
Therefore x
1
= x
2
+ x
19
.
b. Since x
20
+ x
3
+ 1 = 0 ,
1 = x
3
+ x
20
= x
3
(1 + x
17
) .
Therefore x
3
= 1+x
17
. Alternatively, x
3
= x
2
x
1
= x
2
(x
2
+x
19
) = 1+x
17
. Alternatively,
use the Euclidean algorithm, which converges in one step.
c. Since x
20
+ x
3
+ 1 = 0 ,
x
3
= 1 + x
20
= (1 + x
10
)
2
.
Therefore

x
3
= 1 + x
10
.
d. There is no magic trick to nding the multiplicative order of x + 1. There are, however, two
approaches.
Find the least power n of x + 1 such that (x + 1)
n
= 1 mod (x
20
+ x
3
+ 1) .
First nd m such that x
m
= (x + 1) mod (x
20
+ x
3
+ 1); then the order n of x + 1 is
(2
20
1)/ gcd(m, (2
20
1)).
These computations could be run in parallel, but in the worst case it is necessary to evaluate
nearly all 2
20
1 powers.
e. First we use the relationship x
20
+ x
3
+ 1 = 0 to determine relevant powers of x:
i x
i
20 x
3
+ 1
21 x
4
+ x
22 x
5
+ x
2
23 x
6
+ x
3
24 x
7
+ x
4
Now we can evaluate the given expression:
(x
12
+ x
7
+ 1)(x
12
+ x
5
) = x
24
+ x
17
+ x
19
+ x
12
+ x
12
+ x
5
= (x
7
+ x
4
) + x
17
+ x
19
+ x
5
= x
19
+ x
17
+ x
7
+ x
5
+ x
4
4. Binary linear block code. Let c be the binary linear block code whose parity-check matrix H
consists of all columns of height 6 and weight 3:
H =

1 1 1 0 1 1 0 1 0 0 1 1 0 1 0 0 1 0 0 0
1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0
1 0 1 1 0 1 1 0 0 1 0 1 1 0 0 1 0 0 1 0
0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1
0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1

a. Find a codeword of minimum weight.


Sample Midterm Examination Solutions Page 3 of 9
b. Prove that all codewords have even parity.
c. Does c have a systematic parity-check matrix of the form [ I [ P
T
] ? Justify your answer.
Solution
a. The rightmost ten columns of H are the complements of the leftmost ten columns. So the
sum of the rst and last columns is the all-ones vector, as is the sum of the second and next
to last columns. The sum of the rst two and last two columns is zero, which corresponds
to the following weight 4 codeword: (1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1). Another
weight 4 codeword, which corresponds to a linear dependence of the rst six columns of H,
is (0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0).
b. All columns of H have odd parity, so the sum (exclusive-or) of an odd number of columns
has odd parity and is therefore nonzero. Every codeword selects a set of columns of H whose
sum is zero, so codewords must have an even number of nonzero components.
Another proof: Since its columns have odd parity, the sum of all rows of H is the all-ones
vector 1. Every codeword is orthogonal to 1, that is, c 1 = 0. But c 1 is the parity of c, so
all codewords have even parity.
In general, when all columns of H have odd parity, the code consists of vectors of even weight.
However, the parity of the rows of H does not determine the parity of the codewords.
c. No. A systematic parity-check matrix of the form [ I [ P
T
] would be obtained by elementary
row operations on H. But the rst six columns of H have rank 5 since the last row of that
submatrix is zero. Therefore it is not possible to transform H to the required form.
5. Erasure correction. Consider the (7,4) binary Hamming code with parity-check matrix
H =

1 0 0 1 0 1 1
0 1 0 1 1 1 0
0 0 1 0 1 1 1

.
a. Find a codeword of weight 3.
b. Decode r
1
=

1 0 0 ? 0 1 ?

, a senseword with two erasures.


c. Decode r
2
=

1 0 0 ? ? ? 0

, a senseword with three erasures.


d. Explain why part (c) does not contradict the fact that a code with minimum distance 3 has
erasure correction ability 2.
Solution
a. Message bits 0, 1, and 3 (codeword bits 3, 4, and 6) aect only two check bits. Therefore the
message sequences

1 0 0 0

0 1 0 0

, and

0 0 0 1

generate codewords of weight 3.

1 0 0 0

1 1 0 1 0 0 0

0 1 0 0

0 1 1 0 1 0 0

0 0 0 1

1 0 1 0 0 0 1

There are four other codewords of weight 3, all of which are cyclic shifts of the codewords
above.
Page 4 of 9 EE 387, Autumn 2012
b. Let x and y be the unknown bits in the transmitted codeword c
1
. Then c
1
H
T
= 0 yields
three linear equations for the two unknowns x and y.
0 = 1 + x + 1 + y = x + y
0 = x + 1
0 = 1 + y
From the last two equations, we see that x = 1 and y = 1, which is conrmed by the rst
equation. Thus c
1
=

1 0 0 1 0 1 1

.
c. Let x, y, z be the unknown bits in the transmitted codeword c
2
. Then c
2
H
T
= 0 yields
0 = 1 + x + z
0 = x + y + z
0 = y + z
Adding the last two equations yields x = 0. Substituting x = 0 into the rst equation yields
z = 1. The third equation implies y = z = 1. Thus c
2
=

1 0 0 0 1 1 0

.
d. The erasure correction ability d

1 = 2 is the maximum number of erasures that are


guaranteed to be correctable because any two columns of H are linearly independent. Some
sets of three columns are linearly independent, such as columns 4, 5, and 6, and so erasures
in those bit positions can be corrected. Other sets of three columns are linearly dependent,
such as columns 1, 2, and 4, and so erasures in those bit positions cannot be corrected.
6. Code design. You have been brought in as a consultant by the university to design a code for
a new wireless communication link connecting the Hewlett 101 classroom with the oces in
the Packard building. Suppose that the channel is binary with bit error rate 10
5
. Packets
(codewords) transmitted over this channel will consist of 1000 bits including check bits. Your
job is to specify codes that satisfy the reliability requirements of several scenarios the university
would like to consider. Assume that the number of check bits needed to correct t errors in the
received packet is 10t for t 10.
a. Suppose that no coding is used. What is the probability of receiving a packet with k bit
errors?
b. Suppose that the bit error rate after packet decoding is required to be less than 10
9
. In your
code design, how many bit errors must be correctable in each packet in order to satisfy this
requirement?
c. Suppose that the probability that a packet is not correctly decoded is required to be less than
10
12
. How many bit errors must be correctable in each packet?
Solution
a. The number of bit errors has a binomial probability distribution. For this channel,
Pk errors in 1000 bits =

1000
k

(10
5
)
k
(1 10
5
)
1000k
=
1000 999 (1000 k + 1)
k!
10
5k
(1 10
5
)
1000k
Sample Midterm Examination Solutions Page 5 of 9
When k is small, (1 10
5
)
1000k
0.99 1 and 1000 999 (1000 k 1) 1000
k
.
Therefore we can approximate the above probability by (10
2
)
k
/k!.
b. The bit error rate can be expressed as the average number of incorrect bits per packet after
decoding, divided by the number of bits per packet. If a code can correct up to t errors, then
when t +1 errors occur the worst that can happen is that the decoder ips t bits to arrive at
an incorrect codeword. Thus a conservative assumption is that t +1 errors in a packet result
in 2t + 1 bit errors after decoding, and the contribution to the bit error rate is
Pt+1 errors in packet
2t + 1
1000
.
The following table lists these probabilities and error rates. (We ignore the factor e
n
=
e
0.01
0.99 that appears in the Possion approximation.)
t Probability of t + 1 errors Bit error rate after decoding
0 (10
2
)/1! = (1/1) 10
2
(1/1) 10
2
1/1000 = 1.0 10
5
1 (10
2
)
2
/2! = (1/2) 10
4
(1/2) 10
4
3/1000 = 1.5 10
7
2 (10
2
)
3
/3! = (1/6) 10
6
(1/6) 10
6
5/1000 = 8.3 10
10
Since the probability of 3 errors is negligible, it is sucient to be able to correct up to two
errors.
c. If a code can correct t errors, then a packet is uncorrectable only when at least t + 1 error
occur. Using the Poisson approximation, the probabilities of t + 1 errors are given in the
following table.
t Probability of t + 1 errors (approximation)
1 (10
2
)
2
/2! = (1/2) 10
4
5.0 10
5
2 (10
2
)
3
/3! = (1/6) 10
6
1.7 10
7
3 (10
2
)
4
/4! = (1/24) 10
8
4.2 10
10
4 (10
2
)
5
/5! = (1/120) 10
10
8.3 10
13
We see that if four errors are correctable, then a packet is uncorrectable only when ve errors
occur, which has probability less than 10
12
.
Hint: for parts (b) and (c) use the Poisson approximation for the probability of k errors in a
packet. If n is the blocklength and is the bit error rate, where n 1, then
Pk errors =
(n)
k
k!
e
n
.
7. Modied block codes. Some of the following operations on rows or columns of the generator
matrix G or the parity-check matrix H may decrease the minimum Hamming weight of a linear
block code? Circle the downarrow if the minimum weight might be reduced.
a. Exchanging two rows of G.
b. Exchanging two rows of H.
c. Exchanging two columns of G.
d. Exchanging two columns of H.
Page 6 of 9 EE 387, Autumn 2012
e. Deleting a row of G.
f. Deleting a row of H.
g. Deleting a column of G and the corresponding column of H.
h. Adding a column to G and a corresponding column to H.
i. Multiplying a column of H by a nonzero element of the channel alphabet.
j. Adding one column of H to another column of H.
Solution
a. Same basis vectors same code.
b. Same check equations same code.
c. Equivalent code has codewords of same weight.
d. Equivalent code has codewords of same weight.
e. Reduces code dimension, may increase minimum weight.
f. _Increases code dimension, may decrease minimum weight.
g. _May delete a check symbol and decrease minimum weight.
h. New codewords have an additional symbol hence weight is at least large.
i. Subspaces generated by columns do not change when one column is multiplied by a nonzero
scaler.
j. _One column might be negative of another column w

reduced from 2 to 1.
8. ISBN code. The International Standard Book Number (ISBN) is a 10-digit codeword such as 0-
521-55374-1. The rst digit indicates the language (0 or 1 for English); the next group of digits
species the publisher (521 for Cambridge University Press); the next group of digits forms the
book number assigned by the publisher; and the nal digit x
10
is chosen so that the entire number
x
1
x
2
. . . x
10
satises the following check equation:
10

i=1
ix
i
= 0 mod 11.
When x
10
= 10 the value is represented by the letter X. (The language, publisher, and book
number elds are variable length, so the hyphens may appear in dierent locations.)
a. Calculate the check digit for the ISBN whose rst nine digits are 0-13-200809.
b. The sixth digit in the ISBN 0-7923- 519-X was blacked out. Find the missing digit.
c. It is easy to see that the ISBN code can detect any single digit error. Show that the ISBN
code can detect the transposition of any two digits (not necessarily consecutive).
Sample Midterm Examination Solutions Page 7 of 9
Solution
a. Since 10 = 1 mod 11, the encoding equation for the ISBN check digit is
x
10
= 10
1
9

i=1
ix
i
mod 11 =
9

i=1
ix
i
mod 11 .
The check digit is computed using modulo 11 arithmetic.
x
10
= 1 0 + 2 1 + 3 3 + 4 2 + 5 0 + 6 0 + 7 8 + 8 0 + 9 9
= 0 + 2 + 9 + 8 + 0 + 0 + 56 + 0 + 81
= 2 + 9 + 8 + 1 + 4 = 24 = 2 .
The complete ISBN is 0-13-200809-2. (The book is Error Control Systems for Digital Com-
munication and Storage by Stephen B. Wicker, Prentice Hall, 1995.)
b. The missing digit x
6
satises the equation, modulo 11,
0 = 1 0 + 2 7 + 3 9 + 4 2 + 5 3 + 6 x
6
+ 7 5 + 8 1 + 9 9 + 10 10
= 6x
6
+ 288 = 6x
6
+ 2 = 6x
6
9 .
The solution to 6x
6
= 9 mod 11, found by trial and error, is 7. The complete ISBN is
0-7923-7519-X. (The book is JPEG2000, by David S. Taubman and Michael W. Marcellin,
Kluwer, 2001.)
c. If a valid ISBN number x
1
x
2
x
10
is altered by exchanging two digits x
i
and x
j
with dierent
values (x
i
,= x
j
) then the dierence between the checksum for the new number and the original
ISBN is
(jx
i
+ ix
j
) (ix
i
+ jx
j
) = jx
i
ix
i
+ ix
j
jx
j
= (j i)(x
i
x
j
) .
This dierence cannot be zero modulo 11 because
0 < [j i[ 9 and 0 < [x
i
x
j
[ 9
and since 11 is prime and does not divide either factor, it does not divide the product.
9. Block code over GF(16). The parity-check matrix of a (15,13) linear block code over GF(16) is
H =

1 1 1 1 1 1 1
1
2

4

13

14

,
where is a primitive element of GF(16) satisfying
4
+ + 1 = 0.
a. Calculate the syndrome of r = (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).
b. The syndrome of a received 15-tuple is s = (
8
,
4
). Assuming that there is a single symbol
error, nd the error location and error pattern.
c. If only single symbol errors are corrected, which syndromes result in decoder failure?
Solution
a. The components of the syndrome (s
0
, s
1
) are the inner products of r with the rows of H.
The rst component is s
0
= 1 + 1 + +1 = 1, since the sum of an odd number of ones in a
eld of characteristic 2 is 1.
Page 8 of 9 EE 387, Autumn 2012
The second component is 1 + +
2
+
3
+ +
14
. Since is a zero of
x
15
1 = (x 1)(1 + x + x
2
+ x
3
+ + x
14
)
but not a zero of x 1, it is a zero of the second factor, which evaluated at is the second
syndrome component. Therefore s
1
= 0.
b. If the error is e = e
i
x
i
, that is, a nonzero error pattern e
i
in location i, then
s
0
=
14

j=0
r
j
=
14

j=0
(c
j
+ e
j
) =
14

j=0
c
j
+
14

j=0
e
j
= 0 + e
i
= e
i
s
1
=
14

j=0
r
j

j
=
14

j=0
(c
j
+ e
j
)
j
=
14

j=0
c
j

j
+
14

j=0
e
j

j
= 0 + e
i

i
= e
i

i
The error location is found from
s
1
s
0
=

4

8
=
4
=
11
.
The error pattern is simply s
0
. The error is
8
= 1010 in component 11 (column of H
with
11
).
c. Single errors always result in syndromes in which both components are nonzero. The de-
coding procedure used in part (b) fails if exactly one syndrome component is 0. There are
30 uncorrectable syndromes, namely (s
0
, 0) and (0, s
1
) where s
0
,= 0 and s
1
,= 0.
Sample Midterm Examination Solutions Page 9 of 9

Você também pode gostar