0% found this document useful (0 votes)
39 views27 pages

Perfect Codes: DR D D Karunaratna

1) A code is perfect if it achieves equality in the sphere-packing bound, meaning the spheres of radius t centered on each codeword fill the space without overlaps. 2) Binary codes with parameters (3,2,3), (5,2,5), and (7,2,7) are perfect codes. 3) A binary repetition code of odd length n is a perfect code.

Uploaded by

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

Perfect Codes: DR D D Karunaratna

1) A code is perfect if it achieves equality in the sphere-packing bound, meaning the spheres of radius t centered on each codeword fill the space without overlaps. 2) Binary codes with parameters (3,2,3), (5,2,5), and (7,2,7) are perfect codes. 3) A binary repetition code of odd length n is a perfect code.

Uploaded by

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

Perfect codes

Dr D D Karunaratna
Spheres defined in (Fq)n
 Definition : For any vector u in (Fq)n and any integer r ≥ 0,
the sphere of radius r and centre u, denoted by S(u,r), is the
set {v  (Fq)n | d(u,v) ≤ r}

(Fq)n

u
r
Spheres defined in (Fq)n
 Now consider a code C such (Fq)n
that d(C ) ≥ 2t + 1 for some
positive integer t. v
u
 Question: Can the spheres with
radius t of the code words of C
be overlapping?
Spheres defined in (Fq)n
 Assume that spheres of two (Fq)n
code words u and v overlaps.
Let a vector y in the y v
overlapping area. u

d(u,y) ≤ t and d(y,v) ≤ t


d(u,v) ≤ d(u,y) + d(y,v) ≤ t + t
d(u,v) ≤ 2t # d(C ) ≥ 2t + 1
Spheres defined in (Fq)n
 If C is a code such that d(C ) ≥ (Fq)n
2t + 1 for some positive integer
t.
u
 Then spheres of code v

words of C with radius t


are disjoint (not
overlapping)
Spheres defined in (Fq)n
 If a code C is such that d(C ) ≥ 2t + 1 for some positive
integer t, then the spears of code words with radius t can be
visualised as shown in the following diagram.

(Fq)n

u t v t

m t n t
Spheres defined in (Fq)n
1) Can we correct any vector received in a transmission if it lies inside a sphere of a
code word? For example the vector x
2) To which codeword should we convert that vector?
3)Can we correct any vector received in a transmission if it lies outside a sphere of a
code word? For example the vector y.
4) Up to how many errors in a received vector can be corrected?

(Fq)n
x
u t v t
y

m t n t
Spheres defined in (Fq)n
1) Can we correct any vector received in a transmission if it lies inside a sphere of a
code word? For example the vector x - Yes
2) To which codeword should we convert that vector? To the vector u
3)Can we correct any vector received in a transmission if it lies outside a sphere of a
code word? For example the vector y. No
4) Up to how many errors in a received vector can be corrected? t errors

(Fq)n
x
u t v t A code C can correct up to t errors in any
y codeword if d(C ) ≥ 2t + 1

m t n t
Vectors having a specific distance from
a given vector.
 Let q = {0,1,2}. How many vectors in (Fq)3 have distance
exactly 2 from the vector 111?
Vectors having a specific distance from
a given vector.
 Let q = {0,1,2}. How many vectors in (Fq)3 have distance
exactly 2 from the vector 111?
1. Select any 2 position of 111. (This can be done in 3C2 ways.)
2. Fill each of these positions from a value in q other than 1.
Number of vectors having
111 111 111 distance exactly 2 from 111
=3x2x2
001 = 3C2 x (3-1)2
021
201
221
2 x 2 ways
Number of vectors in a spear.
 Let u be a vector in (Fq)n
Let m be an integer such that m ≤ r.
How many vectors have distance exactly m from u?

(Fq)n

m
u
r
Number of vectors in a spear.
 How many vectors have distance exactly m from u?
n
 
 Select m position from n positions in u. This can be  
m

done in nCm ways.


 Fill each of these position from a symbol different to the
symbol at the same location of u. That is each position
can be filled in q-1 different ways. Since there are m
positions to be filled all m positions can be filled in (q-
1)m ways.
 Thus the number of vectors having exactly m from u is
nC * (q-1)m
m
Number of vectors in a spear.
 The number of vectors inside the spear of the vector u with
radius r is (i.e inside the sphere S(u,r))
= nC0 * (q-1)0 + nC1 * (q-1)1 +…….+ nCr * (q-1)r
= 1 + nC1 * (q-1)1 +…….+ nCr * (q-1)r
Number of vectors in a spear.
Give a vector u in (Fq)n, the number of vectors in S(u,n) is
= 1 + nC1 * (q-1)1 +…….+ nCn * (q-1)n

For any integer x, (1 + x)n can be defined as


