# Random Number Generators for Dummies

Share:
20 August 2009, Created By: Sean Lind

Ever wondered how poker sites randomly shuffle the deck? Here's everything you need to know about RNGs, but were too afraid to ask.

Before we get into the generators, the first step in understanding how a poker site shuffles its decks is to understand what the word random actually means. The actual definition of random is very simple:

Random = impossible to be predicted.

Computers can only do what they're told to do. Until full-functioning artificial intelligence becomes a reality, a computer is a slave to the person operating it.

A computer cannot create, or think for itself. It can only be given a set of instructions and return the results from following them.

Does not Compute
(0100010001101111011001010111001100100000011011100110111101110100
0010000001000011011011110110110101110000011101010111010001100101)

The very first computer ever created ran on a series of switches. It would do different things depending which switches were on (1) or off (0). The first computers used physical, hand-modulated switches (just like you use to turn on the light in your living room).

As computers progressed, the switches became electronic, and computers went from processing a handful of switches a second to billions.

This is what's known as binary, 1's and 0's. All regular computers today still run on this simple system; everything you do on a computer can be broken down to a series of ones and zeros.

In fact the text title of this section (Does not Compute) is represented in binary by the series of ones and zeros next to it (eight digits for every letter).

Because computers working like this, everything a computer does has to be based on logic. 1+1 always equals 2, unless the computer is instructed otherwise.

A computer can't randomly choose a number, because when a computer is asked to pick a random number, its response is "How should I do that?"

As soon as you have to tell the computer how to select a random number, the number is no longer random.

## Fake Random Numbers

The movement of a Lava Lamp: impossible to predict.

In the scientific world, fake random number generators are known as Pseudo-Random Number Generators (PRNGs).

The majority of random number generators used by computers are not truly random. They are a number created by a programmed algorithm. Basically, you take a sophisticated mathematical algorithm, and use its result as your random number.

For those of you who know anything about math, you need to start with a number to put into the algorithm to be able to get anything out as a result. This initial number is known as the seed. A basic simple seed used by many PRNG's is using the system's internal clock to pick its number.

The problem with this approach is its vulnerability to be cracked. If anyone can get their hands on (or figure out) your algorithm, and the method for finding your seed number, they will be able to predict the identical random numbers with 0% error.

Obviously, this would be a mistake for a poker site, as it would allow anyone who can figure out its algorithm to compromise the game. Although these sorts of RNGs can be useful for non-crucial tasks, such as video games, they're not suitable for true security.

## True Random Numbers

Although it's possible to argue that it's impossible to be truly random, it's absolutely possible to get very close. Close enough that it is impossible (using any technology available today) to predict the number generated.

To achieve this level of random, computers must find a seed which is, in itself, random. This is done by measuring a physical occurrence, or reaction, which happens naturally at random.

For example: measuring radioactive decay, thermal noise or even the movement of a lava lamp.

When using a system such as this, even if someone obtains your algorithm, they will still be unable to reproduce your results, without somehow managing to monitor the same source for the seed numbers.

## Where Poker Comes in

Poker sites shuffle the deck randomly, using the random numbers their RNGs create. Every major poker site has outside experts evaluate the state of its RNG, to make sure the RNG is in fact creating unpredictable results.

Although some sites give out more information than others, all poker sites post public information about their specific RNG in use:

## Single Shuffle versus Continuous Shuffle

Practise enough and even a hand shuffle isn't random

Once you're confident that all poker sites use a valid RNG, making its shuffles unpredictable, the next thing to know is that there are two types of shuffling used by poker sites.

The single shuffle is the equivalent to a hand-shuffled physical deck. It's randomly shuffled, cut, then dealt. Once dealing has started, the deck remains intact as it was after the last shuffle.

Although this technique is the most "pure," it's not the only way a poker site can choose to operate. Some poker sites choose to add one more layer of security by using a continuous shuffle.

This means after every card is dealt, the deck is constantly being shuffled before every new card to be dealt. This layer of security makes it almost impossible to know what card will be dealt next.

## Should You Worry About Online Security?

Let me put it this way: If any person can create a way to crack a true RNG, that single idea alone will bring them more wealth and fame than they could ever gain from cheating at poker.

It would be a creation worthy of a field's medal, and would become the backbone of all military code-breaking operations.

It would be the single biggest thing to happen in the computing world since the invention of the microchip. If you invented such a thing, you would have two choices:

• Cheat at poker to become Phil Ivey-rich, while constantly having to hide and worry about being caught as a cheat.
• Sell the idea to the military to become Bill Gates-rich, while at the same time becoming a national hero and computing god.

Which would you choose?

Share:

Error saving comment!

You need to wait 3 minutes before posting another comment.

Alvaro Pompeia 2017-06-02 16:59:38

