How does the RNG (Random Number Generator) work?

What is the chance in the world of computers? There are many unfounded myths and stories about the operation of the RNG - a generator of random numbers in slot machines. But how does it actually work? That’s exactly what this article explains.

As we have already mentioned in several previous articles, there is a random number generator at the core of each slot machine. For obvious reasons, all slot machines today are computer-controlled, both in case of physical and online slots. And one of the things this computer does is generate random numbers.

It is, however, important to realize that computers are not random in any aspect of their operation. They always follow a fixed set of instructions that is predictable. Assuming the computer receives the same input conditions, it will always generate the same sequence of random numbers.

Geiger counter

Just think. There are very few things in the real world that are actually random. Take, for example, a Geiger counter – a probe that produces a pulse whenever it is hit by radioactive decay. It is scientifically proven that the time between individual decays slightly accelerates in the morning and slows down in the evening. Things like these give rise to phenomena that are not random and may be misused when you know the baseline conditions. That is the case even for a random number generator.

RNGs are oriented as unpredictable “from the left” – that is, based on previous results, it is not possible to estimate the following number. Predicting “from the right” – predicting previous results based on later results is, however, theoretically possible. These systems address the issue by constantly generating random numbers. That occurs both when the machine is in operation (when reels are spinning and you’re betting) and when it isn’t. Nobody knows which number was generated at what time. However, this sequence of numbers has a clearly defined period after which the process restarts and the numbers start repeating. Assuming the random number generator produces a thousand times per second (the usual amount in actual slot machines), then one sequence lasts for 50 days and then starts generating numbers from the beginning.

There are three basic types of random number generators

These very simple random number generators, programmable in almost any language, are only used for small computer simulations like e.g. “loading line” etc.

Somewhat better 32-bit and 64-bit generators are used in slots and video games.

Real random number generators used in electronic circuits to verify assumptions about laws of nature. These generators are mostly used in research (from psychological calculations through military use all the way to speculations on financial markets).

As we have already mentioned in our previous article on the principle of operation of slot machines, (online) slots usually have about 20 “stops” on each reel. Let’s take a slot machine that has 22 such stop positions or 22 physical positions. In practice, 2 to the 32 (or 2 to the 64, respectively) of numbers are generated, which are then assigned by the computer to individual stop positions which are then, also thanks to the computer, increased to 64, 128, or 256 stop positions.

Now consider a slot machine with a total of 128 virtual stop positions.

In practice, the computer generates a random number during the game that is then assigned to the given stop position, where the reel subsequently stops. Therefore, do not believe the myths spread by the players claiming that you can “push the reels with your eyes”, so to speak. Once you throw in the coin and spin the reels, three (or five, respectively) pseudo-random numbers are selected from the set of generated numbers. These numbers are somewhere in the range between the 1 and 4.3 billion. When this range is divided into 128 virtual stops, we get about 34 million random results per stop per reel. It’s almost impossible to “guess” the number, even if you knew it’s upcoming. Especially considering that the numbers are generated at a rate of 1000 or more per second.