So, I am given that we have a $[n,k,d]=[7,4,2]$ code, and I am asked to find its parity-check matrix and generator matrix but my notes are so unclear that I can't understand it (also can't find any helpful information on google). Would somebody be able to help and tell me how to do it in this case or in the general case? I am really struggling to understand it.
The most I have got is constructing the code $C$, say:
$$C=\{0000000,1100000,0110000,0011000,\dots,1111000,0111100,0011110,\dots,1111111\}$$
I don't know what to do now. Any help would be greatly appreciated :) Thank you!
I know that I need to find $k=4$ linearly independent codewords to construct the generator matrix, say $G$, but I just don't know how to do this.
Okay, I now attempted the questions and got an answer different to the mark scheme. I know it's possible to have more than one generator matrix solution so would someone be able to check if mine is correct?
My generator matrix:
$$G = \begin{pmatrix} 1 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 1 & 1 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 1 \\ \end{pmatrix} $$
which in standard form gives:
$$G = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 1 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 1 \\ \end{pmatrix} $$
and the parity-check matrix is thus:
$$H= \begin{pmatrix} 0 & 0 & 1 & 0 & 1 & 0 & 0 \\ 1 & 1 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 1 \\ \end{pmatrix} $$
As you correctly pointed out $n$ tells you the length of the codewords and $k$ the rank of your generator - from this you can easily derive the dimensions of your parity check matrix $H$.
For linear codes, if $C$ has a distance of $d$, any $d-1$ columns of $H$ are linearly independent, while there exists at least one set of $d$ columns of $H$ that are linearly dependent (remember that $d_{\mathrm{min}}(C) = w_{\mathrm{min}}(C)$ - when is $w_{\mathrm{min}}(C)\leq d$ and when is $w_{\mathrm{min}}(C)\geq d$ ?)
In your case, you want to find a couple of linearly dependent columns in your $H$ which is rather trivial