11.08.2013 Views

MATH447/747 ASSIGNMENT 3 The not to hand ... - People.stat.sfu.ca

MATH447/747 ASSIGNMENT 3 The not to hand ... - People.stat.sfu.ca

MATH447/747 ASSIGNMENT 3 The not to hand ... - People.stat.sfu.ca

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>The</strong> <strong>not</strong> <strong>to</strong> <strong>hand</strong> in questions<br />

<strong>MATH447</strong>/<strong>747</strong> <strong>ASSIGNMENT</strong> 3<br />

FALL 2012<br />

#13 (a) No column of H is 0 and no column in a multiple of a<strong>not</strong>her, while column 1<br />

plus column 2 equals column 3, so the distance of this code is 3 and thus e = 1.<br />

n = 4 and we are over Z3 and so each sphere of radius 1 contains 1 + 2 · 4 = 9<br />

elements. Further k = 2 and so there are 3 2 = 9 codewords. Together this gives<br />

9 · 9 = 3 4 elements in the spheres of radius e around the codewords, and this is<br />

all elements in Z 4 3, so this code is perfect.<br />

(b) (you don’t need <strong>to</strong> worry about the lexicographic part since we didn’t discuss<br />

that in class, and in fact it makes no difference for this code since it has distance<br />

3 and is perfect)<br />

0000 1021 2012 0111 0222 1102 2201 1210 2120<br />

1000 2021 0012 1111 1222 2102 0201 2210 0120<br />

2000 0021 1012 2111 2222 0102 1201 0210 1120<br />

0100 1121 2112 0211 0022 1202 2001 1010 2220<br />

0200 1221 2212 0011 0122 1002 2101 1110 2020<br />

0010 1001 2022 0121 0202 1112 2211 1220 2100<br />

0020 1011 2002 0101 0212 1122 2221 1200 2110<br />

0001 1022 2020 0112 0220 1100 2202 1211 2121<br />

0002 1020 2021 0110 0221 1101 2200 1212 2122<br />

(c) We might as well use the coset leaders since all coset elements have the same<br />

syndrome and the leaders are easiest <strong>to</strong> work with. H(0000) T = (00) T . <strong>The</strong><br />

other leaders are multiples of individual columns of H according <strong>to</strong> where they<br />

have their nonzero element. Thus we get the map<br />

00 → 0000<br />

10 → 1000<br />

20 → 2000<br />

01 → 0100<br />

02 → 0200<br />

21 → 0010<br />

12 → 0020<br />

11 → 0001<br />

22 → 0002<br />

(d) Hr T 1 = (21) T which corresponds <strong>to</strong> 0010, and so we decode <strong>to</strong> r1 − 0010 =<br />

2211 − 0010 = 2201<br />

1


Hr T 2 = (12) T which corresponds <strong>to</strong> 0020, and so we decode <strong>to</strong> r2 − 0020 =<br />

2221 − 0020 = 2201<br />

Hr T 3 = (20) T which corresponds <strong>to</strong> 2000, and so we decode <strong>to</strong> r3 − 2000 =<br />

2222 − 2000 = 0222<br />

#21 Let Ci be the coset with syndrome v and write H = [h1 · · · hn]. Suppose Ci contains<br />

a vec<strong>to</strong>r x = (x1, . . . , xn) of weight w, then v = Hx T = x1h1 + · · · + xnhn is a linear<br />

combination of w columns of H. Suppose v = αi1hi1 + · · · αiwhiw. Let x be the vec<strong>to</strong>r<br />

which is αij in position ij and 0 elsewhere. <strong>The</strong>n Hx T = αi1hi1 + · · · αiwhiw = v so x<br />

is in Ci and x has weight w.<br />

#26 At most 8 check symbols means that n − k ≤ 8, so k ≥ n − 8. d = 5 so e = 2.<br />

<strong>The</strong> spheres of radius 2 over F2 contain<br />

<br />

n<br />

1 + n + = 1 + n +<br />

2<br />

n(n − 1)<br />

2<br />

elements. Thus <strong>to</strong>gether these spheres around codewords contain at least<br />

2 n−8 (1 + n +<br />

n(n − 1)<br />

)<br />

2<br />

elements, and we want this number <strong>to</strong> be less than or equal <strong>to</strong> 2 n . That is we want<br />

n−8 1 + n + n(n − 1)/2<br />

2<br />

·2n that is we want<br />

1 + n + n(n − 1)/2<br />

28 ≤ 1<br />

Solving the quadratic equation, taking the positive root, and using that n is an<br />

integer, we get that this happens for n ≤ 22. That’s about all we <strong>ca</strong>n say with<br />

the <strong>to</strong>ols we have (our other bounds don’t help much), so next you’d have <strong>to</strong> actually<br />

construct. In fact the best you <strong>ca</strong>n actually do is n = 17, http://www.rz.<br />

uni-karlsruhe.de/~kg11/codetables/BKLC/index.html. This wasn’t such a good<br />

