• CanadaPlus@lemmy.sdf.org
    link
    fedilink
    arrow-up
    2
    ·
    5 days ago

    That’s kind of what I meant by putting “subroutine” in quotes. You obviously wouldn’t write it like this, you’d just use a random large number with a bit of explanation.

    Oh well, live and learn. I’ll try to be clearer next time.

    • ulterno@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 days ago

      I just took the above comment as continuing the joke, but this explanation actually confuses me more.
      Well, I don’t really think you need to be very clear in this case. Jokes are more fun when you “get” them rather than have them explained.

      • CanadaPlus@lemmy.sdf.org
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        3 days ago

        I get OP was a joke, but I was trying to make a serious observation.

        Say you have some kind of stochastic algorithm that works on the assumption it’s fed a composite number most of the time. Maybe something like Pollard’s Rho algorithm, where whatever number theoretic structure you need accumulates slowly over time as a result. You decide to just pick a large number at random for each iteration.

        Implicitly, you’ve solved the problem of finding a composite number by assuming all (large) numbers are composite, like in this post. It is pretty close, like also mentioned in this post. If that’s not good enough, you could also use a primality test that fails some small portion of the time, which do exist, and use less power than guaranteed tests.

        • ulterno@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 days ago

          I see. So the reason I didn’t get it was because you were not really joking. Also, I seem to not have much background information of the domain you are talking in, so can’t continue thee conversation in my current condition.