• Keine Ergebnisse gefunden

Distance and rate of a code

N/A
N/A
Protected

Academic year: 2022

Aktie "Distance and rate of a code"

Copied!
32
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Topics in Algebra: Cryptography

Univ.-Prof. Dr. Goulnara ARZHANTSEVA

WS 2019

(2)

Codes and Expanders

Cryptography:

Symmetric and asymmetric cryptosystems;

One-way functions, Hash functions;

Key management, Digital Signatures, Applications;

Pseudorandom generators.

Encoding, Error-correction.

(3)

Code

LetP be a finite set of possible messages.

Definition: Code

Acodeis a subsetC ⊂ {0,1}nwith|C|=|P|, and anencodingis given by abijectivemapψ:P →C.

Linear code

Alinear codeC is a code withP ={0,1}k for somek <n, and encoding is done by a linear operator (agenerating matrix) AC ∈Fk2×n:

ψ(v) =vTAC.

A linear codeC is a linear subspace of{0,1}nofdimensionk, whose basis is given by the rows ofk×nmatrixAC.

(4)

Code

LetP be a finite set of possible messages.

Definition: Code

Acodeis a subsetC ⊂ {0,1}nwith|C|=|P|, and anencodingis given by abijectivemapψ:P →C.

Linear code

Alinear codeC is a code withP ={0,1}k for somek <n, and encoding is done by a linear operator (agenerating matrix) AC ∈Fk2×n:

ψ(v) =vTAC.

A linear codeC is a linear subspace of{0,1}nofdimensionk, whose basis is given by the rows ofk×nmatrixAC.

(5)

Distance and rate of a code

Forx,y ∈C, theHamming distancedH(x,y) = number of distinct bits Definition: Distance and rate

d(C) = min x,y C

x 6=y

dH(x,y), r(C) = log2|C|

n

The distance measures the ability to resolve corrupted bits.

Thedistance should be large: two codewords should be sufficiently dissimilar so that corruption of a single bit (or of a small number of bits) does not turn one codeword into another.

(6)

Distance and rate of a code

Forx,y ∈C, theHamming distancedH(x,y) = number of distinct bits Definition: Distance and rate

d(C) = min x,y C

x 6=y

dH(x,y), r(C) = log2|C|

n

The distance measures the ability to resolve corrupted bits.

Thedistance should be large: two codewords should be sufficiently dissimilar so that corruption of a single bit (or of a small number of bits) does not turn one codeword into another.

(7)

What code will correct t -bit errors?

If 2 bits are bad in a codeworda, the resulting (erroneous) codeworda0 is at distance 2 =dH(a,a0).

Such errors can be corrected ifd(a0,c)>3: the correct codewordais the closest toa0. Thus,d(C)>5 is required:

56d(C)6dH(a,c)6dH(a,a0) +dH(a0,c).

Similarly, we obtain the following result.

Observation

A code withd(C)>t+ (t+ 1) = 2t+ 1 can correctt-bit errors.

(8)

Distance and rate of a code

Forx,y ∈C, theHamming distancedH(x,y) = number of distinct bits Definition: Distance and rate

d(C) = min x,y C

x 6=y

dH(x,y), r(C) = log2|C|

n

The rate measures the number of information-bits.

For a linear code of dimensionk, the rate is logn22k = kn, the amount of non-redundant information per bit.

Therate should be large.

(9)

Distance versus rate

A sparser code has larger distance (i.e. more errors can be corrected) but smaller rate (i.e. smaller information-density).

Theorem: Quantifying the distance-rate tradeoff Hamming’1950 LetC⊂ {0,1}nbe a code andt=jd(C)−12 k. Then

|C|

2n 6 1 Pt

i=0 n i

A code isperfectif it achieves the Hamming bound.

(10)

Distance versus rate

Proof: Forx ∈ {0,1}n, B(x,t) ={y ∈ {0,1}n|dH(x,y)6t}is the ball of radiustcentered atx, with respect to the Hamming distance.

