A binary k = 3, n = 6 code
> code1:=[0,0,0,1,1,1],[0,0,1,0,0,1],[0,1,0,0,1,0],[0,1,1,1,0,0],
[1,0,0,1,0,0],[1,0,1,0,1,0],[1,1,0,0,0,1],[1,1,1,1,1,1]:
Matrix(8,8, (i,j)->findDistance(code1[i],code1[j]));
1. Whatis the minimum distances of the code?
2. How many symbol errors can be corrected by the code?
A ternary k = 2, n = 4 code
> code2:=[s0,s0,s0,s0],[s0,s1,s1,s1],[s0,s2,s2,s2],
[s1,s0,s1,s2],[s1,s1,s2,s0],[s1,s2,s0,s1],
[s2,s0,s2,s1],[s2,s1,s0,s2],[s2,s2,s1,s0]:
Matrix(9,9, (i,j)->findDistance(code2[i],code2[j]));
1. What are the minimum distances of the code?
2. How many symbol errors can be corrected by the code?
Decoding of the binary code
> received:=[0,0,0,0,1,1]:
for i from 1 to 8 do printf("A%d) distance between %a & codeword[%d] %a = %a\n",
i,received, i, code1[i], findDistance(received,code1[i]));
end do:
A1) distance between [0, 0, 0, 0, 1, 1] & codeword[1] [0, 0, 0, 1, 1, 1] = 1
A2) distance between [0, 0, 0, 0, 1, 1] & codeword[2] [0, 0, 1, 0, 0, 1] = 2
A3) distance between [0, 0, 0, 0, 1, 1] & codeword[3] [0, 1, 0, 0, 1, 0] = 2
A4) distance between [0, 0, 0, 0, 1, 1] & codeword[4] [0, 1, 1, 1, 0, 0] = 5
A5) distance between [0, 0, 0, 0, 1, 1] & codeword[5] [1, 0, 0, 1, 0, 0] = 4
A6) distance between [0, 0, 0, 0, 1, 1] & codeword[6] [1, 0, 1, 0, 1, 0] = 3
A7) distance between [0, 0, 0, 0, 1, 1] & codeword[7] [1, 1, 0, 0, 0, 1] = 3
A8) distance between [0, 0, 0, 0, 1, 1] & codeword[8] [1, 1, 1, 1, 1, 1] = 4
> received:=[0,0,0,0,0,0]:
for i from 1 to 8 do printf("distance between %a & codeword[%d] %a = %a\n",
received, i, code1[i], findDistance(received,code1[i]));
end do:
distance between [0, 0, 0, 0, 0, 0] & codeword[1] [0, 0, 0, 1, 1, 1] = 3
distance between [0, 0, 0, 0, 0, 0] & codeword[2] [0, 0, 1, 0, 0, 1] = 2
distance between [0, 0, 0, 0, 0, 0] & codeword[3] [0, 1, 0, 0, 1, 0] = 2
distance between [0, 0, 0, 0, 0, 0] & codeword[4] [0, 1, 1, 1, 0, 0] = 3
distance between [0, 0, 0, 0, 0, 0] & codeword[5] [1, 0, 0, 1, 0, 0] = 2
distance between [0, 0, 0, 0, 0, 0] & codeword[6] [1, 0, 1, 0, 1, 0] = 3
distance between [0, 0, 0, 0, 0, 0] & codeword[7] [1, 1, 0, 0, 0, 1] = 3
distance between [0, 0, 0, 0, 0, 0] & codeword[8] [1, 1, 1, 1, 1, 1] = 6
Let Pr{binary symbol error} = p = 10^(-5).
1. Find Pr{[0, 0, 0, 0, 1, 1] is received after sending codeword[i]} for all i.
2. How should the received data [0, 0, 0, 0, 1, 1] be decoded?
3. Find Pr{[0, 0, 0, 0, 0, 0] is received after sending codeword[i]} for all i.
4. How should the received data [0, 0, 0, 0, 0, 0] be decoded?
Decoding of the ternary code
> received:=[s2,s2,s2,s2]:
for i from 1 to 9 do printf("distance between %a and codeword[%d] %a = %a\n",
received, i, code2[i], findDistance(received,code2[i]));
end do:
distance between [s2, s2, s2, s2] and codeword[1] [s0, s0, s0, s0] = 4
distance between [s2, s2, s2, s2] and codeword[2] [s0, s1, s1, s1] = 4
distance between [s2, s2, s2, s2] and codeword[3] [s0, s2, s2, s2] = 1
distance between [s2, s2, s2, s2] and codeword[4] [s1, s0, s1, s2] = 3
distance between [s2, s2, s2, s2] and codeword[5] [s1, s1, s2, s0] = 3
distance between [s2, s2, s2, s2] and codeword[6] [s1, s2, s0, s1] = 3
distance between [s2, s2, s2, s2] and codeword[7] [s2, s0, s2, s1] = 2
distance between [s2, s2, s2, s2] and codeword[8] [s2, s1, s0, s2] = 2
distance between [s2, s2, s2, s2] and codeword[9] [s2, s2, s1, s0] = 2
Let Pr{binary symbol error} = p = 10^(-5).
1. Find Pr{[s2, s2, s2, s2] is received after sending codeword[i]} for all i.
2. How should the received data [s2, s2, s2, s2] be decoded?