Docsity

Solution to Final Exam - Coding Theory | ECE 556, Exams of Electrical and Electronics Engineering

Toggle sidebar
bg1
University of Illinois Fall 2005
ECE 556/CS 577/MATH 579: Solutions to the Final Examination
1. An (n, k) Hamming code over GF(q) of redundancy rhas block length (qr−1)/(q−1).
(a) Hence, n= (33−1)/(3 −1) = 13 and k=n−r= 10.
(b) Suppose that the predicted outcome of each game is encoded as 0 for a loss, 1 for a tie, and 2
for a win. Each entry can be thought of as a vector in [GF(3)]13. Now, the (13,10) Hamming
code over GF(3) is perfect: the spheres of radius 1 centered on each codeword are disjoint and
exhaustive. Put another way, each vector in [GF(3)]13 is at distance at most 1 from the nearest
codeword of the Hamming code. Thus, 310 entries (consisting of the codewords of the Hamming
code) are necessary and sufficient to guarantee at least a share of second prize.
2. Let RM(m, r) denote the r-th order Reed-Muller code of length 2m.
(a)A(z;m, 0,0) is the weight enumerator of RM(m,0) which has two codewords 0and 1. Hence,
A(z;m, 0,0) = 1 + z2m.
The minimum distance of RM(m, 1) is 2m−1.
(b) For s, 0< s < 2m−1,each coset of RM(m, 0) has two codewords xand x+1from RM(m, 1).
Since the two codewords have complementary weights, and both weights must be ≥2m−1, we
conclude that the vectors both are of weight exactly 2m−1and therefore A(z;m, 0, s) = 2z2m−1.
From the formula in the problem statement, we get
A(z;m, 1,0) = A(z;m, 0,0) + (2m−1) ·2z2m−1= 1 + (2m+1 −2)z2m−1+z2m.
(c) According to the Plotkin construction, any codeword i RM(m+1, r +1) can be expressed uniquely
as [x,x+y], where x∈ RM(m, r + 1) and y∈ RM(m, r). Now suppose that xis a fixed codeword
of weight iin the s-th coset of RM(m, r). Then, the set of codewords {[x,x+y] : y∈ RM(m, r)}
has weight enumerator ziA(z;m,r, s). By choosing xto be other members of the same coset
of RM(m, r), we get that the set {[x,x+y] : x∈s-th coset, y∈ RM(m, r )}has enumerator
[A(z;m, r, s)]2. It follows that A(z;m+ 1, r + 1,0) =
Sm+1,r−1
X
s=0
[A(z;m, r, s)]2.Hence,
A(z;m+ 1,1,0) =
2m
−1
X
s=0
[A(z;m, 0, s)]2,
=h1 + z2mi2+ (2m−1) h2z2m−1i2,
= 1 + 2z2m+z2m+1 + (2m−1) ·4z2m,
= 1 + 2m+2 −2z2m+z2m+1 .
3. (a) Consider the codeword 1 + xi+xjof weight 3 where we assume that j > i. Then, by reversibility,
xn−1+xn−1−i+xn−1−jis also a codeword, and we can shift this codeword cyclically to deduce
that so is 1 + xj−i+xjis also a codeword. But, the sum of 1 + xi+xjand 1 + xj−i+xjhas
weight 2 unless j= 2i(in which case the two codewords are identical and the sum is 0). Now note
that 1 + xn−j+xn−j+iis also a codeword of weight 3 obtained by shifting 1 + xi+xjcyclically,
and applying the previous argument, we deduce that it must be that (n−j+i) = 2(n−j) and
hence i=n−j. It follows that j= 2n/3 and i=n/3 showing that nis a multiple of 3.
(b) It follows from part (a) that there are exactly n/3 codewords of weight 3, and they are the cyclic
shifts of 00 · · · 0100 · · · 0100 · · · 1 where the three ONEs are separated by n/3−1 ZEROs.
(c) The n/3 codewords of part (b) are linearly independent and span a subspace of dimension n/3.
Hence the code has dimension at least n/3 and rate at least 1/3.
4. [6 points] An (n, k) cyclic Reed-Solomon code has minimum distance (and minimum weight) n−k+1.
(a) Since g(x) is a codeword, its n−k+1 coefficients must all be nonzero: gi6= 0 for all i, 0≤i≤n−k.
pf3

Partial preview of the text

Download Solution to Final Exam - Coding Theory | ECE 556 and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

University of Illinois Fall 2005

ECE 556/CS 577/MATH 579: Solutions to the Final Examination

  1. An (n, k) Hamming code over GF(q) of redundancy r has block length (qr^ − 1)/(q − 1).

