0% found this document useful (0 votes)
10 views5 pages

Solutions 3

Uploaded by

catto4242
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views5 pages

Solutions 3

Uploaded by

catto4242
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Coding and cryptography

Weeks 5 and 6 (2022-2023)


Selected solutions.

3. a) Calculating the syndromes gives s1 = β 11 and s3 = β 8 . As [s1 , s3 ] 6= [0, 0] the word w is not in the
code. Because s31 = β 33 = β 3 6= β 8 = s3 , at least two errors occurred. We compute the auxiliary/error
locator polynomial σA (z) = z 2 + s1 z + s−1 3 2 8 2 4 13
1 (s1 + s3 ) = z + β z + β , and find it has roots β and β .
4 13 1
So w(x) is corrected to w(x) + x + x , which corresponds to 111111111111111. Since a BCH code
can correct errors of weight two, we can conclude that w can be corrected to v.
b) Calculating the syndromes gives s1 = β 13 and s3 = 1. As [s1 , s3 ] 6= [0, 0] the word w is not in the
code. Becuase s31 = β 39 = β 9 6= 1 = s3 at least two errors occurred. The error locator polynomial
σA (z) = z 2 + β 13 z + β 9 has no roots in F so there are more than two errors, and under the given IMLD
we do not decode (but, e.g., ask for retransmission).
c) Calculating the syndromes gives s1 = β 11 and s3 = β 5 . As [s1 , s3 ] 6= [0, 0] the word w is not in the
code. Because s31 = β 33 = β 3 6= β 5 = s3 at least two errors occurred. The error locator polynomial
σA (z) = z 2 + β 11 z + 1 has roots β 7 and β 8 , so w(x) corrects to w(x) + x7 + x8 .

6. As d = 7, we can correct at most 3 errors, so we can suppose that the error locator polynomial has
degree 3: σA (z) = σ0 + σ1 z + σ2 z 2 + z 3 . In order to find the coeffients of σA , we have to compute
si = w(β i ) for m + 1 ≤ i ≤ m + δ − 1 (in our case m = −1 and δ = 7).
a) We do the 5-step algorithm 6.3.2 on p.137 of the book, to decode the word

w(x) = α3 x + αx2 + α5 x3 + α3 x4 + α2 x5 + α6 x6 + α10 x7

Step 1: compute the syndromes si = w(β i ) for all roots β i of the generator polynomial. We find

s0 = α7 , s1 = α8 , s2 = α13 , s3 = α4 , s4 = α14 , s5 = α9 .

Step 2: Find the rank of  


s0 s1 s2 s3
M 0 = s1 s2 s3 s4 
s2 s3 s4 s5
and define l to be this rank.
Substituting the syndromes of the previous step and some Gaussian elimination (using rows!) leads to
 7
α8 α13 α4

α
M 0 ∼  0 α10 α9 α12 
0 0 α12 α4

so M 0 has full rank and l = 3.


Step 3: Determine the error locator polynomial σA (z) = σ0 + σ1 z + σ2 z 2 + z 3 of degree l = 3 by the
equation     
s0 s1 s2 σ0 s3
M σ = s1 s2 s3  σ1  = s4  .
s2 s3 s4 σ2 s5
This can be done by continuing Gaussian elimination of M 0 to the point
 
1 0 0 1
M 0 ∼ 0 1 0 α3 
0 0 1 α7
P2r −2 i r r
1 Rather generally (1 − α) i=0 α = 1 − α2 −1 . If α ∈ GF (2r )∗ then 1 − α2 −1 = 0. If moreover α 6= 1 we can conclude
P2r −2 i P2r −2 i
that i=0 α = 0. In other words, the polynomial v(x) = i=0 x vanishes at all field elements other than 0 and 1. In
particular, v(β) = 0 = v(β 3 ) if r ≥ 3.
so that σ(z) = 1 + α3 z + α7 z 2 + z 3 .
Step 4: Substituting elements of the field, we find the following roots (error locations) of σ(z):

a1 = β, a2 = β 6 , a3 = β 8 .

At this stage we know that the error is of the form e(x) = b1 x + b2 x6 + b3 x8 .


Step 5: We find the error magnitudes bi by solving
    
1 1 1 b1 s0
a1 a2 a3  b2  = s1 
a21 a22 a23 b3 s2

resulting in
b1 = α 3 , b2 = 1, b3 = α.

