In these notes we introduce working with random numbers in Python or numpy.

Computers are supposed to be deterministic. That is, given the same inputs, it produces the same outputs. Random numbers are supposed to be unpredictable. So with computers we speak of pseudorandom numbers. They are produced by an algorithm that starts with an initial value called the seed and then produces a sequence of numbers that behave as if they were random. That is, the sequence generated should pass a wide variety of statistical tests for randomness. Of course, if you start from the same seed, you will get the same sequence.

The most common random number generator gives you random numbers unformly distributed on the interval [0,1). That is, you are equally likely to get any number in that interval, but never a negative number nor a number equal to 1 or higher.