Standard Generator Matrix for Linear Code/Examples/(4, 2) code in Z3/Example 2

Example of Standard Generator Matrix for Linear Code
Let $G$ be the standard generator matrix:


 * $G := \begin{pmatrix}

1 & 0 & 1 & 1 \\ 0 & 1 & 1 & 2 \end{pmatrix}$

$G$ generates the linear code $C$:


 * $C = \set {0000, 0112, 0221, 1011, 1120, 1202, 2022, 2101, 2210}$

The minimum distance of $C$ is $3$, so $C$ detects $2$ transmission errors and corrects $1$ transmission error.

Proof
Multiplying $G$ by the $9$ vectors $00, 01, 02, 10, 11, 12, 20, 21, 22$ in turn gives:

all arithmetic being modulo $3$.

As can be seen, all the codewords have weight $3$.

From Minimum Distance of Linear Code is Smallest Weight of Non-Zero Codeword, the minimum distance of $C$ is $3$.

From Error Detection Capability of Linear Code, $C$ can detect $3 - 1 = 2$ transmission errors.

From Error Correction Capability of Linear Code, $C$ can correct $\floor {\dfrac {3 - 1} 2} = 1$ transmission errors.