Select Page

I’m always amazed at how little interest people take in probability and random numbers. Is that RAND function in Excel really random? Is it possible to synchronize two random number generators and predict numbers? What is a weak random number generator and why would you want one? There’s an entire branch of mathematics devoted to random numbers. All of today’s encryption methods rely on random number generators and they’ve provided a source of intrigue unmatched by most movie plots. How can you not be interested?

I first became aware of how fascinating probability was when I realized knowing the odds could help me in poker. Yes, almost every game has an element of probability but poker was the first game that motivated me with the chance of winning or losing money. Having motivation is a sure fire method to acquiring a new skill. This fascination motivated me to write one of my early posts on Udacity’s statistics course.

At the time technology and budget limited me to a programmable calculator that wasn’t quite up to generating a full deck of cards but simulating red and black on a roulette wheel was trivial. My lack of understanding allowed me to conceive a method that would make me a millionaire in just a few years.

The concept was simple. Using the roulette wheel, I would bet on black anytime red came up six times in a row. If the red came up a seventh time, I would simply double my bet and so on. Fortunately, I tested my method first on my calculator.

i allowed my simulation to run for days. I modified parameters. I ran side tests to verify how random my calculator’s random number generator was. No matter what I did, my method still lost (see below for more detail). It was only years later that I realized why I was still working for a living. I didn’t grasp a basic fact of statistics. If your random number generator is truly random, history doesn’t affect probability. Another zero is just as likely as any other number.

Suppose I showed you the string of twenty zeros and told you that they had come from a new random number generator I had created. How would you feel about my algorithm? Me too but really my string of twenty zeros is just as likely as any other sequence of twenty numbers. They both have the same probability.

I’ll skip the math but when you start calculating probability you see there is no factor for past history. History only matters in an imperfect random number generator. And then it’s more likely to favor certain numbers. You know, slight variations in the weight of ping pong balls causing the state’s lottery to favor certain numbers. Then again, how would you be able to prove it? Like my string of zeros, the tipster selling you data on all the lottery drawings for the last ten years may only be taking advantage of your incomplete understanding of probability.

This provides a very interesting quandary. How can you prove your random number generator is truly random? Truthfully, I don’t believe you can. In the early days of computing, games would ask you for a seed number for their random number generator (pseudo random number generator). If the programmer were lazy and did not use a second factor (such as how long it took to type in the seed), you could play the same game over and over by always using the same seed number.

This difficulty in generating random numbers came to light several years ago when it was discovered that certain video poker machines repeated over a long period of time. Once the sequence was captured in a computer, enterprising players were phoning home with the sequence of their machine. The computer at home only had to match the sequence to tell the player what was coming next. I don’t know what eventually happened but you can guess this exploit was not popular with casino owners.

It’s not just the casino owners that suffer from poor random number generators. I’m not going to get into the details but most of today’s encryption is based on random number generators. Once you know that the random number generator has a bias for certain numbers, cracking secure messages becomes almost as easy as guessing “password” for your password.

Well, maybe not that easy but if you want to see real intrigue, check out Dual Elliptic Curve, a random number generator promoted by our US government. I’ll get you started with this Reuters article. I’m surprised they haven’t made a movie on this yet.

And you thought random numbers were boring.

#### * Details on why my method lost:

If you think about it, there’s no way my method should have lost money. I had simplified my model to eliminate the green house numbers and my payouts were always 100% of my bet. But while I did not fully understand probability, I did understand having to double my bet every time I lost would quickly exceed house limits. Because of that, I programmed in an escape clause. After X many losing bets (one of the parameters I modified), my bet would become a fixed amount. Once my bet could no longer cover my losses, I was fated to lose money.