
Mental math pseudo-random number generators (2011) - gwern
http://blog.yunwilliamyu.net/2011/08/14/mindhack-mental-math-pseudo-random-number-generators/
======
bumbledraven
Marsaglia's own explanation of his mental PRNG on sci.math is still the best
explanation I've seen for someone who just wants to use it:

Marsaglia, George. "How to generate random number sequences (in your head)"
(1999)
[https://groups.google.com/forum/#!msg/sci.math/6BIYd0cafQo/U...](https://groups.google.com/forum/#!msg/sci.math/6BIYd0cafQo/Ucipn_5T_TMJ)

------
DannyB2
A simple PRNG I used on programmable calculators back in the 1970's. Four
steps:

1\. Recall seed from register (a number between 0.0 and 1.0)

2\. Take reciprocal

3\. Chop off the part to left of decimal point (eg, "frac" key)

4\. Store back in register as next seed

At this point you have a number between 0.0 and 1.0 in the calculator. (eg, in
the X register if RPN)

Every step counted, that was the simplest PRNG I could devise back in the day.

The initial seed in the register was created by hitting the decimal point key
and a string of digits filling the calculator display.

------
zellyn
I love this. Then again I'm the kind of person who sits wondering, if you were
running from an elevated sniper, trying to get to the treeline, would it be
effective to change direction after 3 steps, 1 step, 4 steps, 1 step, 5 steps,
9 steps, 2 steps, ... :-)

~~~
credit_guy
Much safer to use the period 999. And for extra difficulty, to intentionally
make a "mistake" and switch to the other 999 period. Fingers crossed that the
sniper is not some HN lurker ...

------
lisper
Note that a PRNG built according to the method in this article will never
generate the same number twice, whereas a TRNG will do so with probability
>0\. In some applications (e.g. on-line poker) this can matter a lot.

~~~
kaoD
The method takes the result modulo 10, so numbers can repeat (but not more
than than ~ p/10 times).

~~~
HappyTypist
OC is referring to consecutive numbers I believe.

