Rabin-Miller probabilistic prime test

Category: Python - Education

In this script is included a method for performing the Rabin-Miller probabilistic test for a composite witness. Rabin-Miller test can only tell us if a value is definitely composite. In the case where a test value is not a witness for the compositeness of a potential prime, it can only lie with a probability of at most 1/4. With this script, you can attempt to catch a liar over some number of trials, and the probability of us not catching at least one liar after k trials (if the number is not actually prime) is at most 4**-k. Included is an algorithm for generating a number of b bits for which no composite witness was found after k trials. Removing mathematical rigor will suggest that the probability of the value being prime after k trials is at least 1-1/4**k. Date: 25 March, 2012


Prime Test - Rabin-Miller Test - Rabin-Miller Algorithm - Probabilistic - Prime - Test

Homepage: http://code.activestate.com/

Developer: code.activestate.com

License: Freeware

Operating System: All

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

Shared hosting at affordable rates.

developer Developer: James Maskell
license License: Public Domain
operating systems Operating System: Not Available


PHP Shell is basically a shell wrapped in a PHP script.

developer Developer: gimpster.com
license License: Freeware
operating systems Operating System: Platform independent


This script will find and display all the prime numbers up to a user-determined number.

developer Developer: javascriptsource.com
license License: Freeware
operating systems Operating System: All


Prime number generator code is allmost the fastest prime number generator.

developer Developer: planet-source-code.com
license License: Freeware
operating systems Operating System: All


Another attempt to solve the mystery behind prime numbers.

developer Developer: files.rubyforge.vm.bytemark.co.uk
license License: Freeware
operating systems Operating System: All


This script includes the function primepow(aNumber) that finds the prime number P and power N of aNumber such that aNumber = P^N.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Prime Number Tester allows you to test if an inputed number is prime.

developer Developer: planet-source-code.com
license License: Freeware
operating systems Operating System: All


Some file processing tasks are quite time consuming, especially when COM is involved.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


ExceptionContainer script is an Exception base-class that supports keyword arguments and printing.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All