3 ms·
George Marsaglia suggested a very simple multiply with carry PRNG you can use in your head to generate better quality random numbers. [1] 1. Select an initial
by camel-cdr 5y ago
George Marsaglia suggested a very simple multiply with carry PRNG you can use in your head to generate better quality random numbers. [1]
1. Select an initial random number between 1 and 58. (This is accomplished by mentally collecting entropy from the environment, e.g., counting a group of objects of unknown quantity)
2. Multiply the least significant digit by 6, add the most significant digit, and use the result as the next state.
3. The second digit of the state is your generated pseudorandom number.
4. Goto 2.
Sequence generated by 42:
42|16|37|45|34|27|44|28|50|05|03|18|49|58|53|23|20|02|12|13|19|55|35|33|21
2| 6| 7| 5| 4| 7| 4| 8| 0| 5| 3| 8| 9| 8| 3| 3| 0| 2| 2| 3| 9| 5| 5| 3| 1
I really like the idea of using this when playing for example rock paper scissors (I'd take the last digit mod 3 and reject any 0's, so the distribution isn't as biased).
[1] https://groups.google.com/g/sci.math/c/6BIYd0cafQo/m/Ucipn_5T_TMJ https://groups.google.com/g/sci.math/c/6BIYd0cafQo/m/Ucipn_5...