Uncomplicated random calculation using sin fract visualize the distribution quality script src https cdn plot ly plotly latest min js script div id thediv div script function fract b return b Math floor b function rand b return fract Math sin b 1000 0 var x for var i 0 i 10000 i x i rand i var trace x x type histogram var data trace var layout title Distribution Graph Plotly newPlot thediv data layout script Bit of Chaos The linear congruential method uses the formula x a x b mod c where a and b are well chosen prime numbers and c defines the range ref https en wikipedia org wiki Linear_congruential_generator script src https cdn plot ly plotly latest min js script div id thediv div script var cx 0 var ca 4373 var cb 7879 var cc 10000 function chaos cx ca cx cb cc return Math abs cx cc 0 to 1 console log Test outputs console log chaos console log chaos console log chaos console log chaos var x for var i 0 i 1000 i x push chaos var trace x x type histogram var data trace var layout title Distribution Graph Plotly newPlot thediv data layout console log ready script
e ref https en wikipedia org wiki Linear_congruential_generator script src https cdn plot ly plotly latest min js script div id thediv div script var cx 0 var ca 4373 var cb 7879 var cc 10000 function chaos cx ca cx cb cc return Math abs cx cc 0 to 1 console log Test outputs console log chaos console log chaos console log chaos console log chaos var x for var i 0 i 1000 i x push chaos var trace x x type histogram var data trace var layout title Distribution Graph Plotly newPlot thediv data layout console log ready script