24.6 Golay Codes

Two of the most famous binary codes are the Golay codes G23G23 and G24G24. The [24, 12, 8] extended Golay code G24G24 was used by the Voyager I and Voyager II spacecrafts during 1979–1981 to provide error correction for transmission back to Earth of color pictures of Jupiter and Saturn. The (nonextended) Golay code G23G23, which is a [23, 12, 7] code, is closely related to G24G24. We shall construct G24G24 first, then modify it to obtain G23G23. There are many other ways to construct the Golay codes. See [MacWilliams-Sloane].

The generating matrix for G24G24 is the 12×2412×24 matrix G=G=

(100000000000111011100010010000000000101101110001001000000000110110111000000100000000101011011100000010000000100101101110000001000000100010110111000000100000110001011011000000010000111000101101000000001000111100010110000000000100101110001011000000000010110111000101000000000001011111111111).
100000000000010000000000001000000000000100000000000010000000000001000000000000100000000000010000000000001000000000000100000000000010000000000001111111111110101000111011110100011101011010001111101101000111110110100011111011010001011101101001001110110101000111011011100011101101010001110111.

All entries of GG are integers mod 2. The first 12 columns of GG are the 12×1212×12 identity matrix. The last 11 columns are obtained as follows. The squares mod 11 are 0, 1, 3, 4, 5, 9 (for example, 423423 and 725725). Take the vector (x0, , x10)=(1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0)(x0, , x10)=(1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0), with a 1 in positions 0, 1, 3, 4, 5, 9. This gives the last 11 entries in the first row of GG. The last 11 elements of the other rows, except the last, are obtained by cyclically permuting the entries in this vector. (Note: The entries are integers mod 2, not mod 11. The squares mod 11 are used only to determine which positions receive a 1.) The 13th column and the 12th row are included because they can be; they increase kk and dd and help give the code some of its nice properties. The basic properties of G24G24 are given in the following theorem.

Theorem

G24G24 is a self-dual [24, 12, 8] binary code. The weights of all vectors in G24G24 are multiples of 4.

Proof. The rows in GG have length 24. Since the 12×1212×12 identity matrix is contained in GG, the 12 rows of GG are linearly independent. Therefore, G24G24 has dimension 12, so it is a [24, 12, d][24, 12, d] code for some dd. The main work will be to show that d=8d=8. Along the way, we’ll show that G24G24 is self-dual and that the weights of its codewords are 0(mod4)0(mod4).

Of course, it would be possible to have a computer list all 212=4096212=4096 elements of G24G24 and their weights. We would then verify the claims of the theorem. However, we prefer to give a more theoretical proof.

Let r1r1 be the first row of GG and let rr1rr1 be any of the other first 11 rows. An easy check shows that r1r1 and rr have exactly four 1s in common, and each has four 1s that are matched with 0s in the other vector. In the sum r1+rr1+r, the four common 1s cancel mod 2, and the remaining four 1s from each row give a total of eight 1s in the sum. Therefore, r1+rr1+r has weight 8. Also, the dot product r1rr1r receives contributions only from the common 1s, so r1r=11+11+11+11=40(mod 2)r1r=11+11+11+11=40(mod 2).

Now let uu and vv be any two distinct rows of GG, other than the last row. The first 12 entries and the last 11 entries of vv are cyclic permutations of the corresponding parts of uu and also of the corresponding parts of the first row. Since a permutation of the entries does not change the weights of vectors or the value of dot products, the preceding calculation of r1+rr1+r and r1rr1r applies to uu and vv. Therefore,

  1. wt(u+v)=8wt(u+v)=8

  2. uv0(mod 2)uv0(mod 2).

Any easy check shows that (1) and (2) also hold if uu or vv is the last row of GG, so we see that (1) and (2) hold for any two distinct rows u, vu, v of GG. Also, each row of GG has an even number of 1s, so (2) holds even when u=vu=v.