Thus we can decode to c(x) = w(x) + e(x) where e(x) = α3 x + x6 + αx8 .


c) We compute:

s0 = w(1) = α + α7 + α12 + α3 + α3 + 1 = α4 + α7 + α12 = α10


s1 = w(β) = α + α9 + α16 + α8 + α9 + α7 = α + α + α8 + α7 = α11
s2 = w(β 2 ) = α + α11 + α20 + α13 + α15 + α14 = α + α12 + α5 + α17 = α12 + α + α2 + α4 = α12
s3 = w(β 3 ) = α + α13 + α24 + α18 + α21 + α21 = α + α13 + α9 + α3 = α13
s4 = w(β 4 ) = α + α15 + α28 + α23 + α27 + α28 = α + 1 + α8 + α12 = α4 + α9 = α14
s5 = w(β 5 ) = α + α17 + α32 + α28 + α33 + α35 = α + α2 + α2 + α13 + α3 + α5 = α2 + α13 + α3 = α15

and get the system

α10 α11 α12


  13   10
α11 α12 α13
  
σ0 α α
 α11 α12 α13   σ1  =  α14  with the extended matrix  α11 α12 α13 α14 
α12 α13 α14 σ2 α15 α12 α13 α14 α15

that reduces by adding the first row times α2 to the third row and the first row times α to the second
row to  10
α11 α12 α13
 10
α11 α12 α13
 
α α
 α11 α12 α13 α14  →  0 0 0 0 
0 0 0 0 0 0 0 0
Therefore the extended matrix has rank 1 and hence there was either only one error (if the root of
σA (z) is some power of β) or more than three (if this is not the case). The error locator polynomial has
degree 1: σA (z) = σ0 +z. We solve s0 σ0 = s1 , so σ0 = α and σA (z) = α+z. The (only) root of σA (z) is
β 1 , which means that we have an error in the position for x1 with magnitude b1 , where b1 is the solution
of the equation αm+1 b1 = sm+1 , so b1 = α10 . Therefore w corrects to αα10 α7 0α12 α3 α3 10000000.
d) As in c), we compute s0 = α, s1 = 1, s2 = α4 , s3 = α, s4 = 1 and s5 = α5 and get the system

α4 α4
      
α 1 σ0 α α 1 α
 1 α4 α   σ1  =  1  with the extended matrix  1 α4 α 1 .
α4 α 1 σ2 α5 α4 α 1 α5
Row reducing this matrix gives

α4 α4 α4
     
α 1 α α 1 α α 1 α
 0 α4 + α14 α + α3 0 = 0 α9 α9 0 → 0 α9 α9 0 .
0 α + α3 1 + α7 α5 + α4 0 α9 α9 α8 0 0 0 α8

Therefore the system has no solutions, so there were too many errors and hence we cannot decode w.
7. As d = 5, we can correct at most 2 errors, so we can suppose that the error locator polynomial has
degree 2: σA (z) = σ0 + σ1 z + z 2 . In order to find E(x), the transform of the error e(x), and the
coeffients of σA , we have to compute si = w(β i ) for m + 1 ≤ i ≤ m + δ − 1 (in our case m = 0, δ = 5
and n = 15).
a) Similar to Problem 6, we compute s1 = 1, s2 = 0, s3 = α6 and s4 = α8 . For all 0 ≤ k < n,

Ek = σ1 Ek+1 + σ0 Ek+2 (∗ ∗ ∗)

with indices modulo n. We know Ek = e(β n−k ) = w(β n−k ) = sn−k for n − k equal to 1, 2, 3 or 4 so

E14 = s1 = 1
E13 = s2 = 0
E12 = s3 = α6
E11 = s4 = α8 .

Of the 15 equations in (∗ ∗ ∗) we know the three Ei involved for k = 11 and 12, giving

α8 = α 6 σ1
6
α = σ0

with the first equation for k = 11 and the second for k = 12. This is the (here very simple) system
    6 
1 0 σ0 α
= ,
0 α6 σ1 α8

which means that σ0 = α6 and σ1 = α2 .


We now use the equations in (∗ ∗ ∗) for k = 10, 9, . . . , 0 to compute E10 , E9 , . . . , E0 :

E10 = α2 E11 + α6 E12 = α3


