0% found this document useful (0 votes)
9 views2 pages

Solutions 1

Uploaded by

catto4242
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
9 views2 pages

Solutions 1

Uploaded by

catto4242
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 2

Coding and cryptography

Weeks 1 and 2 (2022-2023)


Selected solutions.

1. Find the maximum number of code words of length n = 4 in a code in which any single error can be
detected. What about for general n?
We do the case for general n. Since we want to detect a single error, the distance of the code must be
at least 2. We try
C = {v ∈ K 4 | wt(v) is even } ,
where all the distances are even (because d(v, v 0 ) = wt(v + v 0 ) ≡ wt(v) + wt(v 0 ) modulo 2). We have
110 . . . 0 in C, so d(C) = 2.
Note that |C| = 2n−1 . We claim that there is no larger code that can detect a single error. For this,
let C 0 ⊆ K n be any code with d(C 0 ) ≥ 2. Forgetting the last position gives a map K n → K n−1 , and
restricting this to C 0 gives an injection C 0 → K n−1 because any two distinct codewords of C 0 differ in
at least two positions, and their images will differ in at least one position. So |C 0 | ≤ |K n−1 | = 2n−1 .
9.c C = hSi, where S = {0101, 1100, 1010, 1001}. Find dim C, a generating matrix G and a parity check
matrix H.
In order to find a generating matrix we first form a matrix where the rows are the elements of S and
then we try to bring it to standard form using elementary row operations:
         
0 1 0 1 1 1 0 0 1 1 0 0 1 1 0 0 1 0 0 1
 1 1 0 0   0 1 0 1   0 1 0 1   0 1 0 1   0 1 0 1 
 1 0 1 0 → 1 0 1 0 → 0 1 1 0 → 0 0
       → 
1 1   0 0 1 1 
1 0 0 1 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0
 
1 0 0 1
Therefore the generating matrix is  0 1 0 1  so C has dimension 3 and length 4 and hence
0 0 1 1
 
1
 1 
the parity check matrix (4 × (4 − 3)) is 
 1 .

13. C is a linear code with d = d(C) and u a word in K n such that wt(u) ≤ b(d − 1)/2c.
Suppose there exists a word v ∈ u + C with v 6= u such that v can be a coset leader for u + C. So
wt(v) ≤ wt(u) ≤ b(d − 1)/2c. But if v = u + c for c in C then c = u + v ∈ C \ {0}. By the triangle
inequality
wt(c) ≤ wt(v) + wt(u) ≤ b(d − 1)/2c + b(d − 1)/2c ≤ d − 1.
Thus we get that 0 < wt(c) < d(C), which contradicts the fact that 0 6= c ∈ C, so the supposition was
wrong and therefore u is the unique coset leader for u + C.

14, Because C is a code with the parity check matrix


 
0 1 1

 1 0 1 

 1 1 0 
H= 

 1 0 0 

 0 1 0 
0 0 1
C has length 6. We also see that no row of H is 000, no two rows of H are equal, and the sum of the first
3 rows is 000, and hence, by Theorem 2.9.1, d = d(C) = 3. Therefore C corrects t = b(d − 1)/2c = 1
errors, so in order to build a table with syndromes and coset leaders for error patterns of weight at
most 1 (i.e., a part of a Standard Decoding Array) it suffices to generate all errors e with wt(e) ≤ 1
and compute the syndrome eH for each one. Proceeding this way we get:

Error pattern e Syndrome eH


000000 000
100000 011
010000 101
001000 110
000100 100
000010 010
000001 001

The word 110100 has syndrome 010 which corresponds to the error pattern 000010, so under MLD we
decode 110100 as 110110.
The word 111111 has syndrome 111 which does not correspond to any single-error pattern. But we
can see that 111 = 011 + 100 = 101 + 010 = 110 + 001, so there are 3 distinct 2-error patterns with
this syndrome, so the nearest codewords are 011011, 101101 and 110110. (E.g., 011 + 100 corresponds
to the error pattern 100000 + 000100, which corresponds to the codeword 111111 + 100100 = 011011.)
Thus, under IMLD we do not decode 111111 and with CMLD we correct it to one of those three nearest
neighbours.
The word 101010 has syndrome 111 and has the same error patterns as for 111111, of which the ones of
lowest weight are 100100, 010010, 001001. Under IMLD we cannot decode 100100, and under CMLD
we decode it to either 001110, 111000 or 100011.
The word 000110 has syndrome 110 which corresponds to the error pattern 001000, so under MLD this
word is decoded to 001110.

15. C is a code with length k = 4 and distance d = 3. C corrects t = b(d − 1)/2c = 1 errors, so, by the
Hamming bound
24 16
|C| ≤ 4 4 = 5 < 4,

0 + 1

and hence |C| ≤ 3. Now suppose |C| = 3 and let C = {u, v, w}.
Because d(C) = 3, we can assume without loss of generality that d(u, v) = wt(u + v) = 3 and
d(u, w) = wt(u + w) ≥ 3. We see that d(v, w) = wt(v + w) = wt(v + u + u + w) = d(u + v, u + w).
If d(u, w) = wt(u + w) = 4, then u + w = 1111 and u + v contains three 1s and one 0, so d(v, w) =
d(u + v, u + w) = 1. If d(u, w) = wt(u + w) = 3, then u + w and u + v each have three 1s and one 0.
Because they are different we find d(v, w) = d(u + v, u + w) = 2. In either case we get a contradiction
with d(C) = 3, so the assumption that |C| = 3 was wrong, and therefore |C| ≤ 2.

You might also like