• Boomer Humor Doomergod@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    arrow-down
    2
    ·
    edit-2
    19 hours ago

    If you scaled it based on the size of the integer you could get that up to 99.9% test accuracy. Like if it’s less than 10 give it 50% odds of returning false, if it’s under 50 give it 10% odds, otherwise return false.

    • Kairos@lemmy.today
      link
      fedilink
      arrow-up
      3
      ·
      10 hours ago

      That would make it less accurate. It’s much more likely to return true on not a prime than a prime

      • themusicman@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 hours ago

        Correct. Not are why people are upvoting. If 10% of numbers are prime in a range, and you always guess false, you get 90% right. If you randomly guess true 10% of the time, you get ~80% right.

    • JackbyDev@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      1
      ·
      10 hours ago

      Makes me wonder where the actual break even would be. Like how long dies making one random number take versus sins lookups. Fuck it, do it in parallel. Fastest wins.