Re:Show HN: Learn When to Quit
by bentona on Saturday December 07, 2019 @04:27PM
(#21732669)
Semi-relevant: https://en.wikipedia.org/wiki/Benford%27s_law
[ Parent
| on HN ]
Also relevant (and in my mind, the underlying explanation for Benford's Law):
Just getting into bayesian inference and this sent me down a rabbit hole, thanks :)
Damn...
People, I just ran this simple script on my terminal using Node and I got a pretty uniform result.
a = {}
for(let i = 0; i < 100000; i++){
let n = Math.floor(Math.random() * 10);
if( n in a )
a[n] += 1
else
a[n] = 1
}
My result:{ '0': 9917, '1': 10015, '2': 9957, '3': 10107, '4': 10019, '5': 10037, '6': 10120, '7': 9914, '8': 10042, '9': 9872 }
> real-life sets of numerical data
Today you learned: Node’s random number generator isn’t selecting from a real-life set of numerical data
yeah, I just mixed two informations. I thought the other person said my algorithm would be biased towards small numbers cause I use the JS random function to pick the number of decimal places for the number
Yep, sorry, didn't mean to say this directly applied, just a neat concept that's somewhat related.