I was curious how I would roll, say, a 20-sided die given nothing but my mind or a pencil or paper. Humans are notorious for being very skewed at guessing random numbers, and I couldn’t find many good algorithms after a rudimentary Google search, so I decided to come up with one.
I turned to the most natural thing – language – and not requiring the user to know anything but the letters of the alphabet and a couple of words. Most mental-math random number generation algorithms require memorizing a specific set of numbers or steps – who has time for that?
Looking at the environment and “counting the number of X” doesn’t work either, as that biases us towards objects that occur more than once, and doesn’t provide an even distribution.
The algorithm and results are detailed here. Here’s the algorithm if you’re too lazy to read it:
Start with a seed (1). The seed serves to “balance” our output distribution, whereas the rest of the algorithm allows for a relatively random output order.
Start with a mod space (must be odd). If you want an even mod space, start with an odd one and take the first n-1 values.
Think of any normal English word or sentence. Lowercase letters only.
Add up all the letters in sentence (indexed by their order in the alphabet).
Increment the seed and add it to this sum.
Mod the sum by the space you want the random number to be in.
I feel a bit iffy about the idea of a seed and incrementing it, that’s obviously the source of this “even” distribution we’re getting as the results describe. After all, if you start with a number and increment it N times, mod m, you’ll have an even N/m items in every bin!
But with very predictable output. Thus, the rest of the algorithm serves to randomize the order of the output – i.e. where the simple incrementation algorithm would output [0…m-1] repeatedly, this would output something more random. And it does – I’m just not sure how to test how random this output is.
Anyways – what are your thoughts? Reasonably random for an algorithm that can be done mentally or on a small scrap of paper?
What are some twists I could introduce to increase the randomness? Perhaps the seed could serve to permute the input in some fashion? If most of the structure comes from the order of the words and the order of the letters, I could define a seed that messes with each?