There are multiple solutions for x in the
congruence relation
3454x≡2(mod4666):
x∈{1128,3461}
Remove the greatest common factor shared between the left-hand side, the right-hand side, and the modulus.
Dividing each by 2 yields 1727x≡1(mod2333). From this, we know that 3454x≡2(mod4666)
has 2 solutions.
This is a different expression in a different modulus, but can be used
to compute the solutions.
We want to find x, and we have 1727x.
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⋅a−1≡1(modn).
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=1727 and a modulus n=2333, 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
as+nt=gcd(a,n) is true. It will also produce the modular multiplicative inverse of
a(modn), provided a and n are coprime.
This is because coprime numbers have a GCD of 1, making the equation 1727s+2333t=1.
You may notice that when s and t are integers, this is a definition for
1727s≡1(mod2333).
According to the definition of modular multiplicative inverse, s is
the modular multiplicative inverse of 1727 in mod 2333.
Solution
To set up the initial state, we set s0=1, t0=0, s1=0, and t1=1.
For a given step i:
ri+1=ri−1−qirisi+1=si−1−qisiti+1=ti−1−qiti
Then, we continue until the remainder is 0.
i01234567891011quotient (q)01215111142remainder (r)17272333172760651591603129210s101−13−423−2750−771128−2333t0101−23−1720−3757−8351727
The GCD is 1, in the remainder column in the second-to-last row, and the value of s is 1128
in the second-to-last row, under the s column.
Checking against the congruence relation 1727s≡1(mod2333), we can see that
1727⋅1128=1948056≡1(mod2333).
Multiplying both sides of the relation 1727x≡1(mod2333) by the modular multiplicative inverse gives us
x≡1128(mod2333).
We were originally solving 3454x≡2(mod4666). In mod 4666, there are
2 numbers that are solutions. Given that there is one unique solution in mod
2333,
the other solution is equivalent in mod 2333,
but distinct in mod 4666.
These distinct solutions can be produced by adding the modulus 2333 to the result until the result
is no longer less
than 4666, meaning the solutions to 3454x≡2(mod4666) are 1128,3461.
These solutions can be verified by plugging them back into the original reduced equation 3454x≡2(mod4666):
3454⋅11283454⋅3461==389611211954294≡≡2(mod4666)2(mod4666)