45x=1mod26
You asked:
Solve the linear congruence $45 x \equiv 1 \pmod{26}$.
MathBot Answer:
There is a unique solution for $x$ in the congruence relation $45 x \equiv 1 \pmod{26}$: $\textcolor{#228B22}{x = 11}$
Since we are working in mod $26$, reduce each coefficient $k$ to $0 \le k < 26$: $19 x \equiv 1 \pmod{26}$.
We want to find $x$, and we have $19 x$.
In normal arithmetic, we would divide to get the answer.
However, division is not well-defined for every
number in modular arithmetic.
Division in modular arithmetic is better defined by the modular multiplicative inverse.
Modular Multiplicative Inverse
Definition
The modular multiplicative inverse of a given number $a$ is written as $a^{-1}$, for which $a \cdot a^{-1} \equiv 1 \pmod{n}$.
Solution
A number $a$ has a modular multiplicative inverse $a^{-1}$ if and only if $a$ and $n$ are coprime.
For a given base $a = 19$ and a modulus $n = 26$, the modular multiplicative inverse can be computed using the Extended Euclidean Algorithm, shown below.
Extended Euclidean Algorithm
Definition
The Extended Euclidean Algorithm is used to compute two integers, $s$ and $t$, for which the equation $a s + n t = \operatorname{gcd}(a, n)$ is true. It will also produce the modular multiplicative inverse of $a \pmod n$, provided $a$ and $n$ are coprime.
This is because coprime numbers have a GCD of 1, making the equation $19 s + 26 t = 1$.
You may notice that when $s$ and $t$ are integers, this is a definition for
$19 s \equiv 1 \pmod{ 26 }$.
According to the definition of modular multiplicative inverse, $s$ is
the modular multiplicative inverse of $19$ in mod $26$.
Solution
To set up the initial state, we set $s_0 = 1$, $t_0 = 0$, $s_1 = 0$, and $t_1 = 1$.
For a given step $i$:
\[
\begin{align*}
r_{i+1} = r_{i-1} - q_{i} r_{i} \\
s_{i+1} = s_{i-1} - q_{i} s_{i} \\
t_{i+1} = t_{i-1} - q_{i} t_{i}
\end{align*}
\]
Then, we continue until the remainder is $0$.
\[\begin{array}{|c|c|c|c|c|}\hline
i & \textnormal{quotient }\left(q\right) & \textnormal{remainder }\left(r\right) & s & t \\\hline
0 & & 19 & 1 & 0 \\\hline
1 & & 26 & 0 & 1 \\\hline
2 & 0 & 19 & 1 & 0 \\\hline
3 & 1 & 7 & -1 & 1 \\\hline
4 & 2 & 5 & 3 & -2 \\\hline
5 & 1 & 2 & -4 & 3 \\\hline
6 & 2 & 1 & 11 & -8 \\\hline
7 & 2 & 0 & -26 & 19 \\\hline
\end{array}\]
The GCD is $1$, in the remainder column in the second-to-last row, and the value of $s$ is $11$
in the second-to-last row, under the $s$ column.
Checking against the congruence relation $19 s \equiv 1 \pmod{ 26 }$, we can see that $19 \cdot 11 = 209 \equiv 1 \pmod{ 26 }$.
Multiplying both sides of the relation $19 x \equiv 1 \pmod{26}$ by the modular multiplicative inverse gives us $x \equiv 11 \pmod{ 26 }$.