Computing Cosets/Syndromes given Linear Code

1.6k Views Asked by At

As part of a revision worksheet for my Discrete Mathematics class I've been looking over Linear Code questions, one of which I'm particularly struggling with. I'm mostly having problems with the coset part of the question but I'm going to cover the whole thing in case I made a stupid mistake somewhere else. The question is as follows:

Give the smallest linear code of binary 5-sequences containing 11010 and 00111.

My understanding is that the smallest linear code containing these two elements would be a linear code consisting of these two elements, an element of all-zeros, and whatever they add to make.

C = 00000, 00111, 11010, 11101

Construct a generator matrix in standard form.

Following from the last part, the generator matrix of a linear code should be it's basis, so in this case: $$ \begin{matrix} 1 & 1 & 0 & 1 & 0 \\ 0 & 0 & 1 & 1 & 1 \\ \end{matrix} $$

Then it needs to be converted to the standard form, $[I_k | P]$ which would be done by swapping columns 2 and 3:

$$ \begin{matrix} 1 & 0 & 1 & 1 & 0 \\ 0 & 1 & 0 & 1 & 1 \\ \end{matrix} $$

Then the parity check matrix H, in the form $[P^T | I_{n-k}]$ would be:

$$ \begin{matrix} 1 & 0 & 1 & 0 & 0 \\ 1 & 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 & 1 \end{matrix} $$

Compute the cosets and corresponding syndromes and coset leaders.

My understanding is that between all the cosets, every permutation of binary 5-sequences should be represented, (32 in total) and since there are 4 codes per coset there should be 8 distinct cosets and each coset should have one (or potentially more) leaders which are the elements with lowest weight.

Then for any coset leader, multiplying the coset leader by the transposed H matrix, gives the syndrome of that coset.

So we find those cosets by adding additional 5-sequences to every element in C. From this I can quickly find six cosets with the following coset leaders: $$ \begin{array}{c|lr} Coset Leader & \text{Syndrome} \\ \hline 00000 & 000 \\ 00001 & 001 \\ 00010 & 010 \\ 00100 & 100 \\ 01000 & 011 \\ 10000 & 110 \\ \end{array} $$ With the above cosets in use, 24 of the 32 possible permutations of binary 5-sequences are accounted for.

And here's where I run into trouble. To get the last eight permutations of binary 5-sequences without repetition, I would use the cosets 10001 and 10100. However, when I plug those numbers into the transpose of the parity check matrix H, I get the following results: \begin{array}{c|lr} Coset Leader & \text{Syndrome} \\ \hline 10100 & 010 \\ 10001 & 111 \\ \end{array}

Whilst 10001 works as a coset with a unique syndrome, 10100 has a non-unique syndrome it shares with another coset, and the syndrome 101 is unaccounted for, so presumably I'm doing something wrong here. I just don't quite understand what it would be?

UPDATE:

Think I found the problem. Since I edited the Generator Matrix, I then needed to edit the values of the linear code in the same way (by swapping columns 2 and 3), solve as normal, and finally swap the columns back at the end of the process to get the correct answer. Seems obvious in hindsight.