Sie sind auf Seite 1von 16

Information and Coding Theory

Assignment 5: Solution

Chadi Abou-Rjeily

Department of Electrical and Computer Engineering


Lebanese American University
chadi.abourjeily@lau.edu.lb

March 31, 2020


Exercise 1 (a)

◮ The number of codewords is 2k = 8 implying that k = 3.


◮ The length of each codeword is 6 implying that n = 6.
◮ The rate of the code is Rc = k/n = 3/6 = 0.5.
Exercise 1 (b,1)
◮ The systematic bits appear at the end of each codeword
implying that G can be written as:
 
  p11 p12 p13 1 0 0
G = P Ik =  p21 p22 p23 0 1 0 
p31 p32 p33 0 0 1

◮ Inspecting codeword c2 implies that the elements of the first


row of P must be as follows: p11 = 0, p12 = 1 and p13 = 1.
◮ Inspecting codeword c3 implies that the elements of the second
row of P must be as follows: p21 = 1, p22 = 0 and p23 = 1.
◮ Inspecting codeword c5 implies that the elements of the third
row of P must be as follows: p31 = 1, p32 = 1 and p33 = 0.
◮ Consequently:
 
0 1 1 1 0 0
G = 1 0 1 0 1 0 
1 1 0 0 0 1
Exercise 1 (b,2)

 
◮ Given that G is written under the form: G= P Ik , then
the parity check matrix H is given by:

H = In−k P T
 
 
1 0 0 0 1 1
= 0 1 0 1 0 1 
0 0 1 1 1 0
Exercise 1 (c)

First Method:
◮ The Hamming weights of the non-zero codewords are:

wH (c2 ) = 3 ; wH (c3 ) = 3 ; wH (c4 ) = 4 ; wH (c5 ) = 3


wH (c6 ) = 4 ; wH (c7 ) = 4 ; wH (c8 ) = 3

implying that dmin = 3.


Second Method:
◮ Inspecting the matrix H, we observe that there no all-zero
columns and no identical columns. On the other hand, the
sum of the first, second and last columns of H is equal to zero
implying that dmin = 3.
Exercise 1 (d,e)

◮ The code can detect dmin − 1 = 2 (or fewer) errors.


j k
◮ The code can correct t = dmin2−1 = 1 error.
◮ The error rate can be determined from:
n  
X n i
Pe = p (1 − p)n−i
i
i =t+1
   
n 6 2
≈ p t+1
= p = 15p 2 = 15 × 10−6
t +1 2
Exercise 1 (f)

◮ The Hamming distances between the received r and the


different codewords are as follows:

dH (r , c1 ) = 4 ; dH (r , c2 ) = 5 ; dH (r , c3 ) = 1 ; dH (r , c4 ) = 4
dH (r , c5 ) = 3 ; dH (r , c6 ) = 2 ; dH (r , c7 ) = 2 ; dH (r , c8 ) = 3

implying that the most probable transmitted codeword is


c3 = (101010).
Exercise 2

◮ Since G has 2 rows and 8 columns, then k = 2 and n = 8.


 
◮ Given that G is written under the form: G = P Ik
(message bits at the end of the codeword), then the parity
check matrix H is given by:

H = In−k P T
 
 
1 0 0 0 0 0 1 0
 0 1 0 0 0 0 1 0 
 
 0 0 1 0 0 0 0 1 
= 
 0 0 0 1 0 0 0 1 

 0 0 0 0 1 0 1 1 
0 0 0 0 0 1 1 1

◮ Since there are no 1, 2, 3 or 4 columns whose sum is zero,


then dmin = 5.
Exercise 3 (a)
◮ There are k = 4 message bits and n − k = 4 parity bits
implying that (n, k) = (8, 4).
◮ Following from the parity-check equations:
 
1 0 0 0 1 1 1 0
 0 1 0 0 1 0 1 1 
G =  0 0 1 0 0 1 1 1 

0 0 0 1 1 1 0 1
 
◮ Given that G is written under the form: G = Ik P , then
the parity check matrix H is given by:

H = P T In−k
 
 
1 1 0 1 1 0 0 0
 1 0 1 1 0 1 0 0 
=  1 1 1 0 0 0 1 0 

0 1 1 1 0 0 0 1
Exercise 3 (b,c,d)

◮ There are no 1, 2 or 3 columns of H whose sum is zero. On


the other hand, the sum of the first, fifth, sixth and seventh
columns of H is zero implying that dmin = 4.
◮ For r = [10101010]:

rH T =
 
0 0 1 1

implying that it is not a codeword.


◮ For r = [10001110]:

rH T =
 
0 0 0 0

implying that it is a codeword.


Exercise 4 (1)

◮ Write H under the following form:


 
1 a1 a2 1 0 0 0
 0 b1 b2 0 1 0 0 
H=  1 c1

c2 0 0 1 0 
1 d1 d2 0 0 0 1

◮ Given that r = [0110011] is a codeword, then rH T = [0 0 0 0]


implying that:

a1 + a2 = 0 ⇒ a1 = a2
b1 + b2 = 0 ⇒ b1 = b2
c1 + c2 + 1 = 0 ⇒ c1 = c2
d1 + d2 + 1 = 0 ⇒ d1 = d2
Exercise 4 (2)
 
◮ Given that H is written under the form H = P In−k ,
then the generator matrix G can be written as:
 
1 0 0 1 0 1 1
T
 
G = Ik P =  0 1 0 a b c d 
0 0 1 a b c d

◮ Given that the second row of G is a codeword, then its


Hamming weight must be at least equal to 4.
◮ Consequently, at least 3 bits among [a b c d] must be equal to
1.
◮ Given that the third row of G is a codeword, then its
Hamming weight must be at least equal to 4.
◮ Consequently, at least 3 bits among [a b c d] must be equal to
1.
◮ It can be easily verified that the above conditions are satisfied
if and only if a = b = 1 and one bit among c or d is equal to
1.
Exercise 4 (3)
◮ For [a b c d] = [1 1 1 0]:
 
1 1 1 1 0 0 0
 0 1 1 0 1 0 0 
H=  1

1 0 0 0 1 0 
1 0 1 0 0 0 1
◮ For [a b c d] = [1 1 0 1]:
 
1 1 1 1 0 0 0
 0 1 1 0 1 0 0 
H=  1

0 1 0 0 1 0 
1 1 0 0 0 0 1
◮ Note that the above matrices are equivalent (simply the
second and third columns are interchanged).
◮ It can be easily seen that there are no 1, 2 or 3 columns of H
whose sum is equal to zero. On the other hand, the sum of
the first, fourth, sixth and seventh columns of H is zero
implying that dmin = 4.
Exercise 5 (a)
◮ G has k rows and n1 + n2 columns implying that the code
generated by G is a (n1 + n2 , k) code.
◮ Any codeword x can be written as x = [x1 x2 ] where x1 and
x2 are codewords of the codes generated by G1 and G2 ,
respectively:
x1 = uG1 ; x2 = uG2
◮ If u = [0 · · · 0], then x1 = x2 = [0 · · · 0] implying that x is equal
to the all-zero codeword having a Hamming weight of zero.
◮ If u 6= [0 · · · 0] then x1 6= [0 · · · 0] and x2 6= [0 · · · 0]. In this
case: wH (x) = wH (x1 ) + wH (x2 ) with wH (x1 ) 6= 0 and
wH (x2 ) 6= 0.
◮ The above analysis implies that the minimum distance of the
code generated by G satisfies the relation:
dmin ≥ d1 + d2
with equality if and only if the codeword x1 having the
minimum weight d1 and the codeword x2 having the minimum
weight d2 are generated by the same input sequence u.
Exercise 5 (b,1)
 
◮ Matrix G can be written as G = G1 G2 where:
 
1 0 0 0 1
 0 1 0 0 1   
G1 =  0 0
 ⇒ H1 = 1 1 1 1 1
1 0 1 
0 0 0 1 1
implying that d1 = 2.
◮ Note that the code generated by G1 corresponds to the (5, 4)
parity-check code.
◮ Matrix G2 can be written as:
 
1 0 0 0 1 1 0  
 0 1 0 1 0 1 1 1 0 0
0 0 1 1  
G2 = 
 0 0 1 ⇒ H2 =  1 1 0 1 0 1 0 
0 1 0 1 
0 1 1 1 0 0 1
0 0 0 1 1 1 1
implying that d2 = 3.
◮ Note that the code generated by G2 corresponds to the (7, 4)
Hamming code.
Exercise 5 (b,2)

◮ Consequently: dmin ≥ d1 + d2 implying that dmin ≥ 5.


◮ On the other hand, the first row of G (which is a codeword)
has a Hamming weight of 5. Consequently, dmin = 5.

Das könnte Ihnen auch gefallen