Tespia
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Arthur Besse@lemmy.ml to Programmer Humor@lemmy.mlEnglish ·
edit-2
8 months ago

Incredible stochastic algorithm, gets more reliable the larger your input, incredibly fast, trivial to implement and deterministic on its inputs

lemmy.ml

message-square
33
link
fedilink
388

Incredible stochastic algorithm, gets more reliable the larger your input, incredibly fast, trivial to implement and deterministic on its inputs

lemmy.ml

Arthur Besse@lemmy.ml to Programmer Humor@lemmy.mlEnglish ·
edit-2
8 months ago
message-square
33
link
fedilink

cross-posted from: https://lemmy.blahaj.zone/post/38950495

https://cosocial.ca/@mhoye/116111505546606451

alert-triangle
You must log in or register to comment.
  • TomMasz@lemmy.world
    link
    fedilink
    English
    arrow-up
    41
    arrow-down
    1
    ·
    8 months ago

    95.121% of the time it works everytime.

    • idriss@lemmy.ml
      link
      fedilink
      arrow-up
      11
      ·
      edit-2
      5 days ago

      deleted by creator

      • MonkeMischief@lemmy.today
        link
        fedilink
        arrow-up
        10
        ·
        8 months ago

        Fast forward 30min of training and the final outcome is a model that outputs “do nothing” in 100% of the cases.

        To be fair, your program demonstrated the most reliable way to win at crypto! 😉

      • Ranulph@thelemmy.club
        link
        fedilink
        English
        arrow-up
        3
        ·
        8 months ago

        Diamond Hands in action. Buy and hold is not as profitable as simply never buying and just holding.

  • idriss@lemmy.ml
    link
    fedilink
    arrow-up
    34
    arrow-down
    1
    ·
    edit-2
    5 days ago

    deleted by creator

    • SharkAttak@kbin.melroy.org
      link
      fedilink
      arrow-up
      10
      arrow-down
      1
      ·
      8 months ago

      Not even adding some watermark? smh

    • athatet@lemmy.zip
      link
      fedilink
      arrow-up
      3
      ·
      8 months ago

      ifunny

  • sepiroth154@feddit.nl
    link
    fedilink
    arrow-up
    26
    ·
    edit-2
    8 months ago

    You could simplify it even further by removing the int x parameter of the function…

    • obelisk_complex@piefed.ca
      link
      fedilink
      English
      arrow-up
      15
      arrow-down
      1
      ·
      edit-2
      2 months ago

      deleted by creator

    • needanke@feddit.org
      link
      fedilink
      arrow-up
      3
      ·
      8 months ago

      Even better, do the work at compile time to respect the customers resources:

      const bool isPrime = false
      
      • sepiroth154@feddit.nl
        link
        fedilink
        arrow-up
        3
        ·
        8 months ago

        My gosh, you always feel so stupid when someone points out something so obvious! Thanks

  • HiddenLayer555@lemmy.ml
    link
    fedilink
    English
    arrow-up
    20
    ·
    8 months ago

    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.

  • Thekingoflorda@lemmy.world
    link
    fedilink
    arrow-up
    16
    ·
    8 months ago

    It approaches 100% accuracy

  • 418_im_a_teapot@sh.itjust.works
    link
    fedilink
    arrow-up
    16
    ·
    8 months ago

    We could probably improve on that significantly without losing speed.

    return $x < 8
    

    That should yield one additional correct answer, while also confusing anyone who thinks it just returns false.

    And if we just hard coded and checked the first 20 or so primes before always returning false, we would probably get noticeable improvement (depending on the total range).

    • Blass Rose@pawb.social
      link
      fedilink
      arrow-up
      2
      ·
      8 months ago

      I’ve seen so many game jam entries where the code is like this. Delicately balanced and using so many assumptions to just get the thing out the door.

      It’s funny when they decide to make a full game out of it and realize that it’s gonna take them 6 months just to undo the tech debt of the original “demo”

  • MeetMeAtTheMovies [they/them]@hexbear.net
    link
    fedilink
    English
    arrow-up
    11
    ·
    8 months ago

    Warning: unused variable

    Just add it to the pile I guess

  • /home/pineapplelover@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    11
    arrow-down
    1
    ·
    8 months ago

    I’m confused, shouldn’t this be printing false no matter what the input is?

    • Carl [he/him]@hexbear.net
      link
      fedilink
      English
      arrow-up
      19
      ·
      edit-2
      8 months ago

      that’s the joke, since most numbers aren’t prime, this function is technically highly accurate despite being completely useless.

    • Couldbealeotard@lemmy.world
      link
      fedilink
      English
      arrow-up
      7
      ·
      8 months ago

      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.

    • anton@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      6
      ·
      8 months ago

      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++;
          }
      }
      //...
      
      • /home/pineapplelover@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        3
        ·
        8 months ago

        Ah that makes more sense thanks. So the bottom one is a unit test and not the code being run itself

    • fallaciousBasis@lemmy.world
      link
      fedilink
      arrow-up
      3
      arrow-down
      3
      ·
      8 months ago

      Removed by mod

      • Ænima@lemmy.zip
        link
        fedilink
        arrow-up
        2
        ·
        8 months ago

        Removed by mod

  • rbos@lemmy.ca
    link
    fedilink
    English
    arrow-up
    9
    ·
    8 months ago

    I’ve had managers who follow that exact algorithm.

  • sunbytes@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    8 months ago

    This is how AI accuracy is also measured.

  • pruwyben@discuss.tchncs.de
    link
    fedilink
    arrow-up
    7
    ·
    8 months ago

    Is this not at all stochastic, or do I just not know what stochastic means?

    • Arthur Besse@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      7
      ·
      edit-2
      8 months ago

      maybe it would be better to say that it is stochastically accurate?

  • Evotech@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    8 months ago

    This but AI

    But they are like 60-80%

    • Jankatarch@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      8 months ago

      “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.”

  • Armand1@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    8 months ago

    I said something similar about an election fraud detection system with 99.999% accuracy.

    https://lemmy.world/comment/22178379

  • Jankatarch@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    8 months ago

    …95.121%
    ???

    • iByteABit@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      8 months ago

      It’s a decimal point, not thousands

  • razen@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    8 months ago

    But when the input is all prime numbers then the accuracy is 0.

    • Arthur Besse@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      9
      ·
      8 months ago

      The Simpsons character Rainier Wolfcastle on stage with a microphone, on TV, with the caption "THAT'S THE JOKE"

      also btw icymi, this is a post about LLMs

    • fallaciousBasis@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      8 months ago

      True

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml

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.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 438 users / day
  • 951 users / week
  • 2.04K users / month
  • 3.99K users / 6 months
  • 1 local subscriber
  • 43.9K subscribers
  • 916 Posts
  • 5.41K Comments
  • Modlog
  • mods:
  • cat_programmer@lemmy.ml
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org