I do not play with money. Only with play money. They said it is random but I disagree on certain conditions. A game name Split&Go with a 10 thousand coins did a split from 15K 20MB. I play from a long time and never got more than 50k. The prizes come 15k, 20k, 30k on more than 80% of time. I think some games will write on disk some millions hands and that will be generates assincrously from a external way.

Oran Black 2016-07-03 00:11:18

Online poker apps really are random, and my dick is 12 inches long. You can guess which one of those statements is true...neither of them. The next time I play Governor of Poker 3 or World Series of Poker, I'm going to make a video of me playing and post it to YouTube so people can see just how random those apps aren't.

Paul 2015-06-11 19:41:19

Very nicely explained at last, I disagree about the continuous shuffle. Its very easy to put a stop on the shuffle when the card that makes the river the winning card. How many times do we see our hands busted and we drown? Not deliberate but a characteristic of RGN.s? This would also explain why suited flops appear when you have a suited pocket, but the flop is always one of the other three suits to the one you hold. Over 5 years my data suggests this occurs four times as often as it should. (I played six hours a day for six days per week for 5 years to get this and other data). Single shuffle is better and more like the face to face game.

David 2014-03-31 07:29:23

RNG is definitely NOT random. I was at 2 tables simultaneously. On both tables I was dealt 77. On each flop I had an overpair to the board and I ran into AA BOTH times.

How random is that? Its NOT!!!! The mathematical odds of being dealt 77 on 2 tables simultaneously, having an overpair to the flop, and running into AA are astronomical...

Not possible for that to be random.

Andy 2013-03-21 05:09:36

I Rather Be Phil Ivey Then Bill Gates

Lugubre 2009-11-13 11:41:00

To Jason:

You're wrong about the straight flush. The odds for the board running out a straight flush is 64,973 to 1 against.

The board can run out 52x51x50x49x48 / 5x4x3x2x1 different 5-card hands, which totals 2,598,960 hands.

Since there are 40 different straight flush combinations (10x4) when the 4 royal flushes are included the board will run out a straight flush 1 time in 2,598,960 / 40 = 1 time in 64,974

Sean Lind 2009-11-11 05:00:00

Hey, that picture is not my own work. If I'm not mistaken It's from the creative commons section of Flickr.

I couldn't find it again, otherwise I'd link you.

I like the Droste effect used in the image for this article. Did you create it? If so, what app did you use?

Jason 2009-09-23 21:07:00

Assuming you know the 3 hands pre-flop (KK + JJ + KJ), the odds of a dealt flop including the remaining KJ are 1 in 345. Using the "choose function" for combinations, there are 46*45*44/6 unique flops. There are 44 possible flops that include KJ (KJ plus any of the remaining 44 cards from the deck as the third card). 46*45*44/6/44 = 345 / 1.

The odds of KJ, KK, and JJ being dealt pre-flop can be computed similarly (although it's more complicated). If we assume there are just 3 players, the odds are 1.27 million to one. Each added player makes the odds go up significantly--with 4 players, the odds are 357 thousand to one. Going beyond 4 players is too hard to do by hand with a calculator -- I'd need to write a program. Of course, that's assuming you're specifically looking at KJ -- there are similar scenarios, like AK vs AA and KK, which further increase the odds. It's probably not nearly as unlikely as you think.

Play enough online, and you'll eventually run into this. The most unlikely hand I've ever seen was when the board ran out a straight flush, which is 7.8 million to one against.

Next time, maybe fold the KJo preflop? It was a marginal hand to begin with, especially against a pre-flop raise, which I assume there must have been.

Sean Lind 2009-08-28 22:26:00

gunner,

The computer uses a video feed of the lava lamp, monitoring a specific area of the lamp. Each time it needs a seed it take a snapshot of the lamp at that moment, and uses an algorhythm to turn the image into a number. This can be done in a number of ways, the simple of which being a simple pixel count.

the % of pixels with the exact color of the lava lamp goo compared to not. Something like that.

Bloggers

#### The Poker Reporter Blog

Poker news, gossip, parties, donkstrikery and functioning illiteracy with the PL.com crew!
Latest Posts 's Page

#### WSOP Blog

WSOP live blog from the tournament floor w/ poker pro interviews, photos and side action from Las

Latest Posts 's Page

#### Positively Nerd Street

Pr0n for the poker nerd. Hardware, software, gadgets, etc; like poker, but from the future.
##### Recent Posts
Latest Posts 's Page

#### The Guest Blog

A menagerie of poker pros, celebrities, poker writers and industry figures.
Latest Posts 's Page

#### Battle of Malta Blog

Photo essays, player profiles, travel tips, off-the-cuff interviews and more from Battle of Malta!
Latest Posts 's Page