Linear Random Congruential Generator Sequence of Random Numbers Parmaters m modulus limit m 0 a multiplier 0 a m c increment 0 c m x0 seed 0 x0 m Generates squence of psudo random numbers x n x n 1 n n 2 Choice of a c and m is important m should be large prime number like 2 31 1 if c 0 few good values Not very good for security but provides a good distribution for patterns visual graphics DOCTYPE html html lang en head meta charset UTF 8 meta name viewport content width device width initial scale 1 0 title Linear Random Congruential Generator title script src https cdn plot ly plotly latest min js script head body div id histogram div script Logistic map function function randomGenerator a c m x0 iterations const result let x x0 for let i 0 i iterations i x a x c m result push x m return result Parameters const m 0xffffffff 1 const a 888 const c 1 const x0 0 28273 const iterations 9000 Generate logistic map sequence const sequence randomGenerator a c m x0 iterations Create histogram data const trace x sequence type histogram Layout const layout title Histogram for a a c c m m and x0 x0 xaxis title Values yaxis title Frequency Plot histogram Plotly newPlot histogram trace layout script body html
rations const result let x x0 for let i 0 i iterations i x a x c m result push x m return result Parameters const m 0xffffffff 1 const a 888 const c 1 const x0 0 28273 const iterations 9000 Generate logistic map sequence const sequence randomGenerator a c m x0 iterations Create histogram data const trace x sequence type histogram Layout const layout title Histogram for a a c c m m and x0 x0 xaxis title Values yaxis title Frequency Plot histogram Plotly newPlot histogram trace layout script body html