Genuary 24: Create your own pseudo-random number generator

By: Jeff Clark    Date: Mon, 24 Jan 2022

The prompt for Genuary 24 is 'Create your own pseudo-random number generator and visually check the results'. I tried a system like:

	a = Math.sqrt(Math.abs(seed*Math.E))*11
	seed = (a - Math.floor(a))
		
Checking sequential generated numbers there are no obvious patterns. Checking the histogram of 10,000 values yields a pretty uniform result. Unfortunately taking pairs of numbers generated sequentially and plotting them shows obvious patterns - a sure sign of a poor quality result. I did try using a larger constant multiple - say 1234 instead of the 11 used above and saw no obvious 2D patterns in that case.


The standard javascript Math.random did very well in comparison on these simple tests.

 


Genuary 23: Abstract vegetation
Blog
Genuary 25: Perspective