question – I thought we’d be able <strong>to</strong> get further with the techniques we have – does<br />

someone else see something I’ve missed?<br />

Now for the <strong>hand</strong> in questions<br />

(1) (a) View det V as a polynomial in xi (with coefficients polynomials in the remaining<br />

variables). <strong>The</strong>n if we evaluate at xi = xj we see that V has two rows equal,<br />

and so xj is a root of det V viewed as a polynomial in xi. Roots of polynomials<br />

yeild linear fac<strong>to</strong>rs, thus xi − xj divides det V .<br />

(b) Let P = <br />

1≤i


We have P | det V and deg P = deg(det V ). Thus P and det V must be equal<br />

up <strong>to</strong> a constant multiple. To check that the constant is correct, <strong>ca</strong>lculate the<br />

coefficient of x0 1x1 2 · · · xn−1 n on both sides.<br />

In det V this coefficient arises only by the term in the cofac<strong>to</strong>r expansion which<br />

always chose the diagonal elements. Thus this term has coefficient 1 in det V .<br />

In P <strong>to</strong> get (n−1) powers of xn we must take xn in every fac<strong>to</strong>r it appears in. Of<br />

the remaining fac<strong>to</strong>rs then we must take xn−1 in every fac<strong>to</strong>r it appears in <strong>to</strong> get<br />

n−2 powers. In all these terms the other variable has smaller index. Continuing<br />

(formally an easy induction) in P the term x0 1x1 2 · · · xn−1 n arises only when we take<br />

the first element of each fac<strong>to</strong>r, and thus also appears with coefficient 1.<br />

<strong>The</strong> result follows.<br />

(c) Consider any k columns of H K =<br />

⎡<br />

⎤<br />

⎣<br />

a i1 · · · a ik<br />

.<br />

. ..<br />

a k(i1) · · · a k(ik)<br />

.<br />

S<strong>ca</strong>le each column of K by the inverse of its first entry and then take a transpose.<br />

<strong>The</strong> result is a Vandermonde matrix, and so by the previous parts we know its<br />

determinant. In particular<br />

det K = a i1+···+ik<br />

<br />

⎦<br />

y


0 =<br />

% I actually only need <strong>to</strong> correct errors in positions 3,5,6,7<br />

% as those are the data positions in the original word and we have assumed<br />

% no more than 1 error<br />

c = [r(3),r(5:7)];<br />

if (s == [1;1;0])<br />

c = c - [1 0 0 0];<br />

elseif (s == [1;0;0])<br />

c = c - [0 1 0 0];<br />

elseif (s == [0;1;0])<br />

c = c - [0 0 1 0];<br />

elseif (s == [0;0;1])<br />

c = c - [0 0 0 1];<br />

endif<br />

<strong>The</strong>n doing the source decoding by <strong>hand</strong> I get<br />

(a) DECODE B<br />

(b) TEARS FOR FEARS<br />

(c) SEE YOU SOON<br />

(3)#36: (a) <strong>The</strong>re are q q+1 vec<strong>to</strong>rs <strong>to</strong>tal. <strong>The</strong>re are q 2 codewords. Thus there are q q−1<br />

cosets. Each coset other than C <strong>ca</strong>n contribute at most one vec<strong>to</strong>r <strong>to</strong> the<br />

sphere of radius e around any codeword c. This is true for any code C as<br />

if x and y were both in the sphere of radius e around c then x − y is a<br />

codeword, but x = c + x ′ , y = c + y ′ with x and x ′ of weight ≤ e, and then<br />

w(x − y) ≤ w(x ′ ) + w(y ′ ) ≤ 2e < d(C).<br />

First <strong>not</strong>e that if q is even then the code <strong>ca</strong>n<strong>not</strong> be perfect, as if a code C<br />

has even distance 2d, then there are two codewords c, c ′ with d(c, c ′ ) = 2d,<br />

so moving from one <strong>to</strong> the other changing one coordinate at a time we<br />

obtain a vec<strong>to</strong>r v with d(c, v) = d and d(c ′ , v) = d. This v is <strong>not</strong> in the<br />

sphere of radius e = d − 1 around c or c ′ , and if it was in the sphere of<br />

radius e around some other codeword c ′′ then d(c, c ′′ ) ≤ d(c, v)+d(c ′′ , v) ≤<br />

d + d − 1 < 2d contradicting the distance, so C is <strong>not</strong> perfect.<br />

Now suppose q is odd so e = (q −1)/2. If q = 3 then e = 1 and the spheres<br />

contain 1 + 2 · 4 = 9 elements and there are 9 spheres, giving 81 = 3 4<br />

elements in the sphere so the code is perfect.<br />

For larger odd q we would need that<br />

q 2<br />

<br />

1 + (q − 1)(q + 1) + (q − 1) 2<br />

<br />

q + 1<br />

+ · · · + (q − 1)<br />

2<br />

e<br />

<br />

q + 1<br />

