Find all solutions of the following linear congruence $2x+3y≡1\pmod 7$

\begin{align} 2x+3y\equiv 1\bmod 7 &\iff 3y\equiv 1-2x\equiv 1+5x\bmod 7\\ &\iff y\equiv5(1+5x)\equiv5+4x \bmod 7 \end{align}

The last step is because $5$ is the inverse of $3\bmod 7$.

So this looks like a function. For every value of $x$ there is exactly one value of $y$ that makes the congruence hold.


For congruences involving small coefficients, a bit of familiarity with numbers, a bit of trial and error, and knowledge of basic congruence theorems can save a lot of messing around with inverses. Here is how I would solve the problem. First rewrite it as $$2x\equiv1-3y\pmod7\ .$$ Now the congruence $2x\equiv a\pmod7$ has a unique solution for each $a$, because $2$ and $7$ are coprime. So the above congruence will be satisfied by one $x$ value for each $y$ value. To find a solution I would say, wouldn't it be nice if the RHS were even? - then I could just cancel $2$. So I would write $$2x\equiv 8+4y\pmod7\quad\Leftrightarrow\quad x\equiv4+2y\pmod7\ ,$$ and this is the solution.

Exercise. Repeat the working but starting "the other way round", that is, $$3y\equiv1-2x\pmod7\ .$$ You will probably find that you obtain a solution which looks different, then it would be a good idea to check that it is really the same.


This is the same as solving things as usual, note that

$$2x\equiv 1-3y\implies x\equiv 2^{-1}(1-3y)\mod 7$$

modulo $7$, the inverse of $2$ is $4$ since $2\cdot 4\equiv 1\mod 7$, so we get

$$x\equiv 4-12y\equiv 4-5y\mod y$$

So then your solutions are $\{(4-5y,y)\mod 7: 0\le y\le 6)\}$ If you prefer $x$ over $y$, then note $5y\equiv 4-x\mod 7$ by solving the highlighted equation for $x$, and you can as easily do $\{(x,5-3x)\mod 7 : 0\le x\le 6\}$.