# Finding generator matrix for binary linear code given parity check matrix

I have a parity check matrix for a binary linear code V below:

$$H = \begin{bmatrix} 1 & 0 & 1 & 1 & 1 & 1 \\ 1 & 1 & 0 & 1 & 1 & 1 \\ 1 & 0 & 0 & 1 & 0 & 1 \end{bmatrix}$$

I want to find a generator matrix for V. Is anything different than just converting the parity matrix to the generator since I'm trying to find one for 'V'? As in, put $H$ in standard form to get $[I\mid A]$, then $G = [-A^T \mid I]$?

Steps I did: R3 = R1 + R3 $$H = \begin{bmatrix} 1 & 0 & 1 & 1 & 1 & 1 \\ 1 & 1 & 0 & 1 & 1 & 1 \\ 0 & 0 & 1 & 0 & 1 & 0 \end{bmatrix}$$ R1 = R1 + R3 $$H = \begin{bmatrix} 1 & 0 & 0 & 1 & 0 & 1 \\ 1 & 1 & 0 & 1 & 1 & 1 \\ 0 & 0 & 1 & 0 & 1 & 0 \end{bmatrix}$$

R2 = R2 + R1 $$H = \begin{bmatrix} 1 & 0 & 0 & 1 & 0 & 1 \\ 0 & 1 & 0 & 0 & 1 & 0 \\ 0 & 0 & 1 & 0 & 1 & 0 \end{bmatrix}$$

So the parity matrix is now in the form [I3 | A ] where A = $$A = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 0 \\ 0 & 1 & 0 \end{bmatrix}$$ $$G = [-A^T \mid I] = \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 1 & 1 & 0 \\ 1 & 1 & 0 & 0 & 0 & 1 \end{bmatrix}$$

Is this correct?

Edit: $$G = [-A^T \mid I] = \begin{bmatrix} 1 & 0 & 0 & 1 & 0 & 0 \\ 0 & 1 & 1 & 0 & 1 & 0 \\ 1 & 0 & 0 & 0 & 0 & 1 \end{bmatrix}$$

• You can post mathematical notation using MathJax and $\LaTeX$. I'll format the matrix $H$ for you (unless someone beats me to it!) to give you the idea. – hardmath Oct 21 '15 at 12:32
• Oh thank you! Much easier to read. – pfinferno Oct 21 '15 at 13:19
• The final matrix $G$ is wrong. $-A^T$ is wrong and you don't have the identity in the right block. – Sfarla Oct 21 '15 at 13:54
• Check the last edit, is that correct? I was following an example I found which seemed to have $-A^T$ wrong – pfinferno Oct 21 '15 at 14:11

I think the last edit is correct. But for the row operation part I would do

R1 = R1 + R3, R2 = R2 + R3

and then swap R1 and R3 to get an [I3|A]

The formulas being used are incorrect.

Generator Matrix

G = [I | A]

Parity Matrix H = [ -A Transpose | I]