Wednesday, July 18, 2018

Random Reference Diagrams

Random number generators sample a source of noise ("random" or "high entropy" information) and convert it to numerical information.  A block diagram of the system looks like this:

A random source (noise) is sampled by a transducer, converted into numbers, then emitted (or stored) as a data stream for present or later use.

The model has been around for a very, very long time.  A Real World™ example is a board game.  The noise source (dice) is sampled (are rolled), transduced (seen by eye), counted (computed), and the output number used to move the pieces around the board[1].

This model is basically what the National Institute of Standards and Technologies employs:
NIST Beacon Architecture, 2013[2]
For a hobby project, beehives and quantum entanglement sources are a bit out of reach.  They both require care and feeding.  Bees go to sleep at night.  Seems likely neither is a simple choice.

Noise generating electronic circuits are a choice.  The classic example is a white or pink noise generator.
Simple White Noise Generator[3]
Pre-made noise generators cost anywhere from $2 up to hundreds or thousands of dollars depending on specification[4, 5].

These circuits are simple and reference designs only require soldering and Amazon skills.  Tuning and using these tools may require a little effort.  But ... they're boring black boxes.

What can be built using parts already on hand?


Saturday, July 14, 2018

It's Hard to be Random


Recent pieces in the technical news[1, 2, 3] underscore an unusual fact:

Randomness is hard to make.

Randomness, simulated or real, is incredibly useful.  Among applications:
  • games — card shuffling, roulette wheels, dice, maze generation
  • exams — selecting questions for quizzes, answer key ordering
  • medicine — clinical trial subject randomization, demographic statistical studies
  • simulations — stock market analysis, weather modeling, classical and quantum physics
  • security — cryptography, attack simulation, communications, fuzzing, blockchains
  • computation — stochastic computing, signal processing (speech, EEG, ECG ...), AI
  • engineering — materials testing, black-box software tests
and dozens and dozens of other uses in mathematics, statistics, biology, neurology, and other fields.

Billions of random numbers may be needed for large applications and in any activities needing long-running, one-time "unique" sequences.  Computers are really good at making and processing lots and lots of numbers. How about random numbers?

Getting long sequences of truly random numbers is hard.  Algorithmically-generated sequences, i.e., pseudo-random numbers[4, 5], have been around for decades.  They are good enough for lightweight applications like putting monsters in a game maze.  Really good sequences (non-repeating, unpredictable, lengthy) are hard to come by because many techniques "wrap around" and start sending out the same series or have hidden patterns in their sequences.

When in doubt, punt the problem to someone who's solved it already.  Everything's already in The Cloud!

The U.S. National Institute of Standards and Technology has a publicly-available random-number site, the NIST Randomness Beacon.  The site produces numbers for the scientific community. NIST warns their numbers are not to be used for cryptography, and NIST uses large, red letters to say so:


Suspicions are that NIST ships its sequences to agencies such as the U.S. National Security Administration ahead of release[6].

Okay, but what if we want our own truly random numbers for ... whatever purpose?  How hard can it be to make some[7]?  And how can we make them without buying expensive computers, equipment, and hardware?  Not a lot of people have NIST's budget.

Sounds like a fun hobby project.

Next