Primes in P

IcemanJer

Diamond Member
Mar 9, 2001
4,307
0
0
Sorry deviate from technical hardware topic to something more, ah I guess, theoretical.

As posted on Slashdot, a professor and his two students in India Institute of Technology have discovered a primality testing algorithm that has a deterministic polynomial running time. The paper can be downloaded here.

Thoughts? Discuss.
 

rgwalt

Diamond Member
Apr 22, 2000
7,393
0
0
Originally posted by: IcemanJer
Sorry deviate from technical hardware topic to something more, ah I guess, theoretical.

As posted on Slashdot, a professor and his two students in India Institute of Technology have discovered a primality testing algorithm that has a deterministic polynomial running time. The paper can be downloaded here.

Thoughts? Discuss.

I read over the paper, but number theory is not my strong suit. It has been awhile since I've done anything with prime numbers and modulo() terms. That being said, I wonder what speed up we'll see with this method...

Ryan
 

bassx88

Junior Member
Jul 30, 2002
7
0
0
I read over the paper, but number theory is not my strong suit. It has been awhile since I've done anything with prime numbers and modulo() terms. That being said, I wonder what speed up we'll see with this method...

Ryan

I think we'll be seeing the exact opposite... the breakthrough in this paper is not a faster algorithm, but the fact that it comes up with an answer every time. From what I read elsewhere, previous algorithms would come up empty on some numbers.
 
May 15, 2002
245
0
0
This result is really of theoretical, rather than practical, interest. It answers a long-open question on the computational "difficulty" of primality testing.

A polynomial-time factoring algorithm, on the other hand, would be of immense practical interest!
 

unclebabar

Senior member
Jun 16, 2002
360
0
0
Am I missing something? Given a list of prime numbers (generated from the mentioned theorem), would it not be possible to reduce any given number into it's prime factors in linear time?
 

glugglug

Diamond Member
Jun 9, 2002
5,340
1
81
I must be missing it also.

It's trivial to factor any number x in time proportional to sqrt(x), worst case, which is better than linear.
A very similar algorithm will test primeness in sqrt(x) time.

Finding ALL primes <= x takes approximately linear time. (There is a linear part and a part proportional to sqrt(x) * log(x) on the fastest algorithm I know of - and thats actually better than linear if you really think about it...)
 

glugglug

Diamond Member
Jun 9, 2002
5,340
1
81
Note: the program just posted works up to 281474976710655.

After that you get rounding error from converting the input double to __int64.

(iostream won't handle 64 bit integer input directly, so unless I want to make my own input routines...)
 

IcemanJer

Diamond Member
Mar 9, 2001
4,307
0
0
RSA is based on the fact that you're taking the prime factor of a number that has something like 300 digits. So essentially every check for prime number is going to take O((the 300 digit number)^12), which, sure is better than before because the algorithm wouldn't yield a 100% correct answer, is still slow.
 

nave

Junior Member
Aug 9, 2002
2
0
0
Originally posted by: glugglug
I must be missing it also.

It's trivial to factor any number x in time proportional to sqrt(x), worst case, which is better than linear.
A very similar algorithm will test primeness in sqrt(x) time.

Finding ALL primes <= x takes approximately linear time. (There is a linear part and a part proportional to sqrt(x) * log(x) on the fastest algorithm I know of - and thats actually better than linear if you really think about it...)

An algorithm's runtime is usually described as a function of the size of its input. In numerical algorithms such as these (that deal with some number x), I believe the "size" of the input is lg(x) - i.e. the number of bits needed to represent the number - rather than x itself. The algorithm described in the paper runs in O(lg(x)^12), hence it runs in time polynomial in the number of bits needed to represent x - that's the major achievement.
 

Carceri

Member
Aug 7, 2001
119
0
0
And just to clarify:

The paper describes an algorithm for determining if a number is prime or not without factoring the number, and it does so in polynomial time. Previously we only had algorithm that would output either: Not a prime (and you could be sure that the number wasn't a prime) or it would say prime (but the number still might be a composite). What is done in practice is simply to run the algorithm X number of times. If the chance of a composite number passing as a prime is 1/2 the chance of a composite number passing as a prime after X runs of the algorithm is (1/2)^X. Furthermore the algorithm is pretty fast. The new algorithm described is very slow compared to the probabilistic algorithm, but you can rely on the result 100% after only one run of the algorithm. That's the achievement.

This is useless for factoring. Here you already know that the number is not a prime. And don't even think about writing a list of all primes up to, say, 300 digits and then use that list to help factor a number. You can find some formulas for approximating the number of primes smaller than a certain number here: http://www.utm.edu/research/primes/howmany.shtml

I have implemented a factoring algorithm that can handle any number (if you have the time and memory but currently 60-70 digit numbers are the limit for most computers) It's running time is (as all currently known factoring algorithms) exponential in the number of digits of the number to factor (To be more precise it's O(e^((1+O(1))*Sqrt(ln n * ln ln n)))). You can download the program as well as read about the method here

 

IcemanJer

Diamond Member
Mar 9, 2001
4,307
0
0
Originally posted by: Carceri
If the chance of a composite number passing as a prime is 1/2 the chance of a composite number passing as a prime after X runs of the algorithm is (1/2)^X.
Wait, you're talking about the running time of the algorithm being O((1/2)^X), right?
 

Carceri

Member
Aug 7, 2001
119
0
0
Wait, you're talking about the running time of the algorithm being O((1/2)^X), right?
No, I haven't stated what the running time of the probabilistic algorithm for primality testing is, but if it fails with probability 1/2 on a composite number, running the algorithm X times the probability that it will still accept a composite number as a prime is (1/2)^X. As you can see X needs only be rather small (say about 100 or so) before you can be very certain that the number is in fact a prime.

I don't have the running time for the Miller Rabin primality test in my head right now, but if it was O(xx) running the algorithm 100 times would be O(100 * xx) which is still O(xx)
 

unclebabar

Senior member
Jun 16, 2002
360
0
0
> And don't even think about writing a list of all primes up to, say, 300 digits and then use that list to help factor a number.

Holy $#%, there's a lot of prime numbers. I was thinking that as the number of digits got bigger, the rarer the possibility of getting another prime. Obviously, there are still plenty at 10^300. Alas, my plans for world domination will have to wait. :|
 

kylebisme

Diamond Member
Mar 25, 2000
9,396
0
0
Originally posted by: IcemanJer
RSA is based on the fact that you're taking the prime factor of a number that has something like 300 digits. So essentially every check for prime number is going to take O((the 300 digit number)^12), which, sure is better than before because the algorithm wouldn't yield a 100% correct answer, is still slow.

is still cool too
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |