Sie sind auf Seite 1von 7

Systems of Linear Congruences

A general system of simultaneous linear


congruences

a1x ≡ b1 (modn1 )
a2x ≡ b2 (modn 2 )

ar x ≡ br (modnr )

can be simplified to the form


€ x ≡ c1 (modm1 )
x ≡ c2 (mod m2 )

x ≡ cr (modmr )

by dividing each congruence through by (a i ,ni ),


ni
then multiplying by the inverse mod mi = (ai ,ni ) of

ai
the coefficient (ai ,ni ) .
The simplified system may or

may not be solvable, but in any case, it must have
the same set of solutions as the
€ original system.

Example: The system

x ≡ 8 (mod12)
x ≡ 6 (mod 9)

has no solutions, since the first congruence implies


that x ≡ 8 ≡ 2 (mod 3), but the second implies that
€ 3), and these are incompatible with
x ≡ 6 ≡ 0 (mod
each other.
€ Example: The system

x ≡ 8 (mod12)
x ≡ 6 (mod13)

is solvable, since the first congruence is equivalent


to the condition that x = 12k + 8 for some integer k,

and substituting this into the second congruence
yields 12k ≡ −2 (mod13), or −k ≡ −2 (mod13), which
simplifies to k ≡ 2 (mod13). Thus k = 13l + 2 for
some integer l, so x = 12(13l + 2) + 8 = 156l + 32.
That is, the system is solved for all x that satisfy
€ x ≡ 32 (mod156). €

These examples illustrate that the relationship
between the moduli of the congruences is the most
€ important condition that determines the solvability
of a system of linear congruences. This was first
discovered by ancient Chinese mathematicians and
was first written down in the Shushu Jiuzhang
(Nine Chapters on the Mathematical Arts) written
by the 13th century mathematician Qin Jiushao.

Chinese Remainder Theorem Let m1 ,m2 ,…,mk


be pairwise relatively prime moduli. Then the
system of congruences
€ )
x ≡ c1 (modm1
x ≡ c2 (mod m2 )

x ≡ cr (modmr )

has a unique solution modulo the product


m = m1m2 mr .

m
Proof Let M i = . Since the mi are pairwise
mi

relatively prime, (M i ,mi ) = 1. Therefore, for each i
we can solve the congruences M i x ≡ 1 (modmi ) to
compute
€ the inverses of the Mi mod mi. Then
−1 −1 −1
x ≡ c1M1M€1 + c2M2M 2 + + cr Mr M r (modm) solves
the system since €

c1M1M1−1 + c2M 2M 2−1 + + cr M r M r−1 ≡ ciM iM i−1 (mod mi )



≡ ci ⋅1 (mod mi )
≡ ci (mod mi )


The solution is unique because if x and y are two
solutions to the system, then for all i, x ≡ y (modmi )
⇒ mi | (x − y), and since the mi are pairwise
relatively prime, it follows that m|(x – y) , or
x ≡ y (modm). //


The proof of the theorem also suggests a speedy
algorithm for computing a solution to the system.
€ We illustrate with our previous example:

c M M −1 cMM −1
x ≡ 8 (mod12) 8 13 1 104
x ≡ 6 (mod13) 6 12 −1 −72
x ≡ 32 (mod156)

The case of the general system can now be handled.


€ Theorem The system of linear congruences

x ≡ c1 (modm1 )
x ≡ c2 (mod m2 )

x ≡ cr (modmr )

has a solution iff for all i ≠ j , ci ≡ c j (mod(mi ,m j )).


The solution,
€ if it exists, is unique mod[m1m2 mr ].

€ €

Proof Consider the case r = 2 first. If the system
of congruences has a solution x = c, then we can
write

c ≡ c1 (mod m1 ) c = km1 + c1

c ≡ c2 (mod m2 ) c = lm2 + c2

for certain integers k, l. Then c1 − c2 = lm2 − km1 , so


(m1,€m2 )|(c1 − c 2 ) ⇒ c1 ≡ c2 (mod(m1,m2 )).

Conversely, suppose c1€≡ c2 (mod(m1, m2 )). If we


write the prime factorizations of the two moduli in

the form

m1 = p1d1 p2d2  p dkk , m2 = p1e1 p2e2  p ekk ,

with di , ei ≥ 0 , then by the CRT, the system



x ≡ c1 (modm1 )
€ x ≡ c2 (mod m2 )

is equivalent to the system



x ≡ c1 (mod p1d1 ), x ≡ c1 (mod p2d2 ),…, x ≡ c1 (mod p dkk )
x ≡ c2 (mod p1e1 ), x ≡ c2 (mod p 2e2 ),…, x ≡ c2 (mod p kek )


Consider the first congruence in each of the two
lines above; if d1 ≥ e1, then by our assumption,
c1 ≡ c2 (mod p1e1 ), so the second congruence
x ≡ c2 (mod p1e1 ) is redundant with respect to the

first congruence x ≡ c (mod p d1 ) and we can discard
1 1
€ the second congruence. Doing the same for the
€ other prime power moduli, we can discard all the
congruences whose moduli are the smaller of the
€ of the prime that appears and retain
two powers
the congruences whose moduli are the larger of the
two powers. Finally, again using the CRT, we can
solve the remaining system and obtain a unique
solution modulo [m1,m2 ].

The proof for r > 2 congruences consists of iterating


the proof for two congruences r – 1 times (since,

e.g., ([m1,m2 ],m3 ) = 1). //

Example: To solve
€ x ≡ 3 (mod 8)
x ≡ 7 (mod12)
x ≡ 4 (mod15)

note first that (8,12)|(7 – 3), (8,15)|(4 – 3), and


(12,15)|(7 – 4), so the system is solvable. Split the
moduli into€prime powers:
x ≡ 3 (mod 8)
x ≡ 7 ≡ 3 (mod 4), x ≡ 7 ≡ 1 (mod 3)
x ≡ 4 ≡ 1 (mod3), x ≡ 4 (mod 5)

then discard the redundant congruences:


€ x ≡ 1 (mod 3)
x ≡ 4 (mod 5)
x ≡ 3 (mod 8)

The resulting system has relatively prime moduli,


so the CRT method applies:

c M M −1 cMM −1
1 40 ≡ 1 (mod3) 1 40
4 24 ≡ −1 (mod 5) −1 −96
3 15 ≡ −1 (mod 8) −1 −45

whence the final solution is x ≡ −101 ≡ 19 (mod120).


Das könnte Ihnen auch gefallen