Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Algorithm
Conclusion
References
A -Typeset by LTEX-
Motivation
Algorithm
Conclusion
References
Contents
1
Motivation
Cryptography - Encryption mechanisms The properties of numbers The element of randomization
Motivation
Algorithm
Conclusion
References
Contents
1
Motivation
Cryptography - Encryption mechanisms The properties of numbers The element of randomization
Algorithm
denition Interpretation of the algorithm Pseudocode Expected Running Time Error Bounds Implementation Witnessing and Non Witnessing
Motivation
Algorithm
Conclusion
References
Contents
1
Motivation
Cryptography - Encryption mechanisms The properties of numbers The element of randomization
Algorithm
denition Interpretation of the algorithm Pseudocode Expected Running Time Error Bounds Implementation Witnessing and Non Witnessing
Conclusion
Motivation
Algorithm
Conclusion
References
Contents
1
Motivation
Cryptography - Encryption mechanisms The properties of numbers The element of randomization
Algorithm
denition Interpretation of the algorithm Pseudocode Expected Running Time Error Bounds Implementation Witnessing and Non Witnessing
3 4
Conclusion References
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Since, there is no real time ecient algorithm for primality testing we see the need for randomization.There are several randomized algorithms testing primality of number with certain condence (with a controllably small probability of error.)
Motivation
Algorithm
Conclusion
References
Since, there is no real time ecient algorithm for primality testing we see the need for randomization.There are several randomized algorithms testing primality of number with certain condence (with a controllably small probability of error.) One such algorithm is Rabin Miller Probabilistic Primality test.
Motivation
Algorithm
Conclusion
References
Definition Given (b,n), where n is the number to test for the primality, and b is randomly chosen from Zn -{0}. Let n-1 = 2q m, where m is an odd integer. if either b m 1(mod n) or there is an integer i in [0,q-1] such that b m2 -1(mod n) then return probabily prime else return composite NOTE : Rabin-Miller is a Monte Carlo algorithm: there is a nonzero probability of error.
i
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Pseudocode
Pseudocode Input: n 4, an odd integer to be tested for primality; Input: k, a parameter that determines the accuracy of the test Output: composite if n is composite, otherwise probably prime write n 1 as 2s d with d odd by factoring powers of 2 from n 1 LOOP: repeat k times: pick a randomly in the range [2, n 2] x ad mod n if x = 1 or x = n 1 then do next LOOP for r = 1 .. s1 x x 2 mod n if x = 1 then return composite if x = n 1 then do next LOOP return composite return probabily prime
Motivation
Algorithm
Conclusion
References
Running Time Using modular exponentiation by repeated squaring, the running time of this algorithm is O(k log 3 n), where k is the number of dierent values of a we test; thus this is a reasonably ecient polynomial-time algorithm when compared the deterministic one.
Motivation
Algorithm
Conclusion
References
The algorithm enables one to probabilistically test the primality of a number n as follows: If n fails the test(i.e. results in n is composite) for any b in [1,n-1] then n is denitely composite (although, interestingly, no factor is provided by the algorithm). A composite number has at most 1 chance in 4k of passing all k of a series of k tests, where b is chosen randomly from [ 1 , n - 1 ] for each test. Therefore, if a suspected prime, n, passes k of k tests, we can conclude with a certainty of at least 1 (1/4)k that n is prime.
Motivation
Algorithm
Conclusion
References
We will now demonstrate this algorithm on a number that we denitely know is prime. Lets take n = 29.
Motivation
Algorithm
Conclusion
References
We will now demonstrate this algorithm on a number that we denitely know is prime. Lets take n = 29. So n-1 = 28, which can be written as 22 .7 So, here q = 2 and m = 7. Take b = 10.
Motivation
Algorithm
Conclusion
References
We will now demonstrate this algorithm on a number that we denitely know is prime. Lets take n = 29. So n-1 = 28, which can be written as 22 .7 So, here q = 2 and m = 7. Take b = 10. Applying the algorithm 107 17 (mod 29) which is not congruent to 1 or -1. So,we continue the test.
Motivation
Algorithm
Conclusion
References
We will now demonstrate this algorithm on a number that we denitely know is prime. Lets take n = 29. So n-1 = 28, which can be written as 22 .7 So, here q = 2 and m = 7. Take b = 10. Applying the algorithm 107 17 (mod 29) which is not congruent to 1 or -1. So,we continue the test. (107 )2 -1(mod 29) Inconclusive state
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Motivation
Algorithm
Conclusion
References
Non-Witness The base b in [1,n-1] results in inconclusive for a composite number, then b is a non-witness to the compositness of n. example For 221, we have six non-witnesses namely 1 , 21 , 47 , 174 , 200 and 220. We denote number of non-witnesses of n by nw(n). So, in our example nw(221) = 6.
Motivation
Algorithm
Conclusion
References
Rabin stated that the number witness to compostiness has a lower bound. Theorem If n > 4 is composite, then the number of bases, b, in [1, n-1] such that b is a witness to the compositeness of n is at least 3 (n-1) / 4. The following corollary describing the upper bound on non-witnesses to compositeness follows directly from theorem 1. Corollary If n > 4 is composite then at most (n-1) / 4 of the bases, b, in [1, n-1] are non-witnesses to the compositeness of n. Thus, we can get a bound on probability of passing the statement false, even when the number is actually composite as 1/4.
Motivation
Algorithm
Conclusion
References
Conclusion
conclusions and Remarks Although, there are number of primality tests, Rabin-Miller test is the most commonly used. Compared to any other test which provides the condence as much as Rabin-Miller test, it is the test which can be implemented with ease and that to in O(n3 ) Rabin-Miller test also produces pseudo primes but not absolute pseudo primes like Fermat and Euler tests for primality. So denitely better than the above test There are also deterministic variants of the test assuming the truth of unproven Generalized Riemann Hypothesis.
Motivation
Algorithm
Conclusion
References
References
[Motwani R.,Raghavan P.] Randomized Algorithms , ISBN 0-521-61390-6 [Brian C. Higgins] The Rabin-Miller Primality Test : Some results on number of non-witnesses to compositeness. [Rabin Miller Primality test] http://en.wikipedia.org/