Skip to content

Lehmer's Trap: Why Random Number Generators Aren't Actually Random

C. Pearson C. Pearson
/ / 1 min read

Every Monte Carlo simulation you have ever run was built on a lie. Not a malicious one. A very useful, carefully engineered lie: the pseudorandom number generator.

A captivating pattern of blue transparent dice casting shadows on a white surface. Photo by DS stories on Pexels.

Here is the problem nobody puts in the tutorial. When you call random() in Python, R, or any other language, you are not getting randomness. You are getting the output of a deterministic mathematical function. Feed it the same seed, get the same sequence. Every time. That is the opposite of random.

For most purposes, this works fine. The sequences are long enough and uniform enough that the statistical machinery runs without complaint. But

Get Mean Methods in your inbox

New posts delivered directly. No spam.

No spam. Unsubscribe anytime.

Related Reading