mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2010-07-22, 14:11   #177
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

597910 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
Passes SPRP test (No base specified)
"No base specified" = base 2, in this case, since the script has
Code:
isSPRP(n,b=2)
making the value of b 2 unless it's explicitly made something else.

Quote:
Originally Posted by 3.14159 View Post
Those all fail the TD test.
You changed the code on my if you're trial-dividing to a million; it was only doing it to 500 before.

But I'm surprised you can't see the relevance of the sequence -- it should be easy to use it to find all exceptions up to 100 billion.
CRGreathouse is offline   Reply With Quote
Old 2010-07-22, 14:13   #178
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

597910 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
Wait.. To weed out pseudoprimes
I should change b to (random(n)).
That doesn't weed out pseudoprimes, it just tests to a random base. Of course if you do that the pseudoprimes you get will be unpredictable -- you can't just check a list of 2-pseudoprimes, for example.
CRGreathouse is offline   Reply With Quote
Old 2010-07-22, 14:17   #179
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

Quote:
That doesn't weed out pseudoprimes, it just tests to a random base. Of course if you do that the pseudoprimes you get will be unpredictable -- you can't just check a list of 2-pseudoprimes, for example.
What are the chances that the number might be pseudoprime to a random base, especially when dealing with the larger integers? And, pseudoprimes share the property of becoming less common in larger integers with the (genuine) primes.

Last fiddled with by 3.14159 on 2010-07-22 at 14:18
3.14159 is offline   Reply With Quote
Old 2010-07-22, 14:24   #180
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
What are the chances that the number might be pseudoprime to a random base, especially when dealing with the larger integers?
For the Fermat test near n, at most 1-2/\sqrt n: some numbers are pseudoprime to almost all bases.

For the Miller-Rabin test near n, at most 1/4. 88831 is a strong pseudoprime to 22049 out of the 88829 valid choices of base.
CRGreathouse is offline   Reply With Quote
Old 2010-07-22, 14:27   #181
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

69016 Posts
Default

Quote:
For the Fermat test near n, at most : some numbers are pseudoprime to almost all bases.
Carmichael numbers.

Quote:
For the Miller-Rabin test near n, at most 1/4. 88831 is a strong pseudoprime to 22049 out of the 88829 valid choices of base.
Those are worst-case odds. How about average odds?

Last fiddled with by 3.14159 on 2010-07-22 at 14:28
3.14159 is offline   Reply With Quote
Old 2010-07-22, 14:59   #182
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
Those are worst-case odds. How about average odds?
Suppose you pick odd k-bit numbers uniformly at random and do a strong pseudoprime test, discarding it and restarting the procedure if it's proven composite. Let p_k represent the probability that the procedure stops on a composite rather than a prime.

According to Damgård, Landrock, & Pomerance (1993), p_100 is at most 0.68%, p_150 is at most 0.034%, p_200 is at most 0.0017%, and p_250 is at most 0.000084%.

I can't get useful estimates below 100 bits, though; Theorem 2 gives only that p_75 < 55%.
CRGreathouse is offline   Reply With Quote
Old 2010-07-22, 15:07   #183
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

Quote:
I can't get useful estimates below 100 bits, though; Theorem 2 gives only that p_75 < 55%.
55%

Last fiddled with by 3.14159 on 2010-07-22 at 15:07
3.14159 is offline   Reply With Quote
Old 2010-07-22, 15:23   #184
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

I imagine you're thinking that it's obviously at most 25%. Damgård, Landrock, & Pomerance address this misconception on p. 178.
CRGreathouse is offline   Reply With Quote
Old 2010-07-22, 15:48   #185
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

Quote:
I imagine you're thinking that it's obviously at most 25%. Damgård, Landrock, & Pomerance address this misconception on p. 178.
Well, then, if the at max probability of failure is not 1/4n for n randomly chosen bases, what is it?

1/2n? 1/1.5n? 1/1.25n? (The last one is initially ridiculous, its first term = 80% chance of failure.)

Last fiddled with by 3.14159 on 2010-07-22 at 15:53
3.14159 is offline   Reply With Quote
Old 2010-07-22, 17:20   #186
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
Well, then, if the at max probability of failure is not 1/4n for n randomly chosen bases, what is it?
For the problem I stated, it's quite complicated. An upper bound (based on DLP Theorem 2) would be
k^{2n}\cdot4^{2n-n\sqrt k}.
CRGreathouse is offline   Reply With Quote
Old 2010-07-22, 18:30   #187
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22·5·373 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Suppose you pick odd k-bit numbers uniformly at random and do a strong pseudoprime test, discarding it and restarting the procedure if it's proven composite. Let p_k represent the probability that the procedure stops on a composite rather than a prime.

According to Damgård, Landrock, & Pomerance (1993), p_100 is at most 0.68%, p_150 is at most 0.034%, p_200 is at most 0.0017%, and p_250 is at most 0.000084%.

I can't get useful estimates below 100 bits, though; Theorem 2 gives only that p_75 < 55%.
http://dilbert.com/strips/comic/2001-10-25/
R.D. Silverman is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wheel Factorization a1call Factoring 11 2017-06-19 14:04
Efficient Test paulunderwood Computer Science & Computational Number Theory 5 2017-06-09 14:02
LL tests more credit-efficient than P-1? ixfd64 Software 3 2011-02-20 16:24
A Wheel storm5510 Puzzles 7 2010-06-25 10:29
Most efficient way to LL hj47 Software 11 2009-01-29 00:45

All times are UTC. The time now is 14:52.


Fri Aug 6 14:52:06 UTC 2021 up 14 days, 9:21, 1 user, load averages: 2.93, 2.91, 2.85

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.