Now let c1c1 and c2c2 be arbitrary elements of G24G24. Then c1c1 and c2c2 are linear combinations of rows of GG, so c1c2c1c2 is a linear combination of numbers of the form uvuv for various rows uu and vv of GG. Each of these dot products is 0 mod 2, so r1r20(mod 2)r1r20(mod 2). This implies that CCCC. Since CC is a 12-dimensional subspace of 24-dimensional space, CC has dimension 2412=122412=12. Therefore, CC and CC have the same dimension, and one is contained in the other. Therefore, C=CC=C, which says that CC is self-dual.

Observe that the weight of each row of GG is a multiple of 4. The following lemma will be used to show that every element of G24G24 has a weight that is a multiple of 4.

Lemma

Let v1v1 and v2v2 be binary vectors of the same length. Then

wt(v1+v2)=wt(v1)+wt(v2)2[v1v2], 
wt(v1+v2)=wt(v1)+wt(v2)2[v1v2], 

where the notation [v1v2][v1v2] means that the dot product is regarded as a usual integer, not mod 2 (for example, [(1, 0, 1, 1)(1, 1, 1, 1)]=3[(1, 0, 1, 1)(1, 1, 1, 1)]=3, rather than 1).

Proof. The nonzero entries of v1+v2v1+v2 occur when exactly one of the vectors v1, v2v1, v2 has an entry 1 and the other has a 0 as its corresponding entry. When both vectors have a 1, these numbers add to 0 mod 2 in the sum. Note that wt(v1)+wt(v2)wt(v1)+wt(v2) counts the total number of 1s in v1v1 and v2v2 and therefore includes these 1s that canceled each other. The contributions to [v1v2][v1v2] are caused exactly by these 1s that are common to the two vectors. So there are [v1v2][v1v2] entries in v1v1 and the same number in v2v2 that are included in wt(v1)+wt(v2)wt(v1)+wt(v2), but do not contribute to wt(v1+v2)wt(v1+v2). Putting everything together yields the equation in the lemma.

We now return to the proof of the theorem. Consider a vector gg in G24G24. It can be written as a sum gu1++uk(mod 2)gu1++uk(mod 2), where u1, , uku1, , uk are distinct rows of GG. We’ll prove that wt(g)0(mod 4)wt(g)0(mod 4) by induction on kk. Looking at GG, we see that the weights of all rows of GG are multiples of 4, so the case k=1k=1 is true. Suppose, by induction, that all vectors that can be expressed as a sum of k1k1 rows of GG have weight 0(mod 4)0(mod 4). In particular, u=u1++uk1u=u1++uk1 has weight a multiple of 4. By the lemma,

wt(g)=wt(u+uk)=wt(u)+wt(uk)2[uuk]0+02[uuk](mod 4).
wt(g)=wt(u+uk)=wt(u)+wt(uk)2[uuk]0+02[uuk](mod 4).

But uuk0(mod 2)uuk0(mod 2), as we proved. Therefore, 2[uuk]0(mod 4)2[uuk]0(mod 4). We have proved that wt(g)0(mod 4)wt(g)0(mod 4) whenever gg is a sum of kk rows. By induction, all sums of rows of GG have weight 0(mod 4)0(mod 4). This proves that all weights of G24G24 are multiples of 4.

Finally, we prove that the minimum weight in G24G24 is 8. This is true for the rows of GG, but we also must show it for sums of rows of GG. Since the weights of codewords are multiples of 4, we must show that there is no codeword of weight 4, since the weights must then be at least 8. In fact, 8 is then the minimum, because the first row of GG, for example, has weight 8.

We need the following lemma.

Lemma

The rows of the 12×1212×12 matrix BB formed from the last 12 columns of GG are linearly independent mod 2. The rows of the 11×1111×11 matrix AA formed from the last 11 elements of the first 11 rows of GG are linearly dependent mod 2. The only linear dependence relation is that the sum of all 11 rows of AA is 0 mod 2.

Proof. Since G24G24 is self-dual, the dot product of any two rows of GG is 0. This means that the matrix product GGT=0GGT=0. Since G=[I|B]G=[I|B] (that is, II followed by the matrix BB), this may be rewritten as

I2+B BT=0, 
I2+B BT=0, 

which implies that B1=BTB1=BT (we’re working mod 2, so the minus signs disappear). This means that BB is invertible, so the rows are linearly independent.

The sum of the rows of AA is 0 mod 2, so this is a dependence relation. Let v1=(1, , 1)Tv1=(1, , 1)T be an 11-dimensional column vector. Then Av1=0Av1=0, which is just another way of saying that the sum of the rows is 0. Suppose v2v2 is a nonzero 11-dimensional column vector such that Av2=0Av2=0. Extend v1v1 and v2v2 to 12-dimensional vectors v1, v2v1, v2 by adjoining a 0 at the top of each column vector. Let r12r12 be the bottom row of BB. Then

Bvi=(0, , 0, r12vi)T.
Bvi=(0, , 0, r12vi)T.

This equation follows from the fact that Avi=0Avi=0. Note that multiplying a matrix times a vector consists of taking the dot products of the rows of the matrix with the vector.

Since BB is invertible and vi0vi0, we have Bvi0Bvi0, so r1vi0r1vi0 Since we are working mod 2, the dot product must equal 1. Therefore,

B(v1+v2)=(0, , 0, r1v1+r1v2)T=(0, , 0, 1+1)T=0.
B(v1+v2)=(0, , 0, r1v1+r1v2)T=(0, , 0, 1+1)T=0.

Since BB is invertible, we must have v1+v2=0v1+v2=0, so v1=v2v1=v2 (we are working mod 2). Ignoring the top entries in v1v1 and v2v2, we obtain v2=(1, , 1)v2=(1, , 1). Therefore, the only nonzero vector in the null space of AA is v1v1. Since the vectors in the null space of a matrix give the linear dependencies among the rows of the matrix, we conclude that the only dependency among the rows of AA is that the sum of the rows is 0. This proves the lemma.

Suppose gg is a codeword in G24G24. If gg is, for example, the sum of the second, third, and seventh rows, then gg will have 1s in the second, third, and seventh positions, because the first 12 columns of GG form an identity matrix. In this way, we see that if gg is the sum of kk rows of GG, then wt(g)kwt(g)k. Suppose now that wt(g)=4wt(g)=4. Then gg is the sum of at most four rows of GG. Clearly, gg cannot be a single row of GG, since each row has weight at least 8. If gg is the sum of two rows, we proved that wt(g)wt(g) is 8. If g=r1+r2+r3g=r1+r2+r3 is the sum of three rows of GG, then there are two possibilities.

(1) First, suppose that the last row of GG is not one of the rows in the sum. Then three 1s are used from the 13th column, so a 1 appears in the 13th position of gg. The 1s from the first 12 positions (one for each of the rows r1, r2, r3r1, r2, r3) contribute three more 1s to gg. Since wt(g)=4wt(g)=4, we have accounted for all four 1s in gg. Therefore, the last 11 entries of gg are 0. By the preceding lemma, a sum of only three rows of the matrix AA cannot be 0. Therefore, this case is impossible.

(2) Second, suppose that the last row of GG appears in the sum for gg, say g=r1+r2+r3g=r1+r2+r3 with r3=r3= the last row of GG. Then the last 11 entries of gg are formed from the sum of two rows of AA (from r1r1 and r2r2) plus the vector (1, 1, , 1)(1, 1, , 1) from r3r3. Recall that the weight of the sum of two distinct rows of GG is 8. There is a contribution of 2 to this weight from the first 13 columns. Therefore, looking at the last 11 columns, we see that the sum of two distinct rows of AA has weight 6. Adding a vector mod 2 to the vector (1, 1, , 1)(1, 1, , 1) changes all the 1s to 0s and all the 0s to 1s. Therefore, the weight of the last 11 entries of gg is 5. Since wt(g)=4wt(g)=4, this is impossible, so this case also cannot occur.

