Industry News
The RNG scaling problem
By Lorenzo Nardini, Head of Technical Compliance and Maths Services, at ComplianceOne Group
When I was a child, I lived in Italy and I used to play some card games with my friends. There is a huge variety of Italian traditional card games: Briscola, Scopa, TreSette are only a few of them. All these games are played with an Italian deck of cards, which consists of 40 cards divided into four suits, each containing ten cards ranked from one to ten. (If you are not familiar with these cards, I suggest searching them online as their artwork is beautiful and it varies across the different regions of that country). Most of the games I played required an equal distribution of cards among the players. This was easily done when playing in two or four as each player would get respectively twenty or ten cards each. However, when we played in a group of three, a problem naturally arose: how could we equally split the deck since 40 is not a multiple of 3? Fortunately, this was not a difficult problem and for most games it was perfectly acceptable to simply remove (reject) one card from the deck and then to assign the remaining ones in 3 groups of 13.
Later in life, I discovered that this seemingly childish problem was a recurring issue for gaming companies seeking certification for their Random Number Generators. In the gaming industry, the generation of random numbers is a core element that enables gaming platforms to produce unpredictable events. In this regard, RNGs are the engine that games use to decide, for instance, the final position of the symbols in a slot machine, the cards that will be dealt in a Poker or Blackjack hand, or when the plane will crash in the recently popular Crash games.
Each Random Number Generator is unique in terms of its components and the applications for which it is designed to generate random events. You can have a software RNG that is based on famous (in this community) algorithms such as the Mersenne Twister, you can have cryptographically strong solutions that take entropy from random events. I even once read a short paper about a “banana” RNG based on the natural decay of potassium atoms inside that fruit.
Regardless of the basis of your RNG solution, it will most likely generate unscaled random numbers. The most typical format is probably the 32bit which means the RNG returns a number between 0 and 232-1 (that is 4,294,967,295). This range is typically too large to be directly employed to generate game events: most card games require numbers between 1 and 52 as that is the standard deck size, numbers for slot machine outcomes typically range in the hundreds or thousands, and if you simply need to decide where the ball will land in a virtual single zero roulette, you simply need to request a number between 0 and 36.
How to then use the 32bit number to create outcomes for all these games? Assigning a number from the “large” range to one in the “small” range is called “scaling”. There are several methods to perform this operation and, in order to comply with jurisdictional standards, most countries require that the scaling method is performed in such a way to not introduce any bias, that means that all mapped numbers (also known as final outcomes) have the same probability to occur.
This is, in fact, the same problem that I was facing as a child when trying to equally split the deck of cards. And in the same way, this is easily solved when the large number (232 in our case) is a multiple of the target range, though this is seldom the case. This is exactly where I have seen multiple suppliers of RNG solutions failing their testing: ignoring that the target range not always divides the unscaled one results in having final outcomes that are not equally likely. Effectively, this means that when playing a roulette game, it is more likely that the ball lands on 0 rather than on 36.
However, the same solution I used as a child when playing cards in a group of three can be applied here: simply discard/reject some values until we are left with a multiple of our target range. For instance, if you need your RNG to generate numbers for a slot game in the target range 100 because such is your reel length, you first get an unscaled number in the 32bit format (that, remind, is 0 – 4,294,967,295) and then you discard it in the unlikely event that this is at least 4,294,967,200. All remaining numbers are then equally mapped to the target range by taking the remainder of their division by 100 – which simply means you take its last two digits.
To many, this might seem like a trivial problem. Yet, I was surprised by how frequently I encountered this exact issue when testing RNG solutions. The issue had to be reported to the supplier, failing their testing, that meant that they eventually had to rewrite some portion of their code, make a new submission and, all in all, spending extra budget and time for something that can be easily avoided.
While the RNG scaling problem may seem simple, it’s just the tip of the iceberg. There are far more complex issues in the world of RNGs that require expert guidance. Understanding these problems is the first step towards improvement. If you’re looking for someone who can not only assist you in navigating these challenges but also help you understand them in a clear and accessible way, I’m here to help. Let’s work together to enhance your RNG solution and make your gaming platform stand out.
-
Africa5 days ago
Altenar obtains National Manufacturer licence in South Africa
-
Industry News2 days ago
Pennsylvania Skill, powered by Pace-O-Matic, congratulates PA Gaming Control Board and casinos on a banner 2024 with record monthly revenue
-
Asia6 days ago
Government support, medals, and global recognition define a landmark year for Indian esports and video gaming in 2024
-
Latest News2 days ago
FBM Foundation spreads holiday cheer with initiatives in Brazil and the Philippines
-
Australia4 days ago
AUSTRAC Takes Ladbrokes and Neds’ Operator – Entain – to Federal Court Over Serious Non-compliance with Australia’s Money Laundering Laws
-
eSports5 days ago
GRID Joins IBIA as an Associate Member, Strengthening Esports Integrity
-
Australia6 days ago
Regulating the Game 2025 adds masterclass on safer gambling training and customer care
-
Interviews5 days ago
FTDx Wins Xanada Startup Contest: Unlocking Untapped iGaming Traffic with Innovative Monetization Solutions