## 2.8 The `random` module

The `random` module contains function for generating random samples from probability distributions:

random.binomial()
The random.binomial() function returns a random sample from a binomial distribution with independent trials and a success probability . must be a real positive dimensionless integer. must be a dimensionless number in the range .

random.chisq()
The random.chisq() function returns a random sample from a -squared distribution with degrees of freedom, where must be a real positive dimensionless integer.

random.gaussian()
The random.gaussian() function returns a random sample from a Gaussian (normal) distribution of standard deviation and centred upon zero. must be real, but may have any physical units. The returned random sample shares the physical units of .

random.lognormal()
The random.lognormal() function returns a random sample from the log normal distribution centred on , and of width . must be a real positive dimensionless number. must be real, but may have any physical units. The returned random sample shares the physical units of .

random.poisson()
The random.poisson() function returns a random integer from a Poisson distribution with mean , where must be a real positive dimensionless number.

random.random()
The random.random() function returns a random real number between 0 and 1.

random.tdist()
The random.tdist() function returns a random sample from a -distribution with degrees of freedom, where must be a real positive dimensionless integer.