9x=23mod28
You asked:
Solve the linear congruence .
MathBot Answer:
There is a unique solution for in the congruence relation :
We want to find , and we have .
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 is written as , for which .
Solution
A number has a modular multiplicative inverse if and only if and are coprime.
For a given base and a modulus , 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, and , for which the equation is true. It will also produce the modular multiplicative inverse of , provided and are coprime.
This is because coprime numbers have a GCD of 1, making the equation .
You may notice that when and are integers, this is a definition for
.
According to the definition of modular multiplicative inverse, is
the modular multiplicative inverse of in mod .
Solution
To set up the initial state, we set , , , and .
For a given step :
Then, we continue until the remainder is .
The GCD is , in the remainder column in the second-to-last row, and the value of is
in the second-to-last row, under the column.
Checking against the congruence relation , we can see that .
Multiplying both sides of the relation by the modular multiplicative inverse gives us .