Simulataneous equations Suppose you have the following system of linear congruence
$2x+5y$ is congruent to 1 (mod6)
$x+y$ is congruent to 5 (mod6)
where $x,y \in \mathbb{Z}$ 
How would you obtain a general solution for this system. Also is there a way to determine whether the system is solvable or not? 

The system
\begin{align*}
x+y & \equiv 5 \pmod{6}\\
2x+5y & \equiv 1 \pmod{6}
\end{align*}
can be rewritten as
$$
\begin{pmatrix}
1 & 1\\
2 & 5
\end{pmatrix}
\begin{pmatrix}
x\\y
\end{pmatrix}
\equiv \begin{pmatrix}
5\\1
\end{pmatrix} \pmod{6}
$$
Now consider using row-operations (modulo $6$ of course) to get
$$
\left[
\begin{array}{cc|c}
1 & 1 & 5\\
2 & 5 & 1\\
\end{array}
\right]
\longrightarrow \left[
\begin{array}{cc|c}
1 & 1 & 5\\
0 & 3 & 3\\
\end{array}
\right]
$$
The second congruence is $3y \equiv 3 \pmod{6}$. But $\gcd(3,6) \neq 1$ so you cannot simply cancel out $3$. However this gives us $y \equiv 1,3,5 \pmod{6}$. Now the first congruence gives
$$x \equiv 5-y \equiv 4, 2, 0 \pmod{6}.$$
Thus 
$$(x,y) \in \{(4,1), (2,3),(0,5)\} \subset \mathbb{Z}_6 \times \mathbb{Z}_6.$$
Remark: the solvability of such system of congruences $Ax \equiv b \pmod{n}$ is linked to the $\gcd(D, n)$, where $D=\text{det}A$. In particluar, if $\gcd=1$, then the system has a unique solution.
