76 points

And if you want to increase accuracy you just add more tests

permalink
report
reply
13 points

The failures are probably just flake then

permalink
report
parent
reply
10 points

“prime on my machine”

permalink
report
parent
reply
73 points

I wrote an ai that classifies spam emails with 99.9% accuracy.

Our test set contained 1000 emails, 999 aren’t spam.

The algorithm:

permalink
report
reply
2 points

Honestly I’d rather have that, than randomly have to miss some important E-mail because the system put it in the junk folder.

permalink
report
parent
reply
64 points

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.

permalink
report
reply
10 points
permalink
report
parent
reply
6 points

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.

permalink
report
parent
reply
23 points

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

permalink
report
reply
50 points
*

It is always returning false, but the screen shows a test, where a non-prime evaluating as false is a pass and a prime evaluating as false is a fail :))

permalink
report
parent
reply
27 points

The output shown is the result of a test for the function, not the result of the function itself.

permalink
report
parent
reply
12 points

Ooooh I see lol. Thank you!

permalink
report
parent
reply
14 points

It’s returning false for all the tests, but it only should be returning false for 95% of them, as 5% are prime.

permalink
report
parent
reply
15 points
*

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.

permalink
report
reply
14 points

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).

permalink
report
parent
reply
4 points

So you better use 128-bit unsigned integers 😅

permalink
report
parent
reply
7 points

Wolfram alpha says it’s about 4.9%. So 4.9% of numbers in the range 1 to 2^31 are prime. It’s more than I expected.

permalink
report
parent
reply

Science Memes

!science_memes@mander.xyz

Create post

Welcome to c/science_memes @ Mander.xyz!

A place for majestic STEMLORD peacocking, as well as memes about the realities of working in a lab.



Rules

  1. Don’t throw mud. Behave like an intellectual and remember the human.
  2. Keep it rooted (on topic).
  3. No spam.
  4. Infographics welcome, get schooled.

This is a science community. We use the Dawkins definition of meme.



Research Committee

Other Mander Communities

Science and Research

Biology and Life Sciences

Physical Sciences

Humanities and Social Sciences

Practical and Applied Sciences

Memes

Miscellaneous

Community stats

  • 13K

    Monthly active users

  • 3.4K

    Posts

  • 83K

    Comments