Stay informed with the
NEW Casino City Times newsletter!
Recent Articles
Best of John Robison

# Ask the Slot Expert: A mathematician explains the RNG

11 July 2012

John, I am a mathematician AND computer software expert.

Here is the simple answer.

It is true that computers use pRNG technology to generate random numbers.

It is also true that the number stream generated has the appearance of randomness.

Why the appearance and not true randomness?

To be truly random, then any number can follow any number.

A computer formula requires a starting point. What we call a "seed." Then from this "seed" the next number is generated, and then the next.... If you were to use the same "seed" every time the program was booted (restarted), you WILL get the same number stream again.

That is, for a particular number, for example 123,456,789, with the same starting "seed," the next number is NOT truly random. It will always be the same number generated.

OK, so that tells everyone that the program, the pRNG is NOT truly random.

However, when the universe of numbers is VERY large and very fast and if the pRNG is programmed correctly, the number stream generated is virtually unpredictable and therefore has the appearance of true randomness.

There is much more mathematics and programming to speak about, such as generation of "seeds" and if the "seed" is also variable (e.g., time of day), and prime number theory and other rather boring issues.

To add more conversation, a poorly written pRNG can have "holes" in the universe of numbers generated. That is, there can be numbers that are never generated. Let us hope our casino commissions have suitable testing equipment to not allow faulty pRNGs on the slot floor.

Love your column and glad to add to this debate.

Thanks for the kind words about my column and thanks for adding to the pRNG conversation.

The pRNG function takes an input called the seed. Because the pRNG function can contain only mathematical functions and there's no variability in those functions, the pRNG function will always return the same result for a given seed value. The seed is usually the last number generated, so the pRNG function returns a predictable sequence of numbers. If one knew the pRNG formula and knew where the pRNG was in the sequence, one could predict the numbers returned by the pRNG function.

This scenario may seem far-fetched, but slot cheats known as RNG cheats have been able to cheat slots using knowledge of the RNG function. To make it more difficult for RNG cheats, modern slots have these countermeasures: the RNG process in the slot runs continuously; the machine does not sit with a result (e.g., the result of the next spin; the five replacement cards that might be needed for a video poker hand) locked in, i.e., the machine determines results when they're needed and not a moment before; the machine will periodically choose a new seed value. The new seed value may be based on something unpredictable, like where a player last touched the screen.

Here's an early example of how improperly seeding an RNG function can cause problems. Many, many years ago, a Canadian casino used a PC to run its Keno drawings. The seed for the RNG was based on the current date and time. This was back in the old days when you had to put in a separate card for the PC to continue keeping time when it was turned off. This card did not work properly in the PC, so the PC started with the same date and time every time it was rebooted. The RNG function started with the same seed each day and the same numbers were drawn in each drawing for many days in a row until a regular visitor realized the same numbers were being drawn, won a bit of money and caused the casino to investigate.

Jackpots for all,
John

John Robison

John Robison is an expert on slot machines and how to play them. John is a slot and video poker columnist and has written for many of gaming’s leading publications. He holds a master's degree in computer science from the prestigious Stevens Institute of Technology.

You may hear John give his slot and video poker tips live on The Good Times Show, hosted by Rudi Schiffer and Mike Schiffer, which is broadcast from Memphis on KXIQ 1180AM Friday afternoon from from 2PM to 5PM Central Time. John is on the show from 4:30 to 5. You can listen to archives of the show on the web anytime.

#### Books by John Robison:

The Slot Expert's Guide to Playing Slots
John Robison
John Robison is an expert on slot machines and how to play them. John is a slot and video poker columnist and has written for many of gaming’s leading publications. He holds a master's degree in computer science from the prestigious Stevens Institute of Technology.

You may hear John give his slot and video poker tips live on The Good Times Show, hosted by Rudi Schiffer and Mike Schiffer, which is broadcast from Memphis on KXIQ 1180AM Friday afternoon from from 2PM to 5PM Central Time. John is on the show from 4:30 to 5. You can listen to archives of the show on the web anytime.

#### Books by John Robison:

The Slot Expert's Guide to Playing Slots