# More on parity matrices

Here’s a generator matrix,

$G = \left( {\begin{array} {rrrr} 1 & 1 & 0 & 0 \\ 0 & 1 & 0 & 1 \end{array} } \right)$

A parity check matrix for this, $H$ is one where $GH^T = 0$ (hence the product of $H^T$ with a codeword is also 0, though an error word generates a non-zero output).

Two candidates for this present themselves (are there others? I can’t see them):

$H^{\prime}= \left( {\begin{array} {rrrr} 1 & 1 & 1 & 1 \\ 1 & 1 & 0 & 1 \end{array} } \right)$

$H^{\prime\prime}= \left( {\begin{array} {rrrr} 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 \end{array} } \right)$

Taking $H^{\prime}$, there are $2^k$ distinct messages (codewords), where $k = 2$, but he generator can create $2^n = 2^4$ different outputs. So we have $2^k - 1$ non-zero code words and $2^n - 1$ possible outputs, the number of detectable errors is:

$2^n - 1 - (2^k - 1) = 2^n - 2^k = 12$

The most likely error is the one with the lowest Hamming weight:

$\left( {\begin{array} {lrrrr} codewords & 0000 & 0101 & 1100 & 1001 \\e_1 & 0001 & 0100 & 1101 & 1000\\e_2 & 0010 & 0111 & 1110 & 1011 \\e_3 & 0011 & 0110 & 1111 & 1010 \end{array} } \right)$

1. prubin73

H’ works as a parity check matrix, but I think H” does not: H” times (1,1,1,1) yields (0,0), but (1,1,1,1) is not generated by G.

The maths is modulo 2, so surely each row of $GH^{\prime \prime T}$ is zero?