For allx,y ∈C,x 6=y, the setsB(x,t) andB(y,t) are disjoint.

Otherwise,dH(x,y)62t<d(C), contradicting the definition ofd(C).

EachB(x,t) has sizePti=0 ni. Their union is contained in{0,1}n, so

|C|

t

X

i=0

n i

! 62n

(11)

Distance versus rate

Example: the Hamming bound

A linear code of lengthn, dimensionk and distance 3 satisfies k 6n−log2(n+ 1)

Example: a Hamming code of length 7, dimension 4 and distance 3 For (x1,x2,x3,x4)∈ {0,1}4, we define

CHam(x1,x2,x3,x4) = (x1,x2,x3,x4,x2⊕x3⊕x4,x1⊕x3⊕x4,x1⊕x2⊕x4) 4 = 7−log2(7 + 1), hence,CHamhas the largest possible dimension for any binary code of length 7 and distance 3.

(12)

Distance of a linear code

Forc ∈Fn2, the supportsuppc = the set of positions with nonzero bits.

|suppc|= the number of nonzero bits, theweightofc.

Lemma: Distance of a linear code

For a linear codeC, we haved(C) = minc∈C,c6=0|suppc|.

Proof: Ifc,c0∈C, thenc⊕c0 ∈C, sinceCis linear. Then, dH(c,c0) =dH(0,c⊕c0) =|supp(c⊕c0)|.

(13)

Asymptotically good codes

Definition: Asymptotically good code

A familyCof codesCn⊂ {0,1}nasn→ ∞, isasymptotically goodif there exist constantsα, λ >0 such that for allCn∈ C,

d(Cn)

n > αandr(Cn)> λ.

We want both a constant-fraction number of errors and a constant rate.

We also want that encoding and decoding isin P, ideally inlinear time.

(14)

Bipartite graphs

Definition: A bipartite graph

A graph isbipartiteif there is a partition of its set of vertices into two (disjoint) subsetsSandT such that every edge has one endpoint vertex inSand another one inT.

Definition: An (l,r)-regular graph

A bipartite graph is (l,r)-regular if all vertices inShave degreel, and all vertices inT have degreer.

The complete graphK3,3is a bipartite graph. It is (3,3)-regular.

(15)

Bipartite expander graphs

Definition: Bipartite expander

A bipartite graphX is an(l,r, α, δ)-expanderif it is (l,r)-regular, and for all setsU⊂Swith|U|6α|S|, we have|∂U|> δ|U|.

∂U denotes theexternal boundaryof the setU = the set of vertices at distance 1 fromU, in the edge-length distance onX.

Here,α, δ >0 are real constants andl,r are positive integers.

Small subsets ofShave big enough boundary: they are‘expanding’.

(16)

Parity check matrix

LetS ⊂Fr2be anr-bit linear code of dim.k withparity check matrixPS: c ∈S⇐⇒PSc = 0.

The (r−k)×r matrixPS describes linear relations that hold∀c ∈S.

Rows ofAS spanSand rows ofPSspanS.

That is,PSATS = (0), the zero matrix of size (r −k)×k.

By a changing of basis ofFr2, we writeAS = (IkM), whereIk thek ×k identity matrix.

Then,PS = (MTIr−k).

(17)

Parity check matrix

LetS ⊂Fr2be anr-bit linear code of dim.k withparity check matrixPS: c ∈S⇐⇒PSc = 0.

The (r−k)×r matrixPS describes linear relations that hold∀c ∈S.

Rows ofAS spanSand rows ofPSspanS.

That is,PSATS = (0), the zero matrix of size (r −k)×k.

By a changing of basis ofFr2, we writeAS = (IkM), whereIk thek ×k identity matrix.

Then,PS= (MTIr−k).

(18)

Towards expander codes

LetX be an (l,r)-regular expander whosel-degree side hasnvertices andl <r.

We will extend anr-bit linear codeS to ann-bit linear codeC(X,S).

