Solve matrix equation modulo

linear algebramodular arithmetic

Let $Ax=b$, as $A|b$ is given by:

$$\left(\begin{array}{ccc}
3 & 1 & 4\\
5 & 2 & 6\\
0 & 5 & 2
\end{array}\left|\begin{array}{c}
1\\
5\\
1
\end{array}\right.\right)$$

I want so solve the linear system: $$A\vec{x} = \vec{b} \mod{7}$$

I am quite new to modular arithmetic. I know how to row reduce $[A|b]$ in $\mathbb{Z}_7$. I am not sure what this question demands though.

Is it asking to obtain $rref[A|b]$ over $\mathbb{Z}_7$ get the solution?


Edit:
Based on the method commented below, I found rref(A|b) over $\mathbb{Z}_7$:
$$ \begin{bmatrix} 1 & 0 & 0 & 4 \\ 0 & 1 & 0 & 3 \\ 0 & 0 & 1 & 0 \end{bmatrix} $$
which gives the solution to $A\vec{x} = b \mod{7}$ as
$$ \vec{x} = \begin{pmatrix} 4 \\ 3 \\ 0 \end{pmatrix} $$

Best Answer

You may solve it as if the system is over the ring $\mathbb{Z}$, and then convert it to $\mathbb{Z}_7$, but you'd probably need to preform more actions and it will be harder than by performing actions above $\mathbb{Z}_7$ from the beginning. Try to continue from here:

Thus: $ {\left(\begin{array}{ccc} 3 & 1 & 4\\ 5 & 2 & 6\\ 0 & 5 & 2 \end{array}\left|\begin{array}{c} 1\\ 5\\ 1 \end{array}\right.\right){\overset{R_{2}-4R_{1}\to R_{1}}{\Longrightarrow}}}\left(\begin{array}{ccc} 3 & 1 & 4\\ -7 & -2 & -10\\ 0 & 5 & 2 \end{array}\left|\begin{array}{c} 1\\ 1\\ 1 \end{array}\right.\right)$

and remember to convert these values to modulo 7.