Random number generator Module in Python

Random number generator Module in Python

True Random Number Generators (TRNG) A true random number generator generates a random number that is almost impossible to predict as the factors that impact changes of the resulted values are the features of physical environments. For example, throwing up a dice generates random values that are hardly predictable. But dice have limits of number from one to six. Thus, generating random numbers which is a part of mechanical nature is almost difficult to predict.

Pseudo-Random Number Generators (PRNG) PRNG is not a truly random number generator as an algorithm generates a sequence of random numbers. The resulted random values are generated from an initial value which is known as a seed value.

In Python, random values are generated by using the random module and the generator itself is a Pseudo-Random Number Generators (PRNG). The module uses the Mersenne Twister algorithm as its core generator which is reliable and passed many tests for statistical randomness. Also, NumPyoffers to work with random numbers which can also generate a sequence of numbers such as different dimensional arrays. The secret module in python generates cryptographically strong random numbers. Python’s uuid (universal unique identifier ) module creates a 128 bit sequenced random value.

Image Source