You are on page 1of 5

Discrete Maths CODING THEORY chapter 3

Hamming Metric
Consider a word x Zm2. x = x1 x2 x3. xm Zm2. xi {0,1}
The Number of 1s in x is Weight of x denoted by wt(x) or | x |
Example: wt(x) = wt(1011101) = 5
wt(x) = wt(1111001111) = 8
Hamming distance: x = x1 x2 x3. xm , y = y1 y2 y3. Ym Zm2.Then
the Hamming Distance, (d (x,y)) between x and y is the NUMBER of positions in which
xi

yi

d (x,y)) is also same as NUMBER of 1s in


Example1:

x = 101110101010
y = 011010111111
d (x , y)= 6
x + y = 110100010101

ALSO
and

wt(x + y ) = 6

d(x,y) = wt(x + y )
= is no.of 1s in x + y

Example2: (x) = (1011101) = 5


(y) = (0110101) = 5
d (x,y)= 3
ALSO x + y = (1101001)
and wt(x + y ) =3
d(x,y) = wt(x + y )

x+ y

Theorems
Theorem1: For all x , y Zm2.
Wt(x+y ) Wt(x ) + Wt(x+y )

Theorem 2: For all x , y ,z


Zm2.
(i)

d (x , y)= d (x , y)

(ii)

d (x , y) 0

(iii)

d (x , y) = 0 if and only if x = y

(iv)

d (x , y)+ d (y , z) d (x , z)

Function d is known as metric


hence d is known as distance OR metric Or Hamming metric
The pair (Zm2 ,d) is known as Hamming metric space.

Sphere: For a Zm2 and positive integer k


S(a,k)= {x Zm2 / d (x ,a) k } is called sphere of radius k with centre a.
For a= 011
S(a,2) = {000,100,010,110,101,011,111}
}
Minimum distance:
E: Z22 Z62 E is Triple repetition code
E(00)=000000

E(11)=111111 E(10)=101010

E(01)=010101

d(E(00) , E(11)) =6 d(E(01) , E(11)) =3


d(E(00) , E(01)) =3

d(E(00) , E(10)) =3

d(E(01) , E(10)) =6

d(E(10) , E(11)) =3

Minimum distance ORMinimum distance of code words


OR Minimum E (min E ) = is 3

CORRECTION and DETECTION of errors

Question:1 If E: Z22 Z62 with min E 5 then


How many
(1) errors can be detected
(2) errors can be corrected
E(00)=000000

E(11)=111111 E(10)=101010

E(01)=010101

ANS 1
=5
(1) errors of weight -1 = 5-1 =4be detected
(2) errors of weight ( -1 )/2= 2 can be corrected

Question:2 If E: Z22 Z62


FIND
(1) min E then
(2) error detecting capacity
(3) errors correcting capacity
Where E(00)=000000

E(11)=111111

E(10)=101010

E(01)=010101

Ans 2
d(E(00) , E(11)) =6 d(E(01) , E(11)) =3
d(E(00) , E(01)) =3

d(E(00) , E(10)) =3

d(E(01) , E(10)) =6

d(E(10) , E(11)) = 3

(1)min E = is 3

(2) error detecting capacity:


E can detect errors with weight
= -1 = 5-1 =4
(3) errors correcting capacity:

errors of weight (
-1 )/2= 2 can be corrected

Question:3 If E: Z32 Z62


FIND (1) min E then
(2) error detecting capacity
(3) errors correcting capacity
Where E(000)=000111

E(001)=001001

E(110)=110001

E(101)=101010

ANS 3First Distnces are found


d(E(000), E(001)) =3 d(E(100), E(010)) =4
d(E(000), E(010)) =3

d(E(100), E(001)) =4

d(E(000), E(100)) =3

d(E(100), E(110)) =3

d(E(000), E(110)) =4

d(E(100), E(101)) =3

d(E(000), E(101)) =4

d(E(100), E(011)) =3

d(E(000), E(011)) =4

d(E(100), E(111)) =3

d(E(000), E(111)) =6
d(E(010), E(001)) =4 d(E(001), E(110)) =3
d(E(010), E(110)) =3 d(E(001), E(101)) =3
d(E(010), E(101)) =3 d(E(001), E(011)) =2
d(E(010), E(011)) =3 d(E(001), E(111)) =2
d(E(010), E(111) =3
d(E(110), E(101)) =4 d(E(101), E(011)) =3
d(E(110), E(011)) =4 d(E(101), E(111)) =2
d(E(110), E(111)) =2 d(E(011), E(111)) =2
Min E =2 =
error detecting capacity:
=E can detect errors with weight
= -1 = 2-1 =1
(3) errors correcting capacity

E(010)=010010
E(011)=011100

E(100)=100100
E(111)=111000

= errors of weight (
-1 )/2= 1/ 2 can be corrected This means E cannot correct any error

You might also like