Anda di halaman 1dari 8

The Chinese Remainder

Theorem
Consider
Oystein Ore mentions a puzzle with a dramatic element from
Brahma-Sphuta-Siddhanta (Brahma's Correct System) by
Brahmagupta (born !" #$)%
#n old woman goes to mar&et and a horse steps on her bas&et and
crushes the eggs' The rider offers to pay for the damages and as&s
her how many eggs she had brought' She does not remember the
e(act number) but when she had ta&en them out two at a time)
there was one egg left' The same happened when she pic&ed them
out three) four) fi*e) and si( at a time) but when she too& them
se*en at a time they came out e*en' +hat is the smallest number
of eggs she could ha*e had,
The Chinese Remainder Theorem
Theorem% Suppose that m
-
) m
.
) ''') m
r
are pairwise relati*ely prime
positi*e integers) and let a
-
) a
.
) ''') a
r
be integers' Then the system of
congruences) ( a
i
(mod m
i
) for - i r) has a uni/ue solution
modulo 0 1 m
-
m
.
''' m
r
) which is gi*en by%
( a
-
0
-
y
-
2 a
.
0
.
y
.
2 ''' 2 a
r
0
r
y
r
(mod 0))
where 0
i
1 03m
i
and y
i
(0
i
)
4-
(mod m
i
) for - i r'
The Chinese Remainder Theorem
Theorem% Suppose that m
-
) m
.
) ''') m
r
are pairwise relati*ely prime positi*e integers) and let a
-
) a
.
) ''') a
r
be integers' Then the system of
congruences) ( a
i
(mod m
i
) for - i r) has a uni/ue solution modulo 0 1 m
-
m
.
''' m
r
) which is gi*en by%
( a
-
0
-
y
-
2 a
.
0
.
y
.
2 ''' 2 a
r
0
r
y
r
(mod 0))
where 0
i
1 03m
i
and y
i
(0
i
)
4-
(mod m
i
) for - i r'
Pf% 5otice that gcd(0
i
) m
i
) 1 - for - i r' Therefore) the y
i
all e(ist
(determined easily from the e(tended 6uclidean #lgorithm)' 5ow) notice
that since 0
i
y
i
- (mod m
i
)) we ha*e a
i
0
i
y
i
a
i
(mod m
i
) for - i r'
On the other hand) a
i
0
i
y
i
7 (mod m
8
) if 8 i (since m
8
9 0
i
in this case)'
Thus) we see that ( a
i
(mod m
i
) for - i r'
:f (
7
and (
-
were solutions) then we would ha*e (
7
4 (
-
7 (mod m
i
) for
all i) so (
7
4 (
-
7 (mod 0)) i'e') they are the same modulo 0'
6(ample
Find the smallest multiple of 10 which has remainder 2 when divided
by 3, and remainder 3 when divided by 7.
+e are loo&ing for a number which satisfies the congruences) ( . mod
;) ( ; mod <) ( 7 mod . and ( 7 mod ' Since) .) ;) and < are all
relati*ely prime in pairs) the Chinese Remainder Theorem tells us that
there is a uni/ue solution modulo .-7 ( 1 .;<)' +e calculate the
0
i
's and y
i
's as follows%
0
.
1 .-73. 1 -7= y
.
(-7)
4-
(mod .) 1 -
0
;
1 .-73; 1 <7= y
;
(<7)
4-
(mod ;) 1 -
0

1 .-73 1 >.= y

(>.)
4-
(mod ) 1 ; and
0
<
1 .-73< 1 ;7= y
<
(;7)
4-
(mod <) 1 >'
So) ( 7(0
.
y
.
) 2 .(0
;
y
;
) 2 7(0

) 2 ;(0
<
y
<
) 7 2 .(<7)(-) 2 7 2
;(;7)(>) ->7 2 ;?7 77 mod .-7 80'
Bro&en 6ggs
The number of bro&en eggs) () must satisfy%
( - mod .)
( - mod ;)
( - mod >)
( - mod )
( - mod ? and
( 7 mod <'
The first congruence says that ( is odd) so we shall &eep this in
mind and ignore this congruence' To use our theorem) we will
also omit the congruence ( 1 mod ? so that the moduli of the
remaining congruences (;) >) and <) are relati*ely prime in
pairs'
Bro&en 6ggs
The Chinese Remainder theorem indicates that there is a uni/ue
solution modulo >.7 ( 1 ; > <)) which is calculated by%
0
3
1 >.73; 1 ->7 y
3
(->7)
1
mod ; 1 .
0
!
1 >.73> 1 -7 y
!
(-7)
1
mod > 1 -
0
"
1 >.73 1 "> y
"
(">)
1
mod 1 >
0
7
1 >.73< 1 ?7 y
7
(?7)
1
mod < 1 .
so ( -(->7)(.) 2 -(-7)(-) 2 -(">)(>) 2 7(?7)(.) 1 ."7 2 -7 2
;;? 1 <.- mod >.7 1 301'
#s this *alue of ( is odd and satisfies ( - mod ?) it is the smallest
solution of the bro&en eggs problem'
5otes
#emar$ 1% The theorem is *alid in much more general situations
than we ha*e presented here'

#emar$ 2% The condition gi*en is sufficient) but not necessary for a
solution' 5ecessary and sufficient conditions e(ist but we are not
presenting them'
#emar$ 3% :t is purported that Sun Tsu was aware of this result in
the first century #'$'