开发者

Probability of n-bit integers [duplicate]

开发者 https://www.devze.com 2023-02-16 07:12 出处:网络
This question already has answers here: Closed 11 years ago. Poss开发者_StackOverflow社区ible Duplicate:
This question already has answers here: Closed 11 years ago.

Poss开发者_StackOverflow社区ible Duplicate:

random a 512-bit integer N that is not a multiple of 2, 3, or 5

I have a question

for a random 512-bit integer n that isn't a multiple of 2,3, or 5 what is the chance that n is prime? what about that n is composite but fools the fermat primality test? what about that it is composite but doesn't fool the fermat primality test?


Since this is definitely a homework problem, I'll point you at the Prime Number Theorem, which should give you the probability that any large number is prime.

From there, modify the probability with your new information about composite numbers that have been eliminated (Hint: Think about how the problem space shrinks).

Best of luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消