Skip to content
/ MTP Public

The Mersenne Twister pseudo-random number generator implemented in Python

Notifications You must be signed in to change notification settings

james727/MTP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

MTP - The Mersenne Twister Pseudo-random number generator

MTP is an implementation of the 32-bit Mersenne Twister pseudo-random number generator in Python. This is the same RNG that Python's 'random' module uses, as well as many other programming languages including R, Matlab, Ruby, Julia, and Common Lisp.

Most of my understanding of this algorithm came thanks to the following sites:

Usage

To initialize the RNG:

generator = mersenne_rng(seed = 123)

If you don't pass it a seed, it will default to 5489

To generate a random number:

random_number = generator.get_random_number()

About

The Mersenne Twister pseudo-random number generator implemented in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages