Coding Theory

Coding Theory
Ruud Pellikaan
[email protected]
MasterMath 2MMC30
Lecture 3.1
March 3 - 2016
/k
Introduction
Lectures 3 and 4 treat the existence and nonexistence of codes
Several constructions show that the existence of one particular code
gives rise to a cascade of derived codes
Upper bounds in terms of the parameters exclude codes
and lower bounds show the existence of codes
/k
2/31
Content lecture 3
1. Making codes shorter and longer
•
•
•
•
Puncturing
Extension
Shortening
Augmentation
2. Several sum constructions
3. Product and concatenated code
/k
3/31
Puncturing
4/31
Let C be an [n, k , d ] code
Puncturing is the process of deleting one or more given coördinates
Let P be a subset of {1, . . . , n} consisting of p integers such that
its complement is the set {i1 , . . . , in−p } with 1 ≤ i1 < · · · < in−p ≤ n
Let x ∈ Fnq . Define
xP = (xi1 , . . . , xin−p ) ∈ Fn−p
q
Let CP be the set of all punctured codewords of C
where the puncturing takes place at all the positions of P :
CP = { cP | c ∈ C }.
/k
Restriction
5/31
Restriction with respect to non-punctured positions
Let R be a subset of {1, . . . , n} consisting of r integers
{i1 , . . . , ir } with 1 ≤ i1 < · · · < ir ≤ n
Let x ∈ Fnq . Define
x(R ) = (xi1 , . . . , xir ) ∈ Frq
Let C(R ) be the set of all codewords of C restricted to the positions of R :
C(R ) = { c(R ) | c ∈ C }
/k
Generators of punctured code
CP is a code of length n − p where p is the number or elements of P
Furthermore CP is linear, since C is linear
Let G be a generator matrix of C
Then CP is a linear code generated by the rows of GP
where GP is the k × (n − p) matrix consisting of
the n − p columns at the positions i1 , . . . , in−p of G
Consider the restricted code
Then C(R ) is generated by the rows of G(R )
where G(R ) is the k × r submatrix of G composed of
the columns indexed by j1 , . . . , jr , where R = {j1 , . . . , jr }
/k
6/31
Example
The generator matrix of the [7,4,3] binary Hamming code is given by


1 0 0 0 0 1 1
 0 1 0 0 1 0 1 

G =
 0 0 1 0 1 1 0 
0 0 0 1 1 1 1
Puncturing at P = {1, 4} gives the generator matrix


0 0 0 1 1
 1 0 1 0 1 


 0 1 1 1 0 
0 0 1 1 1
/k
7/31
PROPOSITION
Let C be an [n, k , d ] code
Suppose P consists of p elements
Then the punctured code CP is an [n − p, kP , dP ] code with
d − p ≤ dP ≤ d and k − p ≤ kP ≤ k .
If moreover p < d , then kP = k
/k
8/31
PROOF
Let c ∈ C
Then at most p nonzero positions are deleted from c to obtain cP
Hence wt(cP ) ≥ wt(c) − p and dP ≥ d − p
The column rank of G , which is equal to the row rank, is k
The column rank of GP must be greater than or equal to k − p
since p columns are deleted
This implies that the row rank of GP is at least k − p
So kP ≥ k − p
Suppose p < d
If c and c0 are two distinct codewords in C
then d (cP , c0P ) ≥ d − p > 0 so cP and c0P are distinct
Therefore C and CP have the same number of codewords
Hence k = kP
/k
9/31
Example
The generator matrix of the [7,4,3] binary Hamming code is given by


1 0 0 0 0 1 1
 0 1 0 0 1 0 1 

G =
 0 0 1 0 1 1 0 
0 0 0 1 1 1 1
Puncturing at P = {1, 4, 5} gives the matrix


0 0 1 1
 1 0 0 1 


 0 1 1 0 
0 0 1 1
The last row is superfluous for a generator matrix
/k
10/31
Extension
11/31
Let C be an Fq -linear code of length n and v ∈ Fnq
The extended code C e (v) of length n + 1 is defined as follows
For every codeword c = (c1 , . . . , cn ) ∈ C
construct the word ce (v) by adding the symbol cn+1 (v) ∈ Fq
at the end of c such that the following parity check holds
v1 c1 + v2 c2 + · · · + vn cn + cn+1 = 0.
Now C e (v) consists of all the codewords ce (v)
where c is a codeword of C
In case v is the all-ones vector, then C e (v) is denoted by C e
/k
Extension
12/31
Let C be an [n, k ] code
Then it is clear that C e (v) is a linear subspace of Fn+1
of dimension k
q
e
So C (v) is an [n + 1, k ] code
Suppose G is a generator and H a parity check matrix of C
Then C e (v) has a generator matrix G e (v) and a parity check matrix H e (v)




v1 v2 · · · vn
1
g1n+1


g2n+1 
0 




e
H
(v)
=
G e (v) =  G


..
..  ,
H



.
. 
gkn+1
0
where the last column of G e (v) has entries
gin+1 = −
n
X
j =1
/k
gij vj
Extended Hamming code
13/31
The generator matrix of the [7,4,3] binary Hamming code is given by


1 0 0 0 0 1 1
 0 1 0 0 1 0 1 

G =
 0 0 1 0 1 1 0 
0 0 0 1 1 1 1
and has extended code with generator matrix

1 0 0 0 0 1

0 1 0 0 1 0
Ge = 
 0 0 1 0 1 1
0 0 0 1 1 1
It is a [8,4,4] code
/k
1
1
0
1

1
1 

1 
0
Extended Hamming code
14/31
The parity check matrix of the [7,4,3] binary Hamming code is given by


0 1 1 1 1 0 0
H = 1 0 1 1 0 1 0 
1 1 0 1 0 0 1
and has extended code with parity check matrix

1 1 1 1 1 1 1

0 1 1 1 1 0 0
He = 
 1 0 1 1 0 1 0
1 1 0 1 0 0 1
/k

1
0 

0 
0
PROPOSITION
Let C be an [n, k , d ] code
Then C e has parameters [n + 1, k , de ]
with d ≤ de ≤ d + 1
If moreover C is a binary code
then de = d if d is even and de = d + 1 if d is odd
/k
15/31
PROOF
16/31
If C is an [n, k , d ] code, then C e is an [n + 1, k ] code
The minimum distance de of the extended code satisfies d ≤ de ≤ d + 1
since wt(c) ≤ wt(ce ) ≤ wt(c) + 1 for all c ∈ C
Suppose moreover that C is a binary code
- If d is even
Then there is a codeword c of weight d and ce is obtained form c
by extending with a zero. So ce has also weight d
- If d is odd, then the claim follows, since all the codewords of the
extended code C e have even weight by the parity check
c1 + · · · + cn+1 = 0
/k
Binary Hamming and simplex codes
The binary [2r − 1, 2r − r − 1, 3] Hamming code H r (2)
has the extension Hr (2)e with parameters [2r , 2r − r − 1, 4]
The binary [2r − 1, r, 2r−1 ] Simplex code Sr (2)
has the extension Sr (2)e with parameters [2r , r, 2r−1 ]
/k
17/31
PROPOSITION
18/31
Puncturing at the last position and extending and are inverse operations
Let C be an Fq -linear code of length n and v in Fnq
If P = {n + 1} and Q = {n}, then
(C e (v))P = C
If the all-ones vector is a parity check of C , then
(CQ )e = C
PROOF
The first statement is a consequence of the fact that (ce (v))P = c
The last statement is left as an exercise
/k
Puncturing extended Hamming code
Puncturing extended Hamming code

1 0 0 0

0 1 0 0
Ge = 
 0 0 1 0
0 0 0 1
gives the [7,4,3] binary Hamming back

1 0 0 0
 0 1 0 0
G =
 0 0 1 0
0 0 0 1
0
1
1
1
0
1
1
1
1
0
1
1
1
0
1
1
19/31
1
1
0
1

1
1 

1 
0

1
1 

0 
1
Puncturing of the extended binary Hamming code Hr (2)e
gives the original Hamming code back.
/k
Shortening
20/31
By puncturing a subcode appropriately, we can get a new code
Let C be an [n, k , d ] code
Let S be a subset of {1, . . . , n}
Let C (S ) be the subcode of C of all c ∈ C such that ci = 0 for all i ∈ S
The shortenedcode C S is defined by
C S = (C (S ))S
It is obtained by puncturing the subcode C (S ) at S
/k
Example
The generator matrix of the [7,4,3] binary Hamming code is given by


1 0 0 0 0 1 1
 0 1 0 0 1 0 1 

G =
 0 0 1 0 1 1 0 
