Stories
Slash Boxes
Comments

SoylentNews is people

posted by Fnord666 on Tuesday March 14 2017, @03:04PM   Printer-friendly
from the 42-of-course dept.

Arthur T Knackerbracket has found the following story:

"As an instrument for selecting at random, I have found nothing superior to dice," wrote statistician Francis Galton in an 1890 issue of Nature. "When they are shaken and tossed in a basket, they hurtle so variously against one another and against the ribs of the basket-work that they tumble wildly about, and their positions at the outset afford no perceptible clue to what they will be even after a single good shake and toss."

How can we generate a uniform sequence of random numbers? The randomness so beautifully and abundantly generated by nature has not always been easy to extract and quantify. The oldest known dice (4-sided) were discovered in a 24th century B.C. tomb in the Middle East. More recently, around 1100 B.C. in China, turtle shells were heated with a poker until they cracked at random, and a fortune teller would interpret the cracks. Centuries after that, I Ching hexagrams for fortunetelling were generated with 49 yarrow stalks laid out on a table and divided several times, with results similar to performing coin tosses.

But by the mid-1940s, the modern world demanded a lot more random numbers than dice or yarrow stalks could offer. RAND Corporation created a machine that would generate numbers using a random pulse generator. They ran it for a while and gathered the results into a book titled A Million Random Digits with 100,000 Normal Deviates. What now might seem like an absurd art project was, back then, a breakthrough. For the first time, a nice long sequence of high-quality random numbers was made available to the public. The book was reprinted by RAND in 2001 and is available on Amazon.

A similar machine, ERNIE, built in Bletchley Park in the 1940s for WWII, was reused after the war to generate random numbers for the UK Premium Bond lottery. To quell fears about the fairness and accuracy of ERNIE, the Post Office made a great documentary called The Importance of Being E.R.N.I.E. It's worth a look:

In 1953, randomness was finally formalized into a real computer, the Ferranti Mark 1, which shipped with a built-in random number instruction that could generate 20 random bits at a time using electrical noise. The feature was designed by Alan Turing. Christopher Strachey put it to good use by coding up a randomized love note generator. Here's an sample love note, from David Link's 2009 resurrection of the program:

But Turing's random number instruction was maddening for programmers at the time because it created too much uncertainty in an environment that was already so unpredictable. We expect consistency from our software, but programs that used the instruction could never be run in any consistently repeatable way, which made them nearly impossible to test.

What if a random number generator could be expressed as a deterministic function? What if it could be called repeatedly to deliver a sequence of random numbers, but under the same initial conditions it would always produce the same sequence? Enter the pseudorandom number generator (PRNG).

