...95.121%
???
Programmer Humor
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
Just put "Precondition: x must not be prime" in the function doc and it'll be 100% accurate. Not my fault if you use it wrong.
I said something similar here about an election fraud detection system with 99.999% accuracy.
Is this not at all stochastic, or do I just not know what stochastic means?
it would be clearer to say that it is stochastically accurate
I'm confused, shouldn't this be printing false no matter what the input is?
The output is not the output of the algorithm, it's the output of the unit test.
95% of numbers up to that point at not prime. Testing the algorithm that only says "not prime" is therefore correct 95% of the time. The joke is that, similar to AI, the algorithm is being presented as a useful tool because it's correct often but not always.
that's the joke, since most numbers aren't prime, this function is technically highly accurate despite being completely useless.
The test suite probably looks something like this:
int tests_passed=0;
int tests_failed=0;
for(int i=0;i<100000;i++){
printf("test no. %d: ", i);
if(is_prime(i)==actually_is_prime(i)){
printf("passed\n");
tests_passed++;
}else{
printf("failed\n");
tests_failed++;
}
}
//...
Warning: unused variable
Just add it to the pile I guess
I've had managers who follow that exact algorithm.
It approaches 100% accuracy
You could simplify it even further by removing the int x parameter of the function...
So elegant! This is too valuable for GitHub, sell this directly to the Saudi government.
95.121% of the time it works everytime.
This but AI
"AI models have started training other AI models, by pressing The-Button-That-Trains-AI-models; this button was built 7 years ago by a bunch of online volunteers we won't ever credit."
I am screenshoting this so it will be screenshot of a screenshot of a screenshot then post it somewhere else
Not even adding some watermark? smh
ifunny
But when the input is all prime numbers then the accuracy is 0.
True

also btw icymi, this is a post about LLMs
But cryptography...