I am having trouble finding mod arithmetic questions.
Can you show how to solve these?
$x + 30 \equiv 1 \pmod {12}$
$30x \equiv 1 \pmod {12}$
$x + 3y \equiv 1 \pmod {12}$ and $2x + y \equiv 7 \pmod {12}$
I am having trouble finding mod arithmetic questions.
Can you show how to solve these?
$x + 30 \equiv 1 \pmod {12}$
$30x \equiv 1 \pmod {12}$
$x + 3y \equiv 1 \pmod {12}$ and $2x + y \equiv 7 \pmod {12}$
$\begin{align} x + 30 & \equiv 1 \pmod {12} \\ \\ x + 30 - 30 &\equiv 1 - 30 \pmod{12} \\ \\ x \equiv -29 \pmod{12} \end{align}$.
Now, we can add any multiple of 12 to $-29$ if we want to find $x \in \{0, 1, 2, \ldots, 10, 11\}$. Specifically, we find that $-29 + 3\cdot 12 = -29 + 36 = 7$. So $x \equiv -29 \equiv 7 \pmod {12}$.
For the next question, we need to find the multiplicative inverse of 30 (modulo $12$) to clear the coefficient of $x$.
$$30x \equiv 1 \pmod {12}$$
Indeed, in this situation, no solution exists.
So, for practice, let's solve $$30x \equiv 1 \pmod {11}$$
$$\dfrac 1{30} \equiv \dfrac {1 + 9\cdot 11}{30} = \frac{100}{30} \equiv \dfrac{100 + 10\cdot 11}{30} = \dfrac {210}{30} = 7$$
This means that $7$ is the multiplicative inverse of $30 \pmod{11}$: $7\cdot 30 \equiv 1 \pmod 11$:
$$7 \cdot 30 x\equiv 7\cdot 1 \pmod{11} \iff x \equiv 1 \pmod {11}$$
They are just like the normal equations but without division.
Let us solve the last one:
$$+3≡1 \pmod{12}$$
$$2+≡7\pmod{12}$$
From the first one: $$x \equiv 1-3y \pmod{12}$$
Substitute in the second: $$2(1-3y) + y ≡ 7\pmod{12}$$
$$2-6y + y ≡ 7\pmod{12}$$
$$2-5y ≡ 7\pmod{12}$$
$$-5y ≡ 5\pmod{12}$$
You can divide by $-1$, as it is its own inverse modulo $12$)
$$5y ≡ -5\pmod{12}$$
Instead of dividing by $5$, we need to get the multiplicative inverse of $5$ (i.e. the number $k$ that when we multiply it by $5$, we get $1 \pmod{12}$),
$$5 k ≡ 1 \pmod{12}$$
The easiest way is by trying different $k$ values, you can figure out that $k = 5$ as $25 ≡ 1 \pmod{12}$. Hence,
$$y ≡ -5 \cdot 5 \pmod{12}$$
$$y ≡ -25 \pmod{12}$$
By adding $12$ three times to $-25$, $$y ≡ 11 \pmod{12}$$
and $$x \equiv -32 \pmod{12}$$
By adding $12$ three times to $-32$, $$x \equiv 4\pmod{12}$$