This will allow to produce an asymptotically good family of codes.

(19)

Expander codes

Let{u1, . . . ,un}benvertices on thel-degree side ofX.

Then ther-degree side has (l·n)/r vertices, say{v1, . . . ,vln/r}.

Letσbe a function such that fori= 1, . . . ,ln/r, the neighbours ofvi are uσ(i,1), . . . ,uσ(i,r)

Definition: C(X,S)

C(X,S) ={(x1, . . . ,xn)∈Fn2 | ∀iwe have (xσ(i,1), . . . ,xσ(i,r))∈S}

(20)

Expander codes

Lemma: Expander code is linear C(X,S) is a linear code.

Proof: IfBX,i is the 0−1 matrix that maps (x1, . . . ,xn) to

(xσ(i,1), . . . ,xσ(i,r)), of sizer ×n, then the parity check matrixPC(X,S)is the matrix whose rows are the union of the rows of the matrices

PSBX,i, each of size (r −k)×n, fori = 1, . . . ,ln/r.

(21)

Expander code

Theorem: Expander code Sipser-Spielman’1994

Suppose thatX is an (l,r, α,l/r)-expander, andShas rate

R >1−1/l and normalised distanced(S)/r =. ThenC(X,S) has rate at least 1−l(1−R) and normalised distance at leastα.

Proof: Each matrixPSBX,i hasr −k = (1−R)·r rows. So, the parity check matrix ofC(X,S) has

l·n

r (1−R)r =ln(1−R) rows.

This spansC(X,S). Hence, the dimension ofC(X,S) is at least n−ln(1−R), and rate of at least n−ln(1−R)n = 1−l(1−R).

Next we bound the normalised distanced(C(X,S))/n.

(22)

Expander code

Theorem: Expander code Sipser-Spielman’1994

Suppose thatX is an (l,r, α,l/r)-expander, andShas rate

R >1−1/l and normalised distanced(S)/r =. ThenC(X,S) has rate at least 1−l(1−R) and normalised distance at leastα.

Proof: Each matrixPSBX,i hasr −k = (1−R)·r rows. So, the parity check matrix ofC(X,S) has

l·n

r (1−R)r =ln(1−R) rows.

This spansC(X,S). Hence, the dimension ofC(X,S) is at least n−ln(1−R), and rate of at least n−ln(1−R)n = 1−l(1−R).

Next we bound the normalised distanced(C(X,S))/n.

(23)

Expander code: Theorem (suite)

Suppose by contradiction that there isc ∈C(X,S) with|suppc|6αn.

LetUbe the vertices inX corresponding to the coordinates ofsuppc.

By the expansion of the graph,|∂U|> rl|U|.There arel|U|edges fromUtoX \U, so somevi∂Uhas<rneighbours inU.

Then, (xσ(i,1), . . . ,xσ(i,r))∈Shas <r 1-bits, contradicting the hypothesis that the normalised distance ofS is.

(24)

Asymptotically good error-correcting codes

Corollary

If (Xi)i>1is a family of (l,r, α,l/r)-expanders withnvertices of its l-degree side, asn→ ∞, thanC(Xi,S)i>1are asymptotically good error-correcting codes.

(25)

Expander code: Example

Expander code from the even-weight code

LetSeven⊂Fr2be the code consisting of all even-weight codewords.

ThenPSeven = (1 1 · · ·1), the normalised distance ofSevenis 2/r and the rateR= 1−1/r.

IfX is an (l,r, α,l/2)-expander, then, by the Theorem,C(X,Seven) has the normalised distance at leastα and the rate at least 1−l/r.

(26)

Linear error-correcting (without proof)

Theorem: Linear decoding Sipser-Spielman’1994 IfX is an (l,r, α,34l)-expander, then the codeC(X,Seven) permits an α/2 fraction of errors to be corrected in linear time.

C(X,Seven) has normalised distance at leastαand rate at least 1−l/r.