(a) Hence, n = (3^3 − 1)/(3 − 1) = 13 and k = n − r = 10. (b) Suppose that the predicted outcome of each game is encoded as 0 for a loss, 1 for a tie, and 2 for a win. Each entry can be thought of as a vector in [GF(3)]^13. Now, the (13, 10) Hamming code over GF(3) is perfect: the spheres of radius 1 centered on each codeword are disjoint and exhaustive. Put another way, each vector in [GF(3)]^13 is at distance at most 1 from the nearest codeword of the Hamming code. Thus, 3^10 entries (consisting of the codewords of the Hamming code) are necessary and sufficient to guarantee at least a share of second prize.

  1. Let RM(m, r) denote the r-th order Reed-Muller code of length 2m.

(a) A(z; m, 0 , 0) is the weight enumerator of RM(m, 0) which has two codewords 0 and 1. Hence, A(z; m, 0 , 0) = 1 + z^2

m . The minimum distance of RM(m, 1) is 2m−^1. (b) For s, 0 < s < 2 m^ − 1 , each coset of RM(m, 0) has two codewords x and x + 1 from RM(m, 1). Since the two codewords have complementary weights, and both weights must be ≥ 2 m−^1 , we conclude that the vectors both are of weight exactly 2m−^1 and therefore A(z; m, 0 , s) = 2z^2

m− 1 . From the formula in the problem statement, we get

A(z; m, 1 , 0) = A(z; m, 0 , 0) + (2m^ − 1) · 2 z^2

m− 1 = 1 + (2m+1^ − 2)z^2

m− 1

  • z^2

m .

(c) According to the Plotkin construction, any codeword i RM(m+1, r+1) can be expressed uniquely as [x, x+y], where x ∈ RM(m, r +1) and y ∈ RM(m, r). Now suppose that x is a fixed codeword of weight i in the s-th coset of RM(m, r). Then, the set of codewords {[x, x + y] : y ∈ RM(m, r)} has weight enumerator ziA(z; m, r, s). By choosing x to be other members of the same coset of RM(m, r), we get that the set {[x, x + y] : x ∈ s-th coset, y ∈ RM(m, r)} has enumerator

[A(z; m, r, s)]^2. It follows that A(z; m + 1, r + 1, 0) =

Sm+1 ∑,r− 1

s=

[A(z; m, r, s)]^2. Hence,

A(z; m + 1, 1 , 0) =

(^2) ∑m− 1

s=

[A(z; m, 0 , s)]^2 ,

[

1 + z^2

m ]^2

  • (2m^ − 1)

[

2 z^2

m− 1 ]^2 ,

= 1 + 2z^2

m

  • z^2

m+

  • (2m^ − 1) · 4 z^2

m ,

= 1 +

2 m+2^ − 2

z^2

m

  • z^2

m+ .

  1. (a) Consider the codeword 1 + xi^ + xj^ of weight 3 where we assume that j > i. Then, by reversibility, xn−^1 + xn−^1 −i^ + xn−^1 −j^ is also a codeword, and we can shift this codeword cyclically to deduce that so is 1 + xj−i^ + xj^ is also a codeword. But, the sum of 1 + xi^ + xj^ and 1 + xj−i^ + xj^ has weight 2 unless j = 2i (in which case the two codewords are identical and the sum is 0). Now note that 1 + xn−j^ + xn−j+i^ is also a codeword of weight 3 obtained by shifting 1 + xi^ + xj^ cyclically, and applying the previous argument, we deduce that it must be that (n − j + i) = 2(n − j) and hence i = n − j. It follows that j = 2n/3 and i = n/3 showing that n is a multiple of 3. (b) It follows from part (a) that there are exactly n/3 codewords of weight 3, and they are the cyclic shifts of 00 · · · 0100 · · · 0100 · · · 1 where the three ONEs are separated by n/ 3 − 1 ZEROs. (c) The n/3 codewords of part (b) are linearly independent and span a subspace of dimension n/3. Hence the code has dimension at least n/3 and rate at least 1/3.

  2. [6 points] An (n, k) cyclic Reed-Solomon code has minimum distance (and minimum weight) n − k + 1.

(a) Since g(x) is a codeword, its n−k+1 coefficients must all be nonzero: gi 6 = 0 for all i, 0 ≤ i ≤ n−k.

(b) It is also true that hi 6 = 0 for all i, 0 ≤ i ≤ k. This is because the dual of a Reed-Solomon code (whose generator polynomial is thus h(x)) is also a Reed-Solomon code.