Finally, if gg is the sum of four rows of GG, then the first 12 entries of gg have four 1s. Therefore, the last 12 entries of gg are all 0. By the lemma, a sum of four rows of BB cannot be 0, so we have a contradiction. This completes the proof that there is no codeword of weight 4.

Since the weights are multiples of 4, the smallest possibility for the weight is 8. As we pointed out previously, there are codewords of weight 8, so we have proved that the minimum weight of G24G24 is 8. Therefore, G24G24 is a [24, 12, 8] code, as claimed. This completes the proof of the theorem.

The (nonextended) Golay code G23G23 is obtained by deleting the last entry of each codeword in G24G24.

Theorem

G23G23 is a linear [23,12,7] code.

Proof. Clearly each codeword has length 23. Also, the set of vectors in G23G23 is easily seen to be closed under addition (if v1, v2v1, v2 are vectors of length 24, then the first 23 entries of v1+v2v1+v2 are computed from the first 23 entries of v1v1 and v2v2) and G23G23 forms a binary vector space. The generating matrix GG for G23G23 is obtained by removing the last column of the matrix GG for G24G24. Since GG contains the 12×1212×12 identity matrix, the rows of GG are linearly independent, and hence span a 12-dimensional vector space. If gg is a codeword in G23G23, then gg can be obtained by removing the last entry of some element gg of G24G24. If g0g0, then g0g0, so wt(g)8wt(g)8. Since gg has one entry fewer than gg, we have wt(g)7wt(g)7. This completes the proof.

Decoding G24G24

Suppose a message is encoded using G24G24 and the received message contains at most three errors. In the following, we show a way to correct these errors.

Let GG be the 12×2412×24 generating matrix for G24G24. Write GG in the form

G=[I, B]=(c1, , c24), 
G=[I, B]=(c1, , c24), 

where II is the 12×1212×12 identity matrix, BB consists of the last 12 columns of GG, and c1, , c24c1, , c24 are column vectors. Note that c1, , c12c1, , c12 are the standard basis elements for 12-dimensional space. Write

BT=(b1, , b12), 
BT=(b1, , b12), 

where b1, , b12b1, , b12 are column vectors. This means that bT1, , bT12bT1, , bT12 are the rows of BB.

Suppose the received message is r=c+er=c+e, where cc is a codeword from G24G24 and

e=(e1, , e24)
e=(e1, , e24)

is the error vector. We assume wt(e)3wt(e)3.

The algorithm is as follows. The justification is given below.

  1. Let s=rGTs=rGT be the syndrome.

  2. Compute the row vectors s, sBs, sB, s+cTj, 13j24s+cTj, 13j24, and sB+bTj, 1j12sB+bTj, 1j12.

  3. If wt(s)3wt(s)3, then the nonzero entries of ss correspond to the nonzero entries of ee.

  4. If wt(sB)3wt(sB)3, then there is a nonzero entry in the kkth position of sBsB exactly when the (k+12)(k+12)th entry of ee is nonzero.

  5. If wt(s+cTj)2wt(s+cTj)2 for some jj with 13j2413j24, then ej=1ej=1 and the nonzero entries of s+cTjs+cTj are in the positions of the other nonzero entries of the error vector ee.

  6. If wt(sB+bTj)2wt(sB+bTj)2 for some jj with 1j121j12, then ej=1ej=1. If there is a nonzero entry for this sB+bTjsB+bTj in position k (there are at most two such k), then e12+k=1.

Example

The sender starts with the message

m=(1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0).

The codeword is computed as

mG=(1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0)

and sent to us. Suppose we receive the message as

r=(1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0).

A calculation shows that

s=(0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0)

and

sB=(1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0).

Neither of these has weight at most 3, so we compute s+cTj, 13j24 and sB+bTj, 1j12. We find that

sB+bT4=(0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0).

This means that there is an error in position 4 (corresponding to the choice b4) and in positions 20 (= 12 + 8) and 22 (= 12 + 10) (corresponding to the nonzero entries in positions 8 and 10 of sB+bT4). We therefore compute

c=r+(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0)=(1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0).

Moreover, since G is in systematic form, we recover the original message from the first 12 entries:

m=(1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0).

We now justify the algorithm and show that if wt(e)3, then at least one of the preceding cases occurs.

Since G24 is self-dual, the dot product of a row of G with any codeword c is 0. This means that cGT=0. In our case, we have r=c+e, so

s=rGT=cGT+eGT=eGT=e1cT1++e24cT24.

This last equality just expresses the fact that the vector e=(e1, , e24) times the matrix GT equals e1 times the first row cT1 of GT, plus e2 times the second row of GT, etc. Also,

sB=eGTB=e[IBT]B=e[BI], 

since BT=B1 (proved in the preceding lemma). We have

[BI]=[BT, I]T=(b1, , b12, c1, , c12).

Therefore,

sB=e(b1, , b12, c1, , c12)T=e1bT1++e24cT12.

If wt(e)3, then either wt((e1, , e12))1 or wt((e13, , e24))1, since otherwise there would be too many nonzero entries in e. We therefore consider the following four cases.

  1. wt((e1, , e12))=0. Then

    sB=e13cT1++e24cT12=(e13, , e24).

    Therefore, wt(sB)3 and we can determine the errors as in step (4) of the algorithm.

  2. wt((e1, , e12))=1. Then ej=1 for exactly one j with 1j12, so

    sB=bTj+e13cT1++e24cT12.

    Therefore,

    sB+bTj=e13cT1++e24cT12=(e13, , e24).

    The vector (e13, , e24) has at most two nonzero entries, so we are in step (6) of the algorithm.

    The choice of j is uniquely determined by sB. Suppose wt(sB+bTk)2 for some kj. Then

    wt(bTk+bTj)=wt(sB+bTk+sB+bTj)wt(sB+bTk)+wt(sB+bTj)2+2=4

    (see Exercise 6). However, we showed in the proof of the theorem about G24 that the weight of the sum of any two distinct rows of G has weight 8, from which it follows that the sum of any two distinct rows of B has weight 6. Therefore, wt(bTk+bTj)=6. This contradiction shows that bk cannot exist, so bj is unique.

  3. wt((e13, , e24))=0. In this case,

    s=e1cT1++e12cT12=(e1, , e12).

    We have wt(s)3, so we are in step (3) of the algorithm.

  4. wt((e13, , e24))=1. In this case, ej=1 for some j with 13j24. Therefore,

    s=e1cT1++e12cT12+cTj, 

    and we obtain

    s+cTj=e1cT1++e12cT12=(e1, , e12).

    There are at most two nonzero entries in (e1, , e12), so we are in step (5) of the algorithm.

    As in (2), the choice of cj is uniquely determined by s.

In each of these cases, we obtain a vector, let’s call it e, with at most three nonzero entries. To correct the errors, we add (or subtract; we are working mod 2) e to the received vector r to get c=r+e. How do we know this is the vector that was sent? By the choice of e, we have

eGT=s, 

so

cGT=rGT+eGT=s+s=0.

Since G24 is self-dual, G is a parity check matrix for G24. Since cGT=0, we conclude that c is a codeword. We obtained c by correcting at most three errors in r. Since we assumed there were at most three errors, and since the minimum weight of G24 is 8, this must be the correct decoding. So the algorithm actually corrects the errors, as claimed.

The preceding algorithm requires several steps. We need to compute the weights of 26 vectors. Why not just look at the various possibilities for three errors and see which correction yields a codeword? There are (240)+(241)+(242)+(243)=2325 possibilities for the locations of at most three errors, so this could be done on a computer. However, the preceding decoding algorithm is faster.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.200.3