homomorphisms and chinese remainder algorithms cont
play

Homomorphisms and Chinese Remainder Algorithms (cont.) L. Yohanes - PowerPoint PPT Presentation

Homomorphisms and Chinese Remainder Algorithms(cont.) Homomorphisms and Chinese Remainder Algorithms (cont.) L. Yohanes Stefanus L. Yohanes Stefanus Slide 07.1 Homomorphisms and Chinese Remainder Algorithms(cont.) The Chinese Remainder


  1. Homomorphisms and Chinese Remainder Algorithms(cont.) Homomorphisms and Chinese Remainder Algorithms (cont.) L. Yohanes Stefanus L. Yohanes Stefanus Slide 07.1

  2. Homomorphisms and Chinese Remainder Algorithms(cont.) The Chinese Remainder Problem We will study algorithms for inverting homomorphisms. The Chinese Remainder Problem Given moduli m 0 , m 1 , . . . , m n ∈ Z and given corresponding residues u i ∈ Z m i , 0 ≤ i ≤ n , find an integer u ∈ Z such that u ≡ u i ( mod m i ) , 0 ≤ i ≤ n . The following theorem specifies conditions under which there exists a unique solution to the Chinese remainder problem. L. Yohanes Stefanus Slide 07.2

  3. Homomorphisms and Chinese Remainder Algorithms(cont.) Theorem (5.7: Chinese Remainder Theorem) Let m 0 , m 1 , . . . , m n ∈ Z be integers which are pairwise relatively prime, that is, gcd ( m i , m j ) = 1 for i � = j , and let u i ∈ Z m i , i = 0 , 1 , . . . , n be n + 1 specified residues. For any fixed integer a ∈ Z there exists a unique integer u ∈ Z which satisfies the following conditions: n � a ≤ u < a + m , where m = m i (1) i = 0 u ≡ u i ( mod m i ) , 0 ≤ i ≤ n (2) L. Yohanes Stefanus Slide 07.3

  4. Homomorphisms and Chinese Remainder Algorithms(cont.) Proof: Uniqueness Let u , v ∈ Z be two integers satisfying conditions (1) and (2). Then using the fact that ≡ is an equivalence relation, it follows from condition (2) that u ≡ v ( mod m i ) , for i = 0 , 1 , . . . , n ⇒ u − v ∈ � m i � , for i = 0 , 1 , . . . , n m = � n ⇒ u − v ∈ � m � , where i = 0 m i where we have used the fact that since the moduli m 0 , m 1 , . . . , m n are pairwise relatively prime, an integer which is a multiple of each m i must also be a multiple of the product m . Furthermore, from condition (1) it follows that | u − v | < m and hence u − v = 0 because 0 is the only element of the ideal � m � which has absolute value less than m . Thus u = v . L. Yohanes Stefanus Slide 07.4

  5. Homomorphisms and Chinese Remainder Algorithms(cont.) Proof (cont.): Existence Let u run through the m distinct integer values in the range specified by condition (1) and consider the corresponding ( n + 1 ) -tuples ( φ m 0 ( u ) , φ m 1 ( u ) , . . . , φ m n ( u )) , where φ m i is the modular homomorphism defined by φ m i ( a ) = rem ( a , m i ) for all a ∈ Z . By the uniqueness proof, no two of these ( n + 1 ) -tuples can be identical and hence the ( n + 1 ) -tuples also take on m distinct values. But since the finite ring Z m i contains precisely m i elements there are exactly m = � n i = 0 m i distinct ( n + 1 ) -tuples ( v 0 , v 1 , . . . , v n ) such that v i ∈ Z m i . Hence each possible ( n + 1 ) -tuple occurs exactly once and therefore there must be one value of u in the given range such that ( φ m 0 ( u ) , φ m 1 ( u ) , . . . , φ m n ( u )) = ( u 0 , u 1 , . . . , u n ) . L. Yohanes Stefanus Slide 07.5

  6. Homomorphisms and Chinese Remainder Algorithms(cont.) Different choices of values for the arbitrary integer a in Theorem 5.7 correspond to different representations for the ring Z m . The choice a = 0 corresponds to the familiar positive representation of Z m as Z m = { 0 , 1 , . . . , m − 1 } where m is positive. The choice a = − m − 1 corresponds to the symmetric 2 representation of Z m as Z m = {− m − 1 , . . . , − 1 , 0 , 1 , . . . , m − 1 } 2 2 where m is odd positive. In practical applications, usually all of the moduli m 0 , m 1 , . . . , m n and m are odd positive integers. L. Yohanes Stefanus Slide 07.6

  7. Homomorphisms and Chinese Remainder Algorithms(cont.) Garner’s Chinese Remainder Algorithm The key to Garner’s algorithm is to express the solution u ∈ Z m in the mixed radix representation: n − 1 � u = v 0 + v 1 ( m 0 ) + v 2 ( m 0 m 1 ) + · · · + v n ( m i ) (3) i = 0 where v k ∈ Z m k for k = 0 , 1 , . . . , n . L. Yohanes Stefanus Slide 07.7

  8. Homomorphisms and Chinese Remainder Algorithms(cont.) Example Let m 0 = 3, m 1 = 5, m 2 = 7, m 3 = 11, and m = m 0 m 1 m 2 m 3 = 1155 . Using the positive representation, the integer u = 868 ∈ Z 1155 has the unique mixed radix representation 868 = v 0 + v 1 ( 3 ) + v 2 ( 15 ) + v 3 ( 105 ) with v 0 = 1 ∈ Z 3 , v 1 = 4 ∈ Z 5 , v 2 = 1 ∈ Z 7 , and v 3 = 8 ∈ Z 11 . L. Yohanes Stefanus Slide 07.8

  9. Homomorphisms and Chinese Remainder Algorithms(cont.) Expressing the solution u of the system of congruences (2) in the mixed radix representation (3), it is straightforward to determine the coefficients v k (0 ≤ k ≤ n ) appearing in (3). From (3) we have u ≡ v 0 ( mod m 0 ) and therefore the case i = 0 of the system of congruences (2) will be satisfied if v 0 ∈ Z m 0 is chosen such that v 0 ≡ u 0 ( mod m 0 ) . (4) L. Yohanes Stefanus Slide 07.9

  10. Homomorphisms and Chinese Remainder Algorithms(cont.) In general for k ≥ 1, we have from (3) that k − 1 � u ≡ v 0 + v 1 ( m 0 ) + · · · + v k ( m i ) ( mod m k ) . i = 0 If coefficients v 0 , v 1 , . . . , v k − 1 have been determined then we can satisfy the case i = k of the system of congruences (2) by choosing v k such that k − 1 � v 0 + v 1 ( m 0 ) + · · · + v k ( m i ) ≡ u k ( mod m k ) . i = 0 This congruence equation can be solved for v k ∈ Z m k , k ≥ 1: k − 2 � v k ≡ ( u k − [ v 0 + v 1 ( m 0 )+ · · · + v k − 1 ( m i )]) M ( mod m k ) (5) i = 0 i = 0 m i ) − 1 appearing here is valid where the inverse M = ( � k − 1 because � k − 1 i = 0 m i is relatively prime to m k . L. Yohanes Stefanus Slide 07.10

  11. Homomorphisms and Chinese Remainder Algorithms(cont.) Algorithm 5.1: Garner’s Chinese Remainder Algorithm Garner’s Chinese Remainder Algorithm procedure IntegerCRA( ( m 0 , . . . , m n ) , ( u 0 , . . . , u n ) ) # Given moduli m i ∈ Z ( 0 ≤ i ≤ n ) which are pairwise # relatively prime and corresponding residues u i ∈ Z m i , # compute the unique integer u ∈ Z m (where m = � n i = 0 m i ) # such that u ≡ u i ( mod m i ) , i = 0 , 1 , . . . , n . # Step 1 : Compute the required inverses using a # procedure reciprocal(a,q) which gives a − 1 ( mod q ) . for k from 1 to n do { product ← φ m k ( m 0 ) for i from 1 to k − 1 do product ← φ m k ( product · m i ) γ k ← reciprocal ( product , m k ) } L. Yohanes Stefanus Slide 07.11

  12. Homomorphisms and Chinese Remainder Algorithms(cont.) Algorithm 5.1 (cont.) # Step 2 : Compute the mixed radix coeffs v k . v 0 ← u 0 for k from 1 to n do { temp ← v k − 1 for j from k − 2 to 0 by − 1 do temp ← φ m k ( temp · m j + v j ) v k ← φ m k (( u k − temp ) · γ k ) } L. Yohanes Stefanus Slide 07.12

  13. Homomorphisms and Chinese Remainder Algorithms(cont.) Algorithm 5.1 (cont.) # Step 3 : Convert from mixed radix representation # to standard representation u ← v n for k from n − 1 to 0 by − 1 do u ← u · m k + v k return ( u ) end procedure L. Yohanes Stefanus Slide 07.13

  14. Homomorphisms and Chinese Remainder Algorithms(cont.) Remarks on Garner’s algorithm Step 3 performs the evaluation of (3) using the method of nested multiplication: u = v 0 + m 0 ( v 1 + m 1 ( v 2 + · · · + m n − 2 ( v n − 1 + m n − 1 ( v n )) · · · )) . L. Yohanes Stefanus Slide 07.14

  15. Homomorphisms and Chinese Remainder Algorithms(cont.) Example Take as moduli the three (single-precision) integers which are odd and pairwise relatively prime: m 0 = 99, m 1 = 97, m 2 = 95. Then m = m 0 m 1 m 2 = 912285. Using the symmetric representation, the range of integers in Z 912285 is − 456142 ≤ u ≤ 456142. Consider the problem of determining u given that: u ≡ 49 ( mod 99 ); ≡ − 21 ( mod 97 ); u u ≡ − 30 ( mod 95 ) . L. Yohanes Stefanus Slide 07.15

  16. Homomorphisms and Chinese Remainder Algorithms(cont.) Example (cont.) Applying Algorithm 5.1, in step 1 we compute the following inverses: ( mod m 1 ) = 2 − 1 ( mod 97 ) = − 48, γ 1 = m − 1 0 γ 2 = ( m 0 m 1 ) − 1 ( mod m 2 ) = 8 − 1 ( mod 95 ) = 12. In step 2 we obtain the following mixed radix coefficients for u : v 0 = 49 , v 1 = − 35 , v 2 = − 28 . Finally, in step 3 we get the (multiprecision) solution: u = − 272300 . L. Yohanes Stefanus Slide 07.16

  17. Homomorphisms and Chinese Remainder Algorithms(cont.) Example Back to the system of linear equations on Slide 06.02. Now we look at the system over the domains Z p for various primes p . By Cramer’s rule, each component of the solution is a ratio of two determinants. If we let  1 44 74   22 1 74   , y 1 = det x 1 = det − 2 14 − 10 15 − 2 − 10    34 − 28 20 − 25 34 20  22 44 1   22 44 74   , d = det z 1 = det 15 14 − 2 15 14 − 10    − 25 − 28 − 25 − 28 34 20 then x 1 , y 1 , z 1 and d will be integers and the solution is x = x 1 d , y = y 1 d , z = z 1 d . L. Yohanes Stefanus Slide 07.17

  18. Homomorphisms and Chinese Remainder Algorithms(cont.) Example (cont.) Fortunately, for a given domain Z p we need not calculate the determinants. Instead, we find the modular solution x ( mod p ) , y ( mod p ) , z ( mod p ) , d ( mod p ) using the usual efficient Gaussian elimination method, and use x 1 ≡ x d ( mod p ) , y 1 ≡ y d ( mod p ) , z 1 ≡ z d ( mod p ) to obtain modular representations for x 1 , y 1 , z 1 , and d . Application of Garner’s algorithm gives integer representations for these four quantities and hence rational number answers for x , y , and z . L. Yohanes Stefanus Slide 07.18

Recommend


More recommend