The Random Number Generator Demystified!

Random number generator

I’ve heard and read about several complaints on forums and Facebook groups et al that kinda go like Dude, “your RNG is rigged”, “your site software is fraudulent”, “why do I keep losing on your site” and lots of stuff on lines like that. It actually made me do a lot of – and believe me – a thorough research on the topic – especially about the much-maligned (in the online gaming industry) RNG.

It also helps when the cabin next door to yours in your company office is occupied by the alleged nerdiest person on the block – your friendly-neighborhood CTO! So, a lot of input from his end is not only desired but opens your own eyes and perspective on how the entire gaming system works.

Random number generators (RNG’s) are frequently used in cryptology where random numbers are used to generate difficult to predict keys that are used to unlock coded messages. Kind of the Benedict Cumberbatch movie about cryptology.

An interesting application of random number generators is in the online casino and poker industry. Since its advent, the online poker and casino industry has relied heavily on random number generators to provide statistically random outcomes to a wide range of casino games such as blackjack, poker and of course slots.

Initially, the industry relied heavily on cumbersome Geiger Muller RNG’s but as gaming software technology developed further so did the type of RNGs used. Today’s online casinos and poker rooms rely exclusively on pseudo-random number generators with what is called the “seed number” generated by a separate process.

So now you do not really need to marvel how online poker sites achieve completely unpredictable and random results 24/7 because the answer is in our random number generators (RNGs). You do not need to rack your brain to figure out who or what determines whether a King of Hearts or a deuce of spades will be dealt out next in a poker game – it’s the thingy that our poker software developers term as random number generators, abbreviated as RNGs!

In simple terms, the RNG is a system for generating a totally random (lacking any pattern, unconnected and unpredictable) series of numbers. It is absolutely not an easy thing to achieve 100% random results using man-made codes to work on computers but the RNGs deployed by all the online poker rooms that we build to do just that.

Let me show you how cards are presented, as a side note. Cards are represented as a long 64-bit representation. A value of “70370896904320” stands for bit pattern “10000000000000010000000010100000000000010000000” which literally represents 5 cards (note the 5 set bits and their position) of value 9C 9D JD 7H 9S. The card’s value is usually accompanied by a count or another for visibility.

A set bit for a card in the visibility field means that the card is an open card. Sometimes a “card count” field is also present for example in a player hand. This is there because the actual player card cannot be broadcasted to all players and is zeroed out. The game client needs to know how many closed cards need to be displayed and this is the field that provides that value.

Getting back to random number generators, as recently as 100 years ago, people who needed to use random numbers for scientific work did several seemingly silly things like tossing coins, rolling dice, dealing cards or picking numbers out of hats or baskets.

True random numbers are generally generated by sampling and processing a source of entropy outside the computer. This source of entropy can be very simple, like the tiny variations in somebody’s mouse movements or in the amount of time lapsing between keystrokes on your keyboard.

In practice, however, it can be tricky to use any user input as a source of entropy. Keystrokes, for example, are often buffered by the computer’s operating system, meaning that several keystrokes are collected before they are sent to the program waiting for them. To the program, it will seem as though the keys were pressed almost simultaneously. So, no go.

Most poker sites use hardware random number generators. They will also modify the output to remove any scaling bias and often use ‘pots’ of numbers which can be ‘stirred’ using entropic events (like user activity, server i/o events, etc.). Quite often the resultant numbers just index pre-generated decks (starting off as a sorted list of cards).

Even casino slot machines generate random numbers continuously at very high speed and use the most recent result(s) when the user pulls the lever (or hits the button) to spin the reels. Thus, even a simplistic generator can be used.

Even if you knew the algorithm used, you cannot observe wherein the sequence exactly is because nearly all the results are discarded. If somehow you did know where it was in the sequence, you would have to have a millisecond or better timing to take advantage of it.

Modern “mechanical reel” machines use PRNGs (pseudo-random number generators) and drive the reels with stepper motors to simulate the old-style spin-and-brake.

To get a license to operate a gaming site in a particular jurisdiction usually requires that the random number generator (RNG) has been certified by an independent third-party. These jurisdictions – like the Malta Gaming Commission or the Isle of Man Gaming Commission have very high standards of determining the security and credibility of the gaming provider/operator, and the certifying labs have to totally conform to them.

The third-party testers will analyze the source code and run statistical tests to ensure that the RNG behaves randomly.

Take the example of the Technopolis LLC poker, casino, and other gaming software that runs on RNG – it is certified thoroughly by the premium gaming lab – iTechlabs. These guys have a rock-solid reputation for doing a great job with high integrity, for years and years, now.

Reputable poker sites will usually include details of the certification that their Random Number Generators (RNGs) have undergone. This is solid credibility, that a lot of newbies in the industry lack and do not implement.

So, the next time you have a bad beat, or you simply happen to lose because of a bad play – and remember, this is why poker is a skill-game – let’s not jump the invisible gun and blame the RNG!

For more on Poker software; The Technopolis LLC Poker Software Brand


Trish Kunath

Business Head at Technopolis LLC, a Florida-based Ecommerce & Gaming Software Technology company that specializes in the development of Ecommerce Marketplaces & Skill Games Software. I help build & promote our Ecommerce marketplaces and my Online Gaming clients with their turnkey online skill gaming business ventures. In my spare time, I guest post on some top poker, gaming, lifestyle websites and my own blog:

Leave a Reply