6 ms·
Mental math pseudo-random number generators (2011)
- zellyn 9y agoI 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 9y agoMuch 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 ...
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- fapjacks 9y agoI have some experience with this. It helps if you yourself have some marksmanship training, because you will choose to zig, zag, or continue along your current path based on a time scale defined by the amount of time it takes to line up a sight picture on a moving target. You'll want to throw off this fairly universal, homogeneous process and zig when the guy's got you in his sight, but before he presses the trigger, and certainly at the very latest before the round traverses the distance between the two of you. This can be extremely frustrating.
- DannyB2 9y agoA 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.
- lisper 9y agoNote 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 9y agoThe method takes the result modulo 10, so numbers can repeat (but not more than than ~ p/10 times).
- HappyTypist 9y agoOC is referring to consecutive numbers I believe.
- deleted 9y ago[deleted]
- bumbledraven 9y agoMarsaglia'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/Ucipn_5T_TMJ https://groups.google.com/forum/#!msg/sci.math/6BIYd0cafQo/U...