E9 = α2 E10 + α6 E11 = α12
E8 = α2 E9 + α6 E10 = α4
E7 = α2 E8 + α6 E9 = α2
E6 = α2 E7 + α6 E8 = α2
E5 = α2 E6 + α6 E7 = α5
E4 = α2 E5 + α6 E6 = α11
E3 = α2 E4 + α6 E5 = α4
E2 = α2 E3 + α6 E4 = α3
E1 = α2 E2 + α6 E3 = 1
E0 = α2 E1 + α6 E2 = α11 .

We have not used the equations for k = 14 and 13 yet, but they must be satisfied as well (if they fail
there are too many errors). Here they are satisfied:

E14 = α2 E0 + α6 E1
E13 = α2 E14 + α6 E0

become

1 = α2 · α11 + α6 · 1
0 = α2 · 1 + α6 · α11

because α17 = α2 in F and using the table.


So E(z) equals

α11 + z + α3 z 2 + α4 z 3 + α11 z 4 + α5 z 5 + α2 z 6 + α2 z 7 + α4 z 8 + α12 z 9 + α3 z 10 + α8 z 11 + α6 z 12 + z 14 .


We know that the most likely error vector is e = (E(β 0 ), E(β 1 ), . . . , E(β 14 )) = (0000α2 α9 000000000),
and therefore w decodes to α10 α12 α9 α7 10000000000.
The amount of work involved in computing e is reduced by using that σA (z)E(z) has 1, β, β 2 , β 3 , . . . , β 14
among its roots, so that σA (β j ) 6= 0 implies E(β j ) = 0. Because σA (z) has degree 2, we know this
must hold for j = 6, 7, . . . , 14 if we start with j = 0, 1, . . . and notice along the way that the two roots
of σA (z) are β 4 and β 5 .
8. In this case m = −1, n = 5 and δ = 5. As d = 5, we can correct at most 2 errors, so we can suppose that
the error locator polynomial has degree 2: σA (z) = σ0 + σ1 z + z 2 .
a)i. We get the system
 11
α7
  9   11
α7 α9
 
α σ0 α α
= with the extended matrix
α7 α9 σ1 α3 α7 α9 α3

that reduces to
α11 α7 α9 α11 α7 α9
   
=
0 α + α3
9
α + α5
3
0 α α11
so σ1 = α11 /α = α10 and σ0 = (α9 + α7 · α10 )/α11 = 1, and hence σA (z) = 1 + α10 z + z 2 . By trying
all the possible powers of β, we find that σA (z) has the roots a1 = β and a2 = β 4 , hence b1 and b2 , the
magnitudes of the errors, satisfy the linear system
  11 
1 α11
   
1 1 b1 α 1
= with the extended matrix
α3 α12 b2 α7 α3 α12 α7

that reduces to
α11 α11
   
1 1 1 1
= .
0 α12 + α3 α + α7
14
0 α10 α
So b2 = α/α10 = α6 and b1 = α11 + α = α6 and hence the error is e(x) = αx + α6 x4 .
ii. We get the system

1 α2
  14 
α2 α14
   
σ0 α 1
= with the extended matrix
α2 α14 σ1 α8 α2 α14 α8

that reduces to
α2 α14 α2 α14
   
1 1
=
0 α14 + α4 α8 + α 0 α9 α10
so σ1 = α10 /α9 = α and σ0 = α14 + α2 · α = 1, and hence σA (z) = 1 + αz + z 2 . By trying all the
possible powers of β, we find that σA (β i ) 6= 0 for all i, which means that there were too many errors
and we cannot decode w2 (x).
iii. We get the system

1 α9
  3 
α9 α3
   
σ0 α 1
= with the extended matrix
α9 α3 σ1 α α9 α3 α

that reduces to
α9 α3 α9 α3
   
1 1
= .
0 α + α3
18 12
α +α 0 0 α13
Therefore the system has no solutions, so there were too many errors and hence we cannot decode w3 .
iv. We get the system
 10
α4
  13   10
α4 α13
 
α σ0 α α
= with the extended matrix
α4 α13 σ1 α7 α4 α13 α7

that reduces to
α10 α4 α13 α9 α3
   
