Showing posts with label Chinese Remainder Theorem. Show all posts
Showing posts with label Chinese Remainder Theorem. Show all posts

Saturday, 30 March 2013

Chinese Remainder Theorem 中国剩余定理

中国剩余定理CRT (Chinese Remainder Theorem)
X ≡ 2 (mod 3)
X ≡ 3 (mod 5)
X ≡ 2 (mod 7)
Solve X?
明. 程大位 "算法统宗" (1593)
3人同行70稀
5树梅花21支
7子团圆半个月(15)
除百零五(105)便得知
Let remainders:
$Latex r_3=2, r_5=3, r_7=2$
$Latex r= r_3.70+ r_5.21 + r_7.15 (mod 3.5.7)$
r= 2.70 +3.21 +2.15 (mod 105)
r= 140 +63 +30 (mod 105)
r= 233 (mod 105)
$latex r= 23 = x_{min}$
or X= 23 +105Z (23 + multiples of 105)

-------------------------------------------
CRT: Why 3:70, 5:21, 7:15
X ≡ 2 (mod 3)
X ≡ 3 (mod 5)
X ≡ 2 (mod 7)

1) Find A such that
A ≡ 1 (mod 3)
A ≡ 0 (mod 5)
A ≡ 0 (mod 7)

=> 5|A, 7|A => 35 |A
A=35, 70 ...

70 ≡ 1 (mod 3)

=> 70x2 ≡ 2 (mod 3)

2) Find B s.t.:

B ≡ 0 (mod 3)

B ≡ 1 (mod 5)

B ≡ 0 (mod 7)


3|B, 7|B => 21|B

21 ≡ 1 (mod 5)

=> 21x3 ≡ 3 (mod 5)


3) Find C s.t. :

C ≡ 0 (mod 3)

C ≡ 0 (mod 5)

C ≡ 1 (mod 7)

=> 3|C, 5|C => 15|C

=> C=15≡ 1 (mod 7)

15x2 ≡ 2 (mod 7)


4)

X ≡ 70x2 +21x3+ 15x2 (mod 3x5x7)

X≡ 233 (mod 105)

X≡ 23 (mod 105)

X= 23+105Z


----------------Ring Theory -------------------------------
Commutative Ring CRT by Ring/ Ideal Theory:
If R is a commutative ring & A1,...An are pairwise coprime ideals,
Prove that if
$Latex r_1, r_2, \cdots, r_n$ belong to R
Then there exists 'a' belongs to R with
$Latex a + A_j= r_j + A_j$ ; j ∈[1,n]
Interpretation:
Let R= Z ring
X ≡ 2 (mod 3)
X ≡ 3 (mod 5)
X ≡ 2 (mod 7)
Or
X ≡ rj (mod mj)

Ideal = (m) = mZ
$Latex A_3=(3), A_5=(5), A_7=(7)$
$latex r_3=2, r_5=3, r_7=2$
There exists
a=23
$Latex a +A_3 = r_3 + A_3$
23+(3)= 2+ (3)
23 + 1x3 =2 + 8x3 =26