Nonbinary Hamming codes. (1) Generalize Proposition 5.5 to the following: a linear code corrects single errors if and only if every parity check matrix has the property that no column is a scalar multiple of a different column.
By a Hamming code is meant a code with a parity check matrix $\mathrm{H}$ such that
(a) no column of $\mathbf{H}$ is a scalar multiple of a different column,
(b) $\mathbf{H}$ is maximal w.r.t. (a), i.e., every word of length $m$ is a scalar multiple of some column of $\mathbf{H}$.
Prove that condition (a) can be safeguarded by choosing as columns all words with the leading term (i.e., the first nonzero term) equal to 1 .
(2) Verify that the following is a parity check matrix of a Hamming code over $\mathbf{Z}_3$ :
$$
\mathbf{H}=\left[\begin{array}{llll}
0 & 1 & 1 & 1 \\
1 & 0 & 1 & 2
\end{array}\right] .
$$
Find a table of syndrome decoding that code.
(3) Find a parity check matrix of $m=3$ rows for a Hamming code over $\mathbf{Z}_3$.
(4) Prove that for each $m$, there is a Hamming $\left(\frac{3^m-1}{2}, \frac{3^m-1}{2}-m\right)$ code over $\mathbf{Z}_3$.
(5) Generalize (4) to any finite field.