(c) Cˆj = Cj− 1 =

k∑− 1

i=

uiα(j−1)i^ =

k∑− 1

i=

uiα−iαji^ = u(α−^1 x)

x=αj

. Hence, ˆu(x) = u(α−^1 x).

  1. (a) The standard feedforward encoder circuit. It has four memory cells.

University Set #11: Problems and Solutions ECE 456 of Illinois Page 4 of 4 Fall 2002

(a) Draw a encoder for this code in which the two input streams are put into two different shift registers and the shift register contents are added to get the parity bits. (b) Draw an encoder that uses only three shift register stages (i.e. flip-flops). (You will need to use the fact that C (0)^ = u (0)^ and C (1)^ = u (1).)

4.(a) The straightforward encoder implementation is as shown below. C

C

C

(0)

(1)

(2)

u (0)

u (1)

(b) Since C (2)^ (x)= (1 + x^2 + x^3 ) u (0)^ (x) + (1 + x + x^3 ) u (1)^ (x) = (1 + x^2 + x^3 ) C (0)^ (x) + (1 + x + x^3 ) C (1)^ (x), the i-th bit of C (2)^ is the sum of the i-th bits of C (0)^ and C (1)^ , the (i-1)-th bit of C (1)^ , the (i-2)-th bit of C (0)^ , and the (i-3)-th bits of C (0)^ and C (1)^. Hence, we can implement the encoder as shown below. u

u

C

C

C

(0)

(1)

(2)

(1)

(0)

The circuit shown above illustrates a problem in the various definitions of constraint length, memory order, etc. According to Blahut, this code has constraint length 6. However, since an encoder with only three flipflops can be designed as shown, a Viterbi decoder need only be designed with 8 instead of 64 states, leading to a significant reduction in complexity. For this reason, some authors also talk of decoder memory order as contrasted with encoder memory order.

(b) Since C(2)(x) = (1+x^2 +x^3 )u(0)(x)+(1+x+x^3 )u(1)(x) = (1+x^2 +x^3 )C(0)(x)+(1+x+x^3 )C(1)(x), the i-th bit of C(2^ is the sum of the i-th bits of C(0)^ and C(1), the (i − 1)-th bit of C(1), the (i − 2)-th bit of C(0), and the (i − 3)-th bits of C(0)^ and C(1). Hence, we can implement the encoder as shown below with only three memory cells.

University Set #11: Problems and Solutions ECE 456 of Illinois Page 4 of 4 Fall 2002

(a) Draw a encoder for this code in which the two input streams are put into two different shift registers and the shift register contents are added to get the parity bits. (b) Draw an encoder that uses only three shift register stages (i.e. flip-flops). (You will need to use the fact that C (0)^ = u (0)^ and C (1)^ = u (1).)

4.(a) The straightforward encoder implementation is as shown below. C

C

C

(0)

(1)

(2)

u (0)

u (1)

(b) Since C (2)^ (x)= (1 + x^2 + x^3 ) u (0)^ (x) + (1 + x + x^3 ) u (1)^ (x) = (1 + x^2 + x^3 ) C (0)^ (x) + (1 + x + x^3 ) C (1)^ (x), the i-th bit of C (2)^ is the sum of the i-th bits of C (0)^ and C (1)^ , the (i-1)-th bit of C (1)^ , the (i-2)-th bit of C (0)^ , and the (i-3)-th bits of C (0)^ and C (1)^. Hence, we can implement the encoder as shown below. u

u

C

C

C

(0)

(1)

(2)

(1)

(0)

The circuit shown above illustrates a problem in the various definitions of constraint length, memory order, etc. According to Blahut, this code has constraint length 6. However, since an encoder with only three flipflops can be designed as shown, a Viterbi decoder need only be designed with 8 instead of 64 states, leading to a significant reduction in complexity. For this reason, some authors also talk of decoder memory order as contrasted with encoder memory order.

  1. (a) The state transition diagram is as shown below. Notice the self loop with output weight 0 as well as the two–branch loop with output weight 0.

(b) This a catastrophic encoding since gcd(1 + x^2 , 1 + x + x^2 + x^3 ) = 1 + x^2 6 = xi^ for some i. (c) i. The all-ones input maps onto 11 10 01 00 00 · · · ii. Dividing both polynomials by the gcd, we get the systematic encoder defined by [1, 1 + x].

  1. See the diagram on the next page. The final answer is unique, but the intermediate steps are not — in many instances, an arbitrary choice was made among equally likely possibilities. The nodes along the maximum-likelihood path have been shaded grey.