4 ms·
Looks like a way to purposefully create a biased (center-weighted) random number generator out of multiple calls.
by everfree 5y ago
Looks like a way to purposefully create a biased (center-weighted) random number generator out of multiple calls.
- Waterluvian 5y agoMathematically is the sum of six Math.random() any different than (Math.random() * 6)?
- russellsprouts 5y agoYeah, it will biased towards the center of the range rather than uniformly distributed
- jjoonathan 5y agoYep, the sum of six Math.random() will start to look a bit like a normal distribution, while Math.random()*6 will stay flat. Even crazier: the sum of six (Math.random()>.5)?0:1 will also look a bit like a normal distribution, rather than just 0 50% of the time and 6 50% of the time. Central Limit Theorem eats distributions of all shapes and sizes and shits gaussians. That's why you see normal distributions everywhere.
- Waterluvian 5y agoOhh okay. I see it now. This is like how two D6 dice roll differently than a D12?
- deleted 5y ago[deleted]
- ignoranceprior 5y agohttps://en.wikipedia.org/wiki/Irwin–Hall_distribution https://en.wikipedia.org/wiki/Irwin–Hall_distribution