• SatanicNotMessianic@lemmy.ml
    link
    fedilink
    arrow-up
    17
    arrow-down
    1
    ·
    10 months ago

    7 is the most random number, because when you ask someone to choose a random number between 1 and 10, most people choose 7.

    Whenever you need a random number in your code, don’t use rand() or a similar function. Use 7. It’s faster, and it’s the choice of the people.

    • enkers@sh.itjust.works
      link
      fedilink
      arrow-up
      12
      ·
      edit-2
      10 months ago

      This seems like you’re introducing selection bias. Do you really want laypersons to influence your code? You should poll a representative sample of coders for a random number, and use the mode of that.

      Here, I’ll start you off: 7

  • Spzi@lemm.ee
    link
    fedilink
    English
    arrow-up
    2
    ·
    10 months ago

    That’s a very long list of different techniques with examples, very cool!

    Though I wonder, is there some connection to image processing, high dynamic range?

    Or audio compression, the kind which brings out the kick in the mix, not the kind which saves disk space?

    The similarity I see between all three fields is, they try to bring down extreme values, outliers, to level the field, while still retaining characteristics.

      • Spzi@lemm.ee
        link
        fedilink
        English
        arrow-up
        2
        ·
        10 months ago

        I didn’t know about that [under this name], so thanks for bringing it up. But no, I meant something slightly different.

        Colors of noise describes how to generate different distributions. What I meant was how to transform distributions.

        Many of the examples in the article start with a random number distribution, and then transform it to reduce discrepancy.

        This reminded me of audio/video signal processing. For example, one can take a picture and transform it to reduce discrepancy (so that neither very bright parts nor very dark parts overshoot). Or you can take an audio sample and transform it to reduce discrepancy in loudness.

        So the idea was that maybe techniques of either field (RNG, audio, video) could be applied to both other fields.

    • Mac@programming.devOP
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      10 months ago

      Nah not mine, just one I found and thought was pretty cool. Added the source to my rss reader and probably gonna post more from them in the future