0 0 0 1 1 1 1
Shortening at S = {1, 4} gives the generator matrix
1 0 1 0 1
0 1 1 1 0
/k
21/31
PROPOSITION
22/31
Let C be an [n, k , d ] code
Suppose S consists of s elements
Then the shortened code C S is an [n − s, kS , dS ] code with
k − s ≤ kS ≤ k
and d ≤ dS
PROOF
The dimension of C S is equal to the dimension of the subcode C (S ) of C
C (S ) is defined by s homogeneous linear equations of the form ci = 0
This proves k − s ≤ kS ≤ k
Now d (C S ) = d (C (S )) and C (S ) is a subcode of C
Hence d ≤ dS
/k
Example
Consider the generator matrix of the [7,4,2] code given by


1 0 0 0 0 1 1
 0 1 0 0 1 0 1 

G =
 0 0 1 0 1 0 0 
0 0 0 1 1 1 1
Shortening at S = {1, 4, 6} gives the generator matrix
1 0 1 1
0 1 1 0
/k
23/31
Duality of puncturing and shortening

1
 0

 0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
1
1
1
1
0
1
1
1
1
0
1


1
0 1
 1 0
dual
1 
 ←→ 
 1 1
1 
1 1
0
↓ shorten at first position

/k
1
1
0
1
1
1
1
0
1
0
0
0
0
1
0
0
0
0
1
0

0
0 

0 
1
↓ puncture at first postion


1 0 0 1 0 1 1
 0 1 0 1 1 0 1 
0 0 1 1 1 1 0
24/31
dual
←→
1
 0

 1
1
1
1
0
1
1
1
1
0
1
0
0
0
0
1
0
0
0
0
1
0

0
0 

0 
1
PROPOSITION
25/31
Let C be an [n, k , d ] code
Let P and S be subsets of {1, . . . , n}
Then
(CP )⊥ = (C ⊥ )P
(C S )⊥ = (C ⊥ )S
and
dim CP + dim(C ⊥ )P = n − |P |
dim C S + dim(C ⊥ )S = n − |S |
/k
REMARK
26/31
Let S consist of s elements and x ∈ Fn−s
q
Let xS ∈ Fnq be the unique word such that x = (xS )S
and the entries of xS at the positions of S are zero
by extending x with zeros appropriately
Then
x ∈ C S if and only if xS ∈ C
Furthermore
xS · y = x · yS for all x ∈ Fn−s
and y ∈ Fnq
q
/k
PROOF
Let x ∈ (CP )⊥ and z ∈ C
Then zP ∈ CP
So xP · z = x · zP = 0
Therefore (CP )⊥ ⊆ (C ⊥ )P
Conversely, let x ∈ (C ⊥ )P
Then xP ∈ C ⊥ and y ∈ CP
Then y = zP for some z ∈ C
So x · y = x · zP = xP · z = 0
Hence x ∈ (CP )⊥
Therefore (C ⊥ )P ⊆ (CP )⊥
The dimensions follow from the corresponding equality of the codes
Shortening of C with S follows from puncturing with S = P and duality
/k
27/31
Augmentation
If we want to increase the size of the code without changing the length
We can augment the code by adding a word which is not in the code
Let C be an Fq -linear code of length n
Let v in Fnq
The augmented code is defined by
C a (v) = { αv + c | α ∈ Fq , c ∈ C }.
If v is the all-ones vector then we denote C a (v) by C a
/k
28/31
Generator matrix augmented code
The augmented code C a (v) is a linear code
Suppose that G is a generator matrix of C
and v is not an element of C
Let G a (v) be the (k + 1) × n matrix obtained by adding v to G
Then G a (v) is a generator matrix of C a (v)
/k
29/31
PROPOSITION
Let C be a code of minimum distance d
Suppose that the vector v is not in C and has weight w
Then
min{d − w, w} ≤ d (C a (v)) ≤ min{d , w}
In particular d (C a (v)) = w if w ≤ d /2
/k
30/31
PROOF
C is a subcode and v is an element of the augmented code
This implies the upper bound
The lower bound is trivially satisfied if d ≤ w
Suppose w < d
Let x be a nonzero element of C a (v)
Then x = αv + c for some α ∈ Fq and c ∈ C
If α = 0, then wt(x) = wt(c) ≥ d > w
If c = 0, then wt(x) = wt(v) = w
If α 6= 0 and c 6 = 0, then c = αv − x
So d ≤ wt(c) ≤ w + wt(x)
Hence d − w ≤ wt(x)
If w ≤ d /2, then the upper and lower bound are both equal to w
/k
31/31