DEV Community

Discussion on: Pseudorandom numbers using Rule 30

Collapse
 
rodiongork profile image
Rodion Gorkovenko

Arpit, Hi - and thanks for article!

I think I've seen something like this at wolfram or something alike, but haven't put enough attention. Thanks for clarifying it!

However

The pseudorandom numbers generated using Rule 30 are not cryptographically secure but are suitable for simulation

I don't at once understand numeric properties of generated values. For example, is amount of zeroes and ones equal on average?

Also I don't well understand, whether it is enough for us to keep the row of limited width to calculate next bit - or we need enlarge rows with every generation due to this triangular pattern (as it seems side cells affect future center cells).

Collapse
 
arpit_bhayani profile image
Arpit Bhayani

The pseudorandom number generated using this method does not pass the Chi-Square test for randomness; which means even though things seem aperiodic to us, for large number of iterations things are not that random; and hence should not be used in high-end security.

To answer your second question:
The number of rows and columns is kept fixed and this number count depends on the cells you want to analyze at once. For example: if we only want to generate random numbers then keeping track of just 2 rows is enough.

Since the size of the Grid is constant and the row "wraps around" at its ends; the center of the grid does not move.