Skip to content

An implementation of Donald E. Knuth’s “‘Super-random’ number generator”.

Notifications You must be signed in to change notification settings

leonnnn/KnuthSRNG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

‘Super-random’ number generator

An implementation of Donald E. Knuth’s “‘Super-random’ number generator” given as an educational example of a bad pseudo random number generator in chapter 3.1 of his “The Art of Computer programming” series of books.

The input value 6065038420 is a fixed point of the algorithm. For other input values, the algorithm has a cycle length of around 3000, making it a pretty bad random number generator.

Knuth summarized these properties by concluding “The moral of this story is that random numbers should not be generated with a method chosen at random. Some theory should be used.”

About

An implementation of Donald E. Knuth’s “‘Super-random’ number generator”.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages