9x=23mod28

asked by guest
on Mar 28, 2025 at 2:16 am



You asked:

Solve the linear congruence 9x23(mod28)9 x \equiv 23 \pmod{28}.

MathBot Answer:

There is a unique solution for xx in the congruence relation 9x23(mod28)9 x \equiv 23 \pmod{28}: x=15\textcolor{#228B22}{x = 15}



We want to find xx, and we have 9x9 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 aa is written as a1a^{-1}, for which aa11(modn)a \cdot a^{-1} \equiv 1 \pmod{n}.

Solution

A number aa has a modular multiplicative inverse a1a^{-1} if and only if aa and nn are coprime.

For a given base a=9a = 9 and a modulus n=28n = 28, 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, ss and tt, for which the equation as+nt=gcd(a,n)a s + n t = \operatorname{gcd}(a, n) is true. It will also produce the modular multiplicative inverse of a(modn)a \pmod n, provided aa and nn are coprime.

This is because coprime numbers have a GCD of 1, making the equation 9s+28t=19 s + 28 t = 1.
You may notice that when ss and tt are integers, this is a definition for 9s1(mod28)9 s \equiv 1 \pmod{ 28 }.
According to the definition of modular multiplicative inverse, ss is the modular multiplicative inverse of 99 in mod 2828.

Solution

To set up the initial state, we set s0=1s_0 = 1, t0=0t_0 = 0, s1=0s_1 = 0, and t1=1t_1 = 1.
For a given step ii: ri+1=ri1qirisi+1=si1qisiti+1=ti1qiti \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 00. iquotient (q)remainder (r)st0910128012091033131490289\begin{array}{|c|c|c|c|c|}\hline i & \textnormal{quotient }\left(q\right) & \textnormal{remainder }\left(r\right) & s & t \\\hline 0 & & 9 & 1 & 0 \\\hline 1 & & 28 & 0 & 1 \\\hline 2 & 0 & 9 & 1 & 0 \\\hline 3 & 3 & 1 & -3 & 1 \\\hline 4 & 9 & 0 & 28 & -9 \\\hline \end{array} The GCD is 11, in the remainder column in the second-to-last row, and the value of ss is 3-3 in the second-to-last row, under the ss column.

Checking against the congruence relation 9s1(mod28)9 s \equiv 1 \pmod{ 28 }, we can see that 93=271(mod28)9 \cdot -3 = -27 \equiv 1 \pmod{ 28 }.

Multiplying both sides of the relation 9x23(mod28)9 x \equiv 23 \pmod{28} by the modular multiplicative inverse gives us x15(mod28)x \equiv 15 \pmod{ 28 }.