1
= .
0 α + α13
13
α + α7
7
0 0 0
Therefore the extended matrix has rank 1 and hence there was only one error, so the error locator
polynomial has degree 1: σA (z) = σ0 + z. We solve s0 σ0 = s1 , so σ0 = α9 and σA (z) = α9 + z. The
(only) root of σA (z) is β 3 , which means that we have an error on the position for x3 . Computing its
magnitude from (∗∗) in the lectures we find b1 = s0 = α10 , so the error polynomial is e(x) = α10 x3 ,
and w(x) decodes to w(x) + α10 x3 .
b) We let σA (z) = σ0 + σ1 z + z 2 be the error locator polynomial of degree b d−1
2 c = 2. For any received
word w and for any 0 ≤ k < n = 5 we have the identity Ek = σ1 Ek+1 + σ0 Ek (with indices modulo n),
obtained from σA (z)E(z) ≡ 0 modulo 1 + z 5 . This gives the five equations

Ek = σ1 Ek+1 + σ0 Ek+2 ,

i.e.,

E2 = σ1 E3 + σ0 E4
E1 = σ1 E2 + σ0 E3
E0 = σ1 E1 + σ0 E2 (∗ ∗ ∗)
E4 = σ1 E0 + σ0 E1
E3 = σ1 E4 + σ0 E0 .

We also know Ek = e(β n−k ) = w(β n−k ) = sn−k for k = m + 1, m + 2, . . . , m + δ − 1. As m = −1,


n = 5 and δ = 5, this gives E0 = s0 , E4 = s1 ,E3 = s2 and E2 = s3 , with values as in the question. So
we know all Ei in the first and last equations. These can be used to computed σ0 and σ1 as in part
a) of this problem. We can then compute E1 = σ1 E2 + σ0 E3 and have to check if the two remaining
equations E0 = σ1 E1 + σ0 E2 and E4 = σ1 E0 + σ0 E1 hold for that values of σ0 , σ1 and E1 that we
have just computed and the already known values of E0 , E2 and E4 .
i) As in a), we get σ0 = 1 and σ1 = α10 and hence E1 = σ1 E2 + σ0 E3 = α10 . We have to test if
E0 = σ1 E1 + σ0 E2 and E4 = σ1 E0 + σ0 E1 , i.e., if α11 = α10 α10 + 1 · α3 and α7 = α10 α11 + 1 · α10 . Both
hold by checking against the table (and using α15 = 1). Since E(z) = α11 + α10 z + α3 z 2 + α9 z 3 + α7 z 4 ,
we know that the most likely error vector is e = (E(β 0 ), E(β 1 ), . . . , E(β 4 )) = (0α00α6 ). Again, the
amount of caclutation can be cut down by using that σA (β j ) 6= 0 implies that E(β j ) = 0.
ii) As in a), we get σ0 = 1 and σ1 = α and hence E1 = σ1 E2 + σ0 E3 = α4 . We have to test if
E0 = σ1 E1 + σ0 E2 and E4 = σ1 E0 + σ0 E1 . The first would give 1 = α · α4 + 1 · α8 , but this is not true
according to the table. So there are no solutions to (∗ ∗ ∗), and we cannot decode w2 (x) by fixing at
most 2 errors.
iii) As in a), we get no solution for σ0 and σ1 , therefore there were too many errors and hence we
cannot decode w3 (x).
iv) In the case of w4 (x) the first and last equations together give more than one solution for the pair
(σ0 , σ1 ). In this case we put σ0 = 0 and try again. Then we find σ1 = α9 , so σA (z) = α9 z + z 2 is given
a (harmless) root 0 that does not correspond to any error. Now E1 = σ1 E2 = α9 · α7 = α, and we have
to check if E0 = σ1 E1 and E4 = σ1 E0 , i.e., if α10 = α9 · α and α4 = α9 · α10 . Both hold, so we found
E(z) = α10 + αz + α7 z 2 + α13 z 3 + α4 z 4 . Then e = (E(1), E(β), E(β 2 ), E(β 3 ), E(β 4 )) = (0, 0, 0, α10 , 0),
where again we used that σA (β j ) 6= 0 implies that E(β j ) = 0 to simplify the calculations. So w4 (x)
decodes to w4 (x) + e(x) = w4 (x) + α10 x3 .
c) Because n = 5, and the degree of g(x) is 4, k = 5 − 4 = 1, therefore C = g(x)GF (24 ), so |C| = 16.
b equals 4n = 20, |C|
The length of C b = |C| = 16, hence the rate of C b is (log2 |C|)/20 = 4/20 = 1/5.

You might also like