Chapter 3: pseudo-random number generation