functional programming

Generating Pseudo-Random Numbers in Scheme

Recently, I needed to write a simple simulation in multiple programming languages. For the simulations to operate, they needed a source of random numbers from two statistical distributions: a uniform distribution and a standard distribution. The numbers from the distributions needed to be “random”, but not too random. I needed each generator in each language to produce the same sequence of “pseudo-random” numbers. And I needed the same sequence every time the simulators were run.

Functional Programming: A Paradox?

I like the idea of Functional Programming. It just appeals to my own mathematical bent I think. A few of the central tenets include immutability of data and creating functions that always produce the same results given the same arguments by avoiding side effects. All this to minimize generation of unpredictable results (errors). But wait a minute. There is another field of study with a long and deep history of research, random number generation, that says it is virtually impossible to generate truly random (unpredictable) results on a computer.