Homepage Solution manuals Ivan Niven An Introduction to the Theory of Numbers Exercise 3.3.25* (Rabin-Miller algorithm versus Solovay-Strassen algorithm)

Exercise 3.3.25* (Rabin-Miller algorithm versus Solovay-Strassen algorithm)

Let m be an odd positive integer, and let 𝒢 and be defined as in Problems 21 and 24. Show that 𝒢 .

Answers

To write this solution, I used the course of Saux Picart, Rannou, “Cours de calcul formel”, p.77-79.

Proof. Here m is an odd positive integer, such that m 1 = 2 k d , where 2 d .

Recall that

𝒢 = { α ( mℤ ) × α ( m 1 ) 2 = ( α m ) } , = { α ( mℤ ) × α d = 1  or  j [ [ 0 , k [ [ , α 2 j d = 1 }

Let α = [ a ] m ( a ) be any element of . Then

a d 1 ( mod m )  or  j [ [ 0 , k [ [ , a 2 j d 1 ( mod m ) .

  • Assume first that a d 1 ( mod m ) . Then a ( m 1 ) 2 k 1 ( mod m ) , where k 1 , since p 1 is even. Hence

    a m 1 2 = ( a m 1 2 k ) 2 k 1 1 ( mod m ) .

    It remains to show that ( a m ) = 1 . Since a d 1 ( mod m ) ,

    ( a m ) d = ( a d m ) = ( 1 m ) = 1 ,

    where d is odd, and ( a m ) = ± 1 , thus ( a m ) d = ( a m ) , which gives

    ( a m ) = 1 .

    So a m 1 2 ( a m ) = 1 ( mod m ) . This shows that α = [ a ] p 𝒢 .

  • Assume now that a 2 j d 1 ( mod m ) for some integer j , 0 j < k .

    We begin by computing ( a p ) for the prime divisors p of m . Let p m be such a prime divisor. Then p is odd, and there are some integers s , t such that p 1 = 2 s t , 2 t , s 1 . Since t is odd,

    ( a 2 j d ) t ( 1 ) t = 1 ( mod , ) .

    where p m , thus

    ( a 2 j t ) d 1 ( mod p ) .

    Since d is also odd,

    a 2 j t 1 ( mod p ) .

    By Fermat’s Theorem, 1 a p 1 = a 2 s t ( mod p ) . Assume, for the sake of contradiction, that s j . Then 1 ( a 2 s t ) 2 j s = a 2 j t 1 ( mod p ) . This is impossible, because p is odd. This contradiction shows that s j + 1 . Moreover

    • If s = j + 1 , then

      ( a p ) a p 1 2 = a 2 s 1 t = a 2 j t 1 ( mod p ) ,

      so ( a p ) = 1 .

    • If s > j + 1 , then

      ( a p ) a 2 s 1 t = ( a 2 j t ) 2 s j 1 ( 1 ) 2 s j 1 1 ( mod p ) .

    To summarize, under the hypothesis a d 2 j 1 ( mod m ) ( 0 j < k ) , if p = 1 + 2 s t is a prime divisor of m = 1 + 2 k d , then s j + 1 , and

    ( a p ) = { 1 if  s = j + 1 , + 1 if  s > j + 1 . (1)

    Now we can compare a ( m 1 ) 2 and ( a m ) .

    • Suppose first that j < k 1 . From a 2 j d 1 ( mod m ) , we deduce

      a m 1 2 = a 2 k 1 d = ( a 2 j d ) 2 k 1 j ( 1 ) 2 k 1 j = 1 ( mod m ) .

      Write m = p 1 p 2 p l , where the p i are not necessarily distinct. Then ( a m ) = i = 1 l ( a p i ) . By equation (1), the only p i (distinct or not) whose contribution in this product is 1 are the p i = 1 + 2 s i t i ( 2 t i ) such that s i = j + 1 , so that p i = 1 + 2 j + 1 t i . If there are q such prime factors p i , then ( a m ) = ( 1 ) q . By renumbering the p i , we may suppose that these p i are p 1 , p 2 , , p q and the others are p q + 1 , , p l , which satisfy p i 1 ( mod 2 j + 2 ) ( q + 1 i l ), so that p i = 1 + 2 j + 2 u i for some integers u i , and

      m = 1 + 2 k d = ( 1 + 2 j + 1 t 1 ) ( 1 + 2 j + 1 t q ) ( 1 + 2 j + 2 u q + 1 ) ( 1 + 2 j + 2 u l ) ( 1 + 2 j + 1 ) q ( mod 2 j + 2 ) .

      Since k q + 2 , 2 k d 0 ( mod 2 j + 2 ) , thus

      1 ( 1 + 2 j + 1 ) q ( mod 2 j + 2 ) .

      By the binomial formula,

      1 1 + q 2 j + 1 ( mod 2 j + 2 ) ,

      thus q 0 ( mod 2 ) , so q is even and ( a m ) = ( 1 ) q = 1 . This shows that a ( m 1 ) 2 ( a m ) , so α = [ a ] p 𝒢 .

    • It remains the case where j = k 1 . Then a 2 k 1 d 1 ( mod m ) , so a ( m 1 ) 2 1 ( mod p ) . With the same notations as in the previous case,

      m = 1 + 2 j + 1 d ( 1 + 2 j + 1 ) q ( mod 2 j + 2 ) .

      Therefore, since d is odd, 1 + 2 j + 1 1 + q 2 j + 1 ( mod 2 j + 2 ) , thus q 1 ( mod 2 ) , and ( a m ) = ( 1 ) q = 1 a ( m 1 ) 2 . So α = [ a ] p 𝒢 .

In all cases, α 𝒢 . We have proved that

𝒢 .

Note: This shows that there are more bases a for which m is an Euler’s pseudo-prime to the base a (satisfying a ( m 1 ) 2 ( a m ) ), than bases a for which m is a strong pseudo prime to the base a . This explains that the strong pseudo-prime test (algorithm of Rabin-Miller) is more efficient that the algorithm of Solovay-Strassen, based on the Euler’s pseudo-primes.

User profile picture
2024-11-10 15:30
Comments