(1 + x)n = 1 + nC1 * x1 +…….+ nCn * xn (Binomial theorem)
Thus the number of vectors in S(u, n)
= 1 + nC1 * (q-1)1 +…….+ nCn * (q-1)n = (1 + (q-1))n
= qn

= | (Fq)n |
Sphere-packing (Hamming) Bound
 We have seen that the spheres or radius t of M code words of a q-
array(n,M,2t+1)-code are disjoint.

Total number of vectors in each of these sphere is =


= nC0 + nC1 * (q-1)1 +…….+ nCt * (q-1)t

Total number of vectors in all spheres of M code words


= M( nC0 + nC1 * (q-1)1 +…….+ nCt * (q-1)t)

This value should be less than or equal to the total number of vectors in
(Fq)n = q n
Sphere-packing (Hamming) Bound
 Theorem (sphere-packing or Hamming bound):
A q-array(n,M,2t+1)-code satisfies
M*(nC0 + nC1 * (q-1) +…….+ nCt * (q-1)t ) ≤ q n

 For a given values of q, n and d(=2t+1), the sphere-packing bound


provides an upper bound on the maximum value of M, i.e Aq(n,d).
 However, it does not mean that a code satisfying the sphere-packing
bound exists.
 A binary (n,M,2t+1)-code satisfies
M*(nC0 + nC1 * (2-1) +…….+ nCt * (2-1)t ) ≤ 2 n
M*(nC0 + nC1 +…….+ nCt ) ≤ 2 n
Sphere-packing (Hamming) Bound
 Assume a binary (n,M,2t+1)-code satisfies the following
condition
M*(nC0 + nC1 +…….+ nCt ) = 2 n

 What can you say about this code?


Sphere-packing (Hamming) Bound
 Assume a binary (n,M,2t+1)-code satisfies the following
condition
M*(nC0 + nC1 +…….+ nCt ) = 2 n

 What can you say about this code?


 Every vector in (F2)n is in one and only one sphere of a
code-word.
 When any code-word is distorted (up to t errors) during
transmission, it can be corrected.
Sphere-packing (Hamming) Bound ..
 Example :
What should be A2(5,3)?

A2(5,3) should satisfy the following inequality (d(c) =2t+1= 3 = 2 *1 + 1)


M*(5C0 + 5C1 ) ≤ 2 5
M( 1+ 5) ≤ 32
Maximum value for M to satisfy this equation is = 5
Thus A2(5,3) ≤ 5

 However, we have seen that binary(5,5,3) code does not exists and A2(5,3) = 4
00000
01101
10110
11011
Sphere-packing (Hamming) Bound ..
 Example :
What should be A2(7,3)?
Sphere-packing (Hamming) Bound ..
 Example :
What should be A2(7,3)?

A2(7,2*1+1) should satisfy


M*(7C0 + 7C1 ) ≤ 2 7
M( 1+ 7) ≤ 128
M ≤ 16
Maximum value for M to satisfy this equation is = 16
Thus A2(7,3) ≤ 16
Perfect Codes
 A code achieving the equality of sphere-packing bound is
called a perfect code.
 For a perfect t-error correcting code, the M spheres of radius t
centred on code words should fill the whole space (Fq)n
without overlapping.
 Every vector in (Fq)n at a distance ≤ t should merge to a single
vector (code word at the centre of the sphere).
Perfect Codes ……
 Compute the following:
 A2(3,3) = ?
 A2(5,5) = ?
 A2(7,7) = ?
Perfect Codes ……
 A2(3,3) = A(3,2*1+1)
 M*(1 + 3C1 ) ≤ 2 3
 M* 4 ≤ 8
 M≤2
A2(3,3) = 2
Thus a binary(3,2,3) is a perfect code
Perfect Codes ……
 A2(5,5) = A(5,2*2+1)
 M*(1 +5C1 +5C2 ) ≤ 2 5
 M* (1+ 5+ 10) ≤ 32
 M≤2
A2(5,5) = 2
Thus a binary(5,2,5) is a perfect code
Perfect Codes ……
 A2(7,7) = A(7,2*3+1)
 M*(1 +7C1 +7C2 + 7C3 ) ≤ 27
 M* (1+ 7+ 21 + 35) ≤ 128
 M *64≤ 128
A2(7,7) = 2

Thus a binary(7,2,7) is a perfect code.


Is a binary(n,2,n) is a perfect code when n is odd?
Perfect Codes ……
 When n is odd, A binary(n,2,n) is a perfect code.
 What can you say about the following binary repetition code of length n, where
n is odd? Is it a perfect code?

000…..0
111…...1

It is a perfect binary code


This is an example of a trivial perfect code

Also codes which contain just one codeword ( (n,1,n)-code) or the


whole of (F2)n ( (n,2n,1)-code) are called trivial perfect codes.
Finding all perfect codes is a challenging task in coding theory

You might also like