= q<br />

e<br />

q+1<br />

dividing by q2 and rewriting we’d need<br />

e<br />

(2e) i<br />

<br />

2e + 2<br />

= (2e + 1)<br />

i<br />

2e<br />

i=0<br />

Rewriting with the binomial theorem we’d need<br />

e<br />

(2e) i<br />

<br />

2e + 2 2e<br />

− (2e)<br />

i<br />

i<br />

e<br />

<br />

2e 2e<br />

=<br />

(2e)<br />

i<br />

i<br />

i<br />

<br />

<br />

(2e + 2)(2e + 1)<br />

− 1<br />

(2e + 2 − i)(2e + 1 − i)<br />

i=0<br />

i=0<br />

i=0<br />

4<br />

− (2e) 2e−i


the i = 0 term is 0, and otherwise the terms are strictly decreasing with e,<br />

so since we have seen equality at e = 1 there will be no further equalities.<br />

(b) Fix γ ∈ Fq and indices i = j.<br />

If γ = 0 then the zero codeword is γ in positions i and j, and no other<br />

codeword <strong>ca</strong>n be, as any such codeword would have weight ≤ q − 1 which<br />

contradicts that the distance of the code is q.<br />

Now suppose γ = 0.<br />

Suppose there were two codewords c and c ′ which were both γ in positions<br />

i and j. <strong>The</strong>n c − c ′ would be 0 in positions i and j, and so c − c ′ would<br />

have weight ≤ q − 1 which contradicts that the distance of the code is q.<br />

Take any two linearly independent codewords c and c ′ . <strong>The</strong>se form a basis<br />

for C. Project c and c ′ on<strong>to</strong> F 2 q by projecting on<strong>to</strong> postions i and j. Call the<br />

projected vec<strong>to</strong>rs v and v ′ . If v and v ′ are linearly independent, then some<br />

linear combination of them is [γ, γ] and so the same linear combination of<br />

c and c ′ is γ in positions i and j. Suppose v and v ′ are linearly dependent.<br />

<strong>The</strong>n some linear combination of them is 0. <strong>The</strong> same linear combination<br />

of c and c ′ is 0 in positions i and j, but this codeword would have weight<br />

≤ q − 1 which contradicts that the distance of the code is q.<br />

Thus for every γ and i = j there is exactly one codeword which is γ in<br />

positions i and j.<br />

(c) As remarked above no nonzero codeword <strong>ca</strong>n have two or more zero entries.<br />

Suppose c is a codeword with no zero entries.<br />

As remarked above no linearly independent codewords <strong>ca</strong>n have a projection<br />

on<strong>to</strong> two coordinates such that the projections are linearly dependent.<br />

That is the genera<strong>to</strong>r matrix has no two columns which are multiples of<br />

each other. Use c along with a<strong>not</strong>her codeword c ′ <strong>to</strong> make a basis for<br />

C. Let G be the matrix with first row c and second row c ′ . Whether<br />

two columns of G are linearly dependent or <strong>not</strong> is unchanged by s<strong>ca</strong>ling<br />

columns of G. So s<strong>ca</strong>le all columns of G <strong>to</strong> have 1 in the first position. This<br />

is always possible since c has no zero entries. <strong>The</strong>n since no two columns<br />

which are multiples of each other all the entries in the secodn row (now<br />

that we have s<strong>ca</strong>led) must be distinct. But there are only q distinct values<br />

and q + 1 columns.<br />

This is a contradiction and so all nonzero codewords have exactly 1 zero<br />

entry.<br />

#69: (a) An (n, k, d)-code has a parity check matrix of size n−k×n. So in particular<br />

any set of more than n − k columns must be linearly dependent. Thus by<br />

a result from class d ≤ n − k + 1.<br />

(b) Since C is <strong>ca</strong>pable of correcting t errors we must have 2t+1 ≤ d. Using the<br />

result from the previous part we get 2t + 1 ≤ n − k + 1, so 2t ≤ n − k. But<br />

n − k is the number of check symbols, so C has at least 2t check symbols.<br />

#70: (a) Consider the code with parity check matrix [1 1 1 1] (This is a simple<br />

parity bit code). This has no zero column, but all pairs of columns are<br />

linearly dependent, so it has distance 2. n = 4, and n − k = 1, so k = 3.<br />

Thus this code satisfies the single<strong>to</strong>n bound. To make a second example I<br />

5


could do something similar over Z3 with the parity check matrix [1 2 1 2].<br />

<strong>The</strong> <strong>stat</strong>istics are the same by the same <strong>ca</strong>lculations. This code is a sort of<br />

modified parity bit code where different input bits have different weights.<br />

(b) Hamming codes have n = (q r − 1)/(q − 1), k = n − r and d = 3. So<br />

d − n + k − 1 = 3 − r − 1 = 2 − r<br />

which is 0 iff r = 2. So Hamming codes are MDS codes iff they are order<br />

2.<br />

6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!