Where do game results come from? Casino Random Number Generator

Players often speculate that games are rigged. This is understandable, because it is difficult to maintain neutrality after prolonged losses. But if you know how everything works, perhaps such thoughts will come less often.

The heart of every online casino game is the RNG (Random Number Generator), or rather PRNG (Pseudo Random Number Generator). PRNG is based on certain formulas that should produce random values. These random values ​​are then tied to the symbols of slot machines, so players see beautiful pictures on the screens, not numbers.

It is this PRNG that ensures fair play for players and casino operators. It is important to note that the casinos are the same users as the players. The developers do not allow them to access the settings and only give them the opportunity to place the game on their website and accept bets. And all processes take place on the servers of the developer himself.

Can a PRNG be hacked?

Yes, it is theoretically possible. But it will be incredibly difficult to do this, since the methods for generating numbers are far from primitive. It is in the interest of every developer to prevent discovery of sequences or determination of the algorithms used. Below is a detailed description of how the PRNG works. This will give you an idea of ​​the likelihood of such a scenario.

There is at least one confirmed piece of evidence that it was the definition of how the algorithm worked that gave players the edge. Alex from Russia bought a Mark VI gaming machine from Aristocrat and determined how it generates random numbers.

Then, in real casinos, he could determine at what exact moment the system would generate numbers tied to large payouts. This is a relatively recent case that was made public in 2011. We talked about it in more detail in this article.

Pseudo-random number generator

By default, online casinos always mention RNG, that is, a random number generator. However, for the most part, this is not a completely correct definition of what is used in an online casino. It would be more accurate to say PRNG, which means a pseudo-random number generator. What is the difference? Now let's figure it out.

There are many different ways to generate pseudo-random numbers. All of them basically use some kind of mathematical formula to get the result. In this case, a certain base number is taken.

In order to have a clearer idea of ​​​​what is at stake, we will analyze an early method for generating pseudo-random numbers. This is the simplest and most understandable method, invented by John von Neumann in the 40s. A base four-digit number is taken and squared. Then, four digits in the middle are taken from the resulting number. Then on and on.

For example, 7839 squared is 61449921. This would be the result of one round of the game. Then we take four numbers from the middle of 61449921 and square it again, we get 20241001 - this is the result of another round of the game. And so it goes on, after 20241001 we get 5764801. If there are seven digits, then the second to fifth digits are taken for the next number.

As you can see, if you know the base number and the mathematical formula, you can determine what results will be generated. To make it harder for crackers, the base number changes from time to time. For example, the series of numbers derived from a base number is terminated and a new base number is generated instead, say 1649. Then the hackers will have to determine the base number again.

John von Neumann's method is not used because it is too simple and does not allow generating a large number of random numbers. The so-called looping occurs too quickly, when the calculations can no longer continue. For example, the number 23000000 came out. Four zeros squared will give the same zeros, then more zeros and ad infinitum. If this looping happened on a winning combination, the casino would surely go bankrupt.

Now much more advanced mathematical formulas are used. For example, below is only part of the description of the Mersen Twist method from Wikipedia. This is far from squaring.

Real RNG

This technology produces truly random numbers. There are no patterns here, so it is impossible to predict the results. This is not just a program, but a separate device that connects to the casino game to ensure the randomness of the results.

For this, the PRNG is used together with an external source of entropy. The source of entropy is something unpredictable. For example, the RNG can use the noise of the sound card to determine the base value, or the processor clock count, temperature, etc.

The problem is that a real RNG is much more expensive than a PRNG, it also requires more time and resources to install and configure. And the results are generated too slowly. Therefore, in most cases, the casino random number generator does not actually produce completely random results. Therefore, theoretically, hacking a casino is possible. But it will be very difficult. An ordinary mortal can not even dream of this. It's probably easier to hit the jackpot.

PRNG also has its drawbacks. The problem with the end of the period, as in the case of the squaring method, is characteristic of other methods. Moreover, each subsequent number depends on the previous one, until the base number is changed.

What algorithms do developers use?

According to two iTechLabs reports from 2012 and 2015, the NetEnt developer uses the Fortuna algorithm, which is based on a constant change in the original number. He receives these initial numbers from numerous sources of entropy. These sources can be computer mouse movement, cooler noise, etc. They give unpredictable numbers that no one has to determine.

Igrosoft says that they use the standard Mersenne Twister (MT19937) RNG. According to Wikipedia, it is perhaps the most common among modern PRNGs. There are quite a few options. Therefore, it is not necessary that everyone uses the same method.

Popular Slots