Week 4 Exercises — solutions

Version 2023-11-04. These exercises in PDF

  • Exercise 4.1. Write down the weight enumerator of Rep(n,F2), more generally of Rep(n,Fq).

Answer to E4.1. [These exercises without answers]

Rep(n,F2) has one codevector of weight 0 and one codevector of weight n. Hence WRep(n,F2)(x,y)=xn+yn.

Exercise: show that WRep(n,Fq)(x,y)=xn+(q1)yn.

Notation: below, CFqn is a linear code, d(C)=d, and t=[d12].

  • Exercise 4.2. Prove that each vector a of weight t in the space Fqn is a unique coset leader (that is, w(a) is strictly less than weights of all other vectors in its coset a+C).

    Hint. If ab are in the same coset, show that dw(a)+w(b). Then use dt>t.

Answer to E4.2. [These exercises without answers]

If a,b are in the same coset, then by properties of cosets, c:=ab is a codevector. If ab then c0 and so dw(c)=w(ab)=d(a,b). By the triangle inequality, d(a,b)d(a,0)+d(0,b)=w(a)+w(b). Thus, dw(a)+w(b) as claimed.

Now assume w(a)t. Then w(b)dw(a)dt. But t<d2 so dt>t. We have w(b)dt>tw(a). This shows that a has strictly minimal weight among the vectors in its coset, and so is the unique coset leader.

  • Exercise 4.3 (important fact about perfect linear codes — needed for exam).

    Assume C is perfect. Use the Hamming bound to show that the number of cosets equals #St(0), i.e., there as many cosets as vectors of weight t in the space Fqn. Deduce that every coset has a unique coset leader, and that the coset leaders are exactly the vectors of weight t.

Answer to E4.3. [These exercises without answers]

By the previous exercise, the vectors aSt(0) are unique coset leaders of #St(0) distinct cosets. The total number of cosets is qn#C.

Now if C is perfect, then #C=qn#St(0) (the right-hand side is the Hamming bound), and so qn#C=#St(0). Thus if C is perfect, cosets with a unique coset leader of weight t exhaust all cosets, as claimed.

  • Exercise 4.4 (not done in tutorial). Find standard arrays for binary codes with each of the following generator matrices. For each code, determine whether every coset has a unique coset leader (i.e., if there is exactly one coset leader in each coset). Find the probability of an undetected / uncorrected error for BSC(p) and argue whether the code is worth using for this channel, compared to transmitting unencoded information.

    G1=[1001],G2=[101011],G3=[1011001011].

Answer to E4.4. [These exercises without answers]

G1 generates the trivial binary code of length 2. Because the code is the whole space F22, its standard array consists of one row:

00011011

(the order of the codevectors after 00 is arbitrary). The only coset is the trivial coset which has only one coset leader, 00.

G2 generates E3, the even weight code of length 3. It has 4 codevectors and 2 cosets:

000101011110001100010111

Note that the non-trivial coset has three coset leaders; any of them could be put in column 1.

G3: list all the 4 codevectors and then use the algorithm for constructing the standard array. One possible answer is given below:

0000010110010111110110000001101101101101010001111000011101010010010010011111100100010101000100111111000011011101010111001100001110100110010101100110100011110001

Coset leaders of weight 0 and 1 are the only coset leaders in their cosets. Coset leaders of weight 2 are not unique: e.g., 11000 and 00101 are coset leaders of the same coset.

Error probabilities. The code generated by G1 is the trivial code, so using it is the same as sending unencoded information.

The code generated by G2 has weight enumerator WE3(x,y)=x3+3xy2. Hence an undetected error occurs with probability

Pundetect(E3)=WE3(1p,p)(1p)3=3(1p)p23p2.

Note that this is of the same order as p2 but at a rate of 2/3 (recall the code considered in the chapter with worse rate 1/2).

The probability of an uncorrected error here is 1Pcorr(E3)=1(α0(1p)3+α1p(1p)2) where α0=1 (one coset leader of weight 0) and α1=1 (one coset leader of weight 1) . We have 1Pcorr(E3)=1((1p)3+p(1p)2)=1(1p+p)(1p)2=1(1p)22p.

The code E3 does not improve the probability of incorrect decoding. Indeed, Hamming’s theory says that E3 has no error-correcting capability and can only be used for error detection.

The code generated by G3 has weight enumerator x5+2x2y3+xy4. Hence

Pundetect=2(1p)2p3+(1p)p42p3.

If p=0.01, this is 2×106, which is 5,000 times better than without encoding.

Furthermore, looking at the coset leaders, we find one coset leader of weight 0, α0=1; five coset leaders of weight 1, α1=5; two coset leaders of weight 2, α2=2. This gives

1Pcorr=1(α0(1p)5+α1p(1p)4+α2p2(1p)3)=1((1p)2+5p(1p)+2p2)(1p)3=8p214p3+9p42p58p2. If p=0.01, incorrect decoding occurs with probability 8×104, which is 12.5 times better than without encoding.

Of course, this improvement in reliability comes at a price: the rate of the code is only 0.4, meaning that we have to transmit 2.5 times as much information.

  • Exercise 4.5 (more weight enumerators — not done in tutorial). (a) As usual, let WC(x,y) denote the weight enumerator of a q-ary linear code C. Show that WC(1,0)=1 and that WC(1,1)=qk where k=dimC.

    (b) Show that the weight enumerator of the trivial binary code F2n is WF2n(x,y)=(x+y)n. Can you write WFqn(x,y) in a similar form?

    (c) Write down WE3(x,y). Can you suggest a compact way to write WEn(x,y)?

Answer to E4.5. [These exercises without answers]

(a) Recall WC(x,y)=cCxnw(c)yw(c). If y=0, the only non-zero term in this sum is the term without y which corresponds to the (unique) zero codevector of the linear code C; thus, WC(x,0)=xn and WC(1,0)=1. Also, WC(1,1)=cC1=#C=qk.

(b) To work out WFqn(x,y), write it in the form WFqn(x,y)=i=0nAixniyi where Ai=#{vFqn:w(v)=i}. Note that w(v)=d(v,0), and in the proof of the Hamming bound we calculated the number of words at distance i from 0 (or from any other fixed vector) to be (ni)(q1)i. Hence

WFqn(x,y)=i=0n(ni)(q1)ixniyi=(x+(q1)y)n.

(c) The even weight code E3 is {000,011,101,110}, so that WE3(x,y)=x3+3xy2. The weight enumerator of En will be obtained in the lectures as an application of the MacWilliams identity.