Random numbers offer a variety of applications such as Monte Carlo simulation, cryptography, initializing passwords, and stochastic processes. It is not easy to generate real random numbers, so in reality, most applications use pseudo-random numbers. Pseudo numbers are adequate for most purposes except for some rare cases. Random numbers can be generated from discrete and continuous data. The numpy.random() function will generate a random number matrix for the given input size of the matrix.
The core random number generator is based on the Mersenne Twister algorithm (refer to https://en.wikipedia.org/wiki/Mersenne_twister).
Let's see one example of generating random numbers, as follows:
# Import numpy
import numpy as np
# Create an array with random values
random_mat=np.random.random((3,3))
print("Random Matrix: \n",random_mat)
This results in the following output:
Random Matrix: [[0.90613234 0.83146869 0.90874706]
[0.59459996 0.46961249...