C program to find all the code words of a code generated by a matrix
Answers
Answered by
0
So let's say your generator matrix is GG, which you described as having three codewords (we'll say as rows) c1,c2,c3c1,c2,c3 from top to bottom.
This thing is called the generator matrix because it produces every codeword as a result of multiplication by some vector in F32F23 on the left, like this: xG=cxG=c.
So, what are the possible inputs? From the context, I gather you are working over F2F2. So, the possible inputs are: [0,0,0],[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1],[1,1,1][0,0,0],[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1],[1,1,1].
The first seven correspond to words you already listed: 0,c1,c2,c3,c1+c2,c1+c3,c2+c30,c1,c2,c3,c1+c2,c1+c3,c2+c3 in that order.
The codeword you were missing corresponds to the last one: c1+c2+c3c1+c2+c3!
In general, if you have a code over F2F2 and a k×nk×n generator matrix (that is, k≤nk≤n, nn is the length of the code and kk is the dimension.) then all of the codewords will be given by multiplying by the vectors from Fk2F2k. Since there are 2k2k of these vectors, there will be 2k2k codewords.
If instead you are over a larger finite field like FqFq, then the number of codewords will be qkqk. Can you see why?
This thing is called the generator matrix because it produces every codeword as a result of multiplication by some vector in F32F23 on the left, like this: xG=cxG=c.
So, what are the possible inputs? From the context, I gather you are working over F2F2. So, the possible inputs are: [0,0,0],[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1],[1,1,1][0,0,0],[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1],[1,1,1].
The first seven correspond to words you already listed: 0,c1,c2,c3,c1+c2,c1+c3,c2+c30,c1,c2,c3,c1+c2,c1+c3,c2+c3 in that order.
The codeword you were missing corresponds to the last one: c1+c2+c3c1+c2+c3!
In general, if you have a code over F2F2 and a k×nk×n generator matrix (that is, k≤nk≤n, nn is the length of the code and kk is the dimension.) then all of the codewords will be given by multiplying by the vectors from Fk2F2k. Since there are 2k2k of these vectors, there will be 2k2k codewords.
If instead you are over a larger finite field like FqFq, then the number of codewords will be qkqk. Can you see why?
Similar questions