-- submitted from IRC


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 4, Interesting) by jdavidb on Tuesday March 14 2017, @04:42PM (6 children)

    by jdavidb (5690) on Tuesday March 14 2017, @04:42PM (#478986) Homepage Journal

    This was really cool and I'm glad it was shared here. The comments so far are great to read, too. And pulling up the book of numbers on Amazon leads to the chance to read some very interesting and funny reviews!

    I actually once printed five pages of random digits off of random.org and saved them for a year using them for various projects that interested me where I might need some random numbers, so I identify with the people who needed this book back in the day.

    Random numbers have always interested me. The first program I remember understanding was a BASIC program printed in National Geographic World kids' magazine that gave you three chances to guess a random number from 1 to 10. For years after that the very first thing I did when checking out a new programming language was to find out how to get random numbers in it.

    --
    ⓋⒶ☮✝🕊 Secession is the right of all sentient beings
    Starting Score:    1  point
    Moderation   +2  
       Interesting=2, Total=2
    Extra 'Interesting' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   4  
  • (Score: 3, Interesting) by darnkitten on Tuesday March 14 2017, @06:13PM (5 children)

    by darnkitten (1912) on Tuesday March 14 2017, @06:13PM (#479029)

    I remember learning the distinction between pseudorandom and random numbers back in my first stone age programming class. I never really understood the need for the former, as my concern was more with programming character generators and combat tables.

    Man...I was so proud of myself when I figured out 4d6, drop the low and arrange, with class modifiers...

    • (Score: 2) by jdavidb on Tuesday March 14 2017, @06:51PM (4 children)

      by jdavidb (5690) on Tuesday March 14 2017, @06:51PM (#479061) Homepage Journal

      I remember learning the distinction between pseudorandom and random numbers back in my first stone age programming class. I never really understood the need for the former, as my concern was more with programming character generators and combat tables.

      I don't remember when I learned the distinction, but it wasn't in a class. I do remember that because I am so obsessive it prompted a bit of a mental crisis for me while I obsessed about getting true randomness and whether or not true randomness truly exists in the universe.

      --
      ⓋⒶ☮✝🕊 Secession is the right of all sentient beings
      • (Score: 2) by darnkitten on Tuesday March 14 2017, @08:40PM (3 children)

        by darnkitten (1912) on Tuesday March 14 2017, @08:40PM (#479121)

        Looking back on it, I am forced to wonder how that poor TRS-80 determined "true random" numbers, given the difficulty of generating truly random numbers and the limitations of the hardware and software of the time..

        (Just looked it up--apparently the function returned a "more-or-less random" value based on the state of the refresh register).

        • (Score: 3, Informative) by jdavidb on Wednesday March 15 2017, @12:39AM

          by jdavidb (5690) on Wednesday March 15 2017, @12:39AM (#479220) Homepage Journal

          I had the same experience wondering about how the NES generated random numbers and how its generator was seeded without a clock to use as a seed. It finally dawned on me that some kind of timing since startup was going on, and in fact framecounting seems to have been a common solution. There's an NES game I tended to obsess over that I still pull out once or twice a year and play in emulation, and there's one particular value in it that is crucial to the game that varies from 1 to 5, with 5 being the rarest, and I've finally become convinced that essentially there's some kind of sinusoidal variation computed from the frame count and in fact you can time and predict the value with a decent level of predictability.

          Good grief I just exposed the depraved depths of my nerdish obsessive insanity when it comes to random numbers.

          --
          ⓋⒶ☮✝🕊 Secession is the right of all sentient beings
        • (Score: 3, Informative) by VLM on Wednesday March 15 2017, @02:24PM (1 child)

          by VLM (445) on Wednesday March 15 2017, @02:24PM (#479414)

          Its still a "thing" a couple weeks ago I was trying to use a ESP8266 (basically a microcontroller that is a wifi, or a wifi that is a microcontroller, kinda) to send MQTT data and I had the bright idea of using the random number function in micropython (which runs on a ESP8266 and is pretty much what it sounds like) to generate random looking data to send, and every time I run it my "random" data is the exact same pattern and I'm fighting my old nemesis from 80s home computer BASIC again. If I hadn't known about PRNGs I'd probably have tried to troubleshoot why the buffer keeps re-importing the same data no matter how many times I reset the blasted thing.

          Many TRS80s had RTC also. Its not fun world for a modern microcontroller. No battery backed up RTC so I can't seed the PRNG with the timestamp. Static memory so no refresh register to sniff. DHCP gives it the same address every time. They are almost purely predictable functional devices hit reset and the same thing happens every time. I could implement NTP to use the returned time as a seed but the whole point of using random data was keeping it ultra simple so I can debug the MQTT side not the data acquisition side. Ironically other than being offensively predictable the completely non-random RNG was good enough to set the output side MQTT stuff working.

          So yeah even in 2017 there are still contemporary systems where rand() outputs the same pattern every time you reset the system.

          • (Score: 2) by jdavidb on Friday March 17 2017, @01:28AM

            by jdavidb (5690) on Friday March 17 2017, @01:28AM (#480135) Homepage Journal

            Many TRS80s had RTC also. Its not fun world for a modern microcontroller. No battery backed up RTC so I can't seed the PRNG with the timestamp

            I remember discovering on my Apple IIGs (which did have a battery backed clock) that if I booted from a floppy with the OS on it, my BASIC random numbers were not predictable, but if I just booted to a BASIC prompt on bare hardware, the random numbers were the same every time. That was long before I understood about random number seeds, and it mystified me. Now I'm still a little bit mystified that the OS knew to seed the BASIC random number generator but the firmware did not. It was the same BASIC, I think - built into firmware.

            --
            ⓋⒶ☮✝🕊 Secession is the right of all sentient beings