(27)

Linear error-correcting

There is a linear-time algorithm that will map to a codeword any word of relative distance at mostαfrom that codeword, for some positive constantα.

Algorithm

While not all constraints are satisfied, find a variablexi in more unsatisfied than satisfied constraints, and switchxi.

C(X,Seven) hasnvariablesand (l·n)/r constraints.

Given (x1, . . . ,xn)∈ {0,1}n, a constraintviissatisfiedif

(xσ(i,1), . . . ,xσ(i,r))∈Seven, i.e. the mod2 sum of the coordinates is zero.

Otherwise, it isunsatisfied.

One shows that the algorithm terminates after linear number of switches and can be implemented in linear time.

(28)

Linear error-correcting

There is a linear-time algorithm that will map to a codeword any word of relative distance at mostαfrom that codeword, for some positive constantα.

Algorithm

While not all constraints are satisfied, find a variablexi in more unsatisfied than satisfied constraints, and switchxi.

C(X,Seven) hasnvariablesand (l·n)/r constraints.

Given (x1, . . . ,xn)∈ {0,1}n, a constraintviissatisfiedif

(xσ(i,1), . . . ,xσ(i,r))∈Seven, i.e. the mod2 sum of the coordinates is zero.

Otherwise, it isunsatisfied.

One shows that the algorithm terminates after linear number of switches and can be implemented in linear time.

(29)

Asymptotically good linear time error-correcting codes

Corollary

If (Xi)i>1is a family of (l,r, α,34l)-expanders withnvertices of its l-degree side, asn→ ∞, thanC(Xi,Seven)i>1are asymptotically good linear time error-correcting codes.

(30)

Existence and constructions of expanders: Remarks

Theorem: Existence of expanders Kolmogorov-Barzdin’1968 A random (bipartite) graph is an expander.

The above definition of expander can be adapted to usual (not necessarily) bipartite graphs.

Examples of explicit (non bipartite) expanders can be produced by takingbox spaces of finitely generated residually finite groups with Kazhdan’s property (T).

SL3(Z) is such a group andSL3(Z/pZ) as primep→ ∞is such an (explicit) expander.

(31)

Existence and constructions of expanders: Remarks

A usual expander gives a bipartite expander: take two copies of the vertex set for each finite graph and have an edge between vertices in different copies if and only if there is an edge between these vertices in the original graph.

Expander graphs are ubiquitous in mathematics and computer science!

(32)

Test questions

Question 27

Is the Hamming distance indeed a distance?

Question 28

Given a linear codeC, is its generating matrix uniquely defined?

Question 29

Is the complete graphK3,3a bipartite expander?

Question 30

LetY is a non bipartite expander with the expansion parameterλ.

What is the expansion parameter of the bipartite expanderX

constructed fromY as in the previous slide. What about the diameter and the girth ofX (given the diameter and the girth ofY)?

Referenzen

ÄHNLICHE DOKUMENTE

The book is at times difficult to read and understand, for although it contains a number of sketches of daily life in the towns and villages of southern Russia, it was in Graham’s

Philippic 2 is conceived as Cicero’s (imaginary) response to the verbal abuse Antony had hurled at him in a meeting of the senate on 19 September, but was in all likelihood

19 Representative examples of existing dedicated digital humanities degrees include the MA in Digital Humanities programs at Loyola University Chicago (supported by the Center

We find a large, significant, positive relationship between gender gaps in policy priorities and gender gaps in political participation; put simply, it is exactly in places

The Three-Hares-Window in the late Gothic cloister of the Paderborn Cathedral is not only one of the town’s landmarks but at the same time the most famous Three-Hares-Motif

IMPORTANT: Please take a moment to check that you have received the following software and documentation in your 3+0pen for Macintosh package.. If you have not received all of

The connector board connects the power supply outputs to the buffer board.. The connector board also has bypass connectors and a connection for the front

Con be used with o single oddress to chonge sign of field Product in low-order. ions of