Skip to content

Prime probability *decreases* when slprp_test and eslprp_test are enabled #20

@Pr0methean

Description

@Pr0methean

Currently, buffer.rs lines 92-102 decrease the probability that a number is prime once it passes the slprp or eslprp test. I suspect you intended to decrease the probability that the number wasn't prime. Assuming the probability of accepting a pseudoprime, conditioned on having passed the Miller-Rabin tests, was meant to be 4/15, this would be done with

probability = 1. - ((1. - probability) * 11f32 / 15f32);

I'm also concerned that the probability estimate may be incompatible with Bayes' Theorem, because it doesn't take into account that by the Prime Number Theorem, the prior probability of a number's primality decreases as the number grows larger. I may be slightly biased in the same direction as the Yudkowsky crowd, but it seems to me that applying Bayesian statistics is obligatory when formally-proven priors are available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions