And if you want to increase accuracy you just add more tests
I wrote an ai that classifies spam emails with 99.9% accuracy.
Our test set contained 1000 emails, 999 aren’t spam.
The algorithm:
All odd numbers are prime: 1 is prime, 3 is prime, 5 is prime, 7 is prime, 9 is experimental error, 11 is prime, and so on, I don’t have funding to check all of them, but it suggests an avenue of productive further work.
1 is prime
Look, just because it breaks everything, that’s no reason not to include it in a joke. We’ll just have to rebuild the entire edifice of mathematics.
Seriously, thanks for the link, I hadn’t considered the implications of including 1 in the set of primes, and it really does seem to break a lot of ideas.
It’s been a fat minute since I last did any programming outside of batch scripts and AHK… I’m struggling to understand how it’s not returning false for 100% of the tests
The output shown is the result of a test for the function, not the result of the function itself.
How many primes are there before 1 and 2^31. IIRC prime numbers get more and more rare as the number increases. I wouldn’t be surprised if this would pass 99% of tests if tested with all positive 32 bit integers.
Per the prime number theorem, for large enough N the proportion of primes less than or equal to N is approximately 1/log(N). For N = 2^(31) that’s ~0.0465. To get under 1% you’d need N ~ 2^(145).