George Marsaglia was a big name in random number generation. I’ve referred to his work multiple times here, most recently in this article from March on randomly generating points on a sphere. He is best remembered for his DIEHARD battery of tests for RNG quality. See, for example, this post.
I recently learned about a mental RNG that Marsaglia developed. It’s not great, but it’s pretty good for something that’s easy to mentally compute. The output is probably better than if you simply tried to make up random numbers; people are notoriously bad at doing that. Hillel Wayne explores Marsaglia’s method in detail here.
Here’s a summary the generator in Python.
state = 42 # Set the seed to any two digit number def random_digit(): tens = lambda n: n // 10 ones = lambda n: n % 10 global state state = tens(state) + 6*ones(state) return ones(state)
Related posts
The post A mental random number generator first appeared on John D. Cook.