RANDOM NUMBER GENERATORS

 

At the heart of every online gambling game there is a Random Number Generator [RNG]. This is not surprising, since an outcome of a random event is the fundamental basis of any gambling game. However, random outcomes are not as easily obtained in the computer world as they are in the real world. While we can simply toss a pair of dice to randomly generate a set of numbers, in the real world, computers need to be programmed to simulate a similar outcome. And the key words are "simulate" and "similar." What this really means is that a sequence of numbers that has been randomly generated by a computer is not necessarily as random as we may hope it to be.

First we need to understand what the word "random" really means.

 

Defining Randomness:

A random sequence of numbers is a sequence the bears no relationship whatsoever with any prior sequence(s) that this sequence was derived from. Furthermore, for a sequence to be truly random it requires that each number in the sequence has no relationship whatsoever with any other numbers that were randomly selected in the same sequence. If these conditions are not fully met, then the sequence is not truly random.

A sequence of 52 playing cards can be used as a good example for a sample sequence in this discussion. What does it really mean that a deck of cards is well shuffled, or that the sequence of all 52 cards is a random one? Can a new-deck factory sequence be considered as random? After all, isn't it at least theoretically possible to accidentally shuffle the cards in exact new-deck factory order? What would in fact be the odds to accidentally shuffle a deck of cards into new-deck order?

First we need to know the exact number of possible combinations, of a sequence consisting of 52 numbers. But before we deal with such a large number, let's first examine the same scenario if a deck of cards consisted of 4 playing cards (numbered 1-2-3-4). In this case, the total number of combinations is 24. We arrive at this total by calculating 4! (pronounced: 4 factorial, which is 1x2x3x4). In this case, when we use a deck that consists of 4 playing cards, it will not be astounding if someone accidentally shuffles the 4 cards into the exact sequence 1-2-3-4. The odds that this would happen as a result of a random shuffle are 1 in 24.

If we use a sequence of 6 numbers the total number of combinations dramatically rises up to a total of 720 possible combinations. So if someone were to throw a die six times, and randomly produce the exact sequence 1-2-3-4-5-6, that would be quite memorable. But, people around the world have been throwing dice for over two thousand years, so it is not inconceivable that such outcome has happened a number of times throughout history.

But still, going back to our discussion of playing cards, has anyone yet ever accidentally shuffled a deck of 52 cards in perfect new-deck order?

The odds for this to happen are actually exactly the same as the odds that someone would randomly shuffle a deck of 52 cards into any random sequence that has already existed in the past. The reason for this is because there is really nothing special about a sequence of cards in new-deck order. After all, it is just one of the many possible sequences of 52 cards. But how many possible sequences are there?

The answer is 52! (pronounced: 52 factorial) and we arrive at that total using the same formula we used for our 4-card sequence above, except going all the way up to 52. And the (rounded off) total is a massive 8.0658 x1067 (pronounced: 8.0658 times 10 to the power of 67; this means that there are 67 digits after the place that is now occupied by the decimal point).

This number is so large that we cannot possibly comprehend how large it really is, without doing some further calculations. The following explanation should help put this number into perspective.

First of all, the exact result of 52! is the following number:

80,658,175,170,943,878,571,660,636,856,403,766,975,289,505,440,883,277,824,000,000,000,000

This could be rounded off to 80,658 x1063, which basically replaces all the other digits by 63 zeros. This rounded off total would be pronounced: 80,658 vigintillion. A vigintillion is a 1,000 followed by 20 sets of 3 zeros. But if we wanted to verbally pronounce the entire number, without rounding off anything, then we would pronounce it as follows:

eighty unvigintillion,
six hundred fifty eight vigintillion,
one hundred seventy five novemdecillion,
one hundred seventy octodecillion,
nine hundred forty three septendecillion,
eight hundred seventy eight sexdecillion,
five hundred seventy one quindecillion,
six hundred sixty quattuordecillion,
six hundred thirty six tredecillion,
eight hundred fifty six dodecillion,
four hundred three undecillion,
seven hundred sixty six decillion,
nine hundred seventy five nonillion,
two hundred eighty nine octillion,
five hundred five septillion,
four hundred forty sextillion,
eight hundred eighty three quintillion,
two hundred seventy seven quadrillion, and
eight hundred twenty four trillion

This is enough to make your head spin. But it still doesn't illustrate how massive this number really is. The following calculations should do the trick.

If a shuffle takes 2 seconds it will take one person 5.1 x1060 years (without sleeping) to have the deck shuffled in all the possible combinations exactly once. At the same pace, it would take a team of 5 billion people, each shuffling a deck simultaneously, 1.022 x1051 years to shuffle all 5 billion decks combined into all the combinations, only once. Scientists have calculated that our Sun will keep shining for another 10 billion years, or 10.0 x109 years (at that time life on Earth will cease to exist). This means that we would have to extend the lifetime of our planet a massive 1.022 x1041 times to be able to accomplish this feat.

If 5 billion people all started shuffling today, and continued shuffling once every 2 seconds, they would only be able to accomplish 7.889 x1026 combinations, of all 8.0658 x1067 possible combinations, by the time the Sun would stop shining, which is only about 9.8 x10-40 % of all possible combinations (or 0.00000000000000000000000000000000000000098%, which is to say, approximately less than one dodecillionth of a percent).

The 52-card deck was invented in the 13th century. If we had 1 million people shuffling decks non-stop for the past 800 years they would have reached only 1.26 x1016 combinations by now, of 8.0658 x1067 possible combinations, which is a mere 1.6 x10-50 % of all possible combinations (or 0.000000000000000000000000000000000000000000000000016%).

This is why I don't play the lottery.

So, to answer our initial questions. No, it is not possible to randomly shuffle a deck of cards into new-deck order, and it is not even remotely possible that two identical randomly-produced 52-card combinations had ever existed, ever since humans were using playing cards, starting from the 13th century. In other words, we can make the following logical conclusion:

If a random-looking combination of 52 cards had ever occurred more than once, throughout the entire history, then the combination in question was definitely not a random one.

That last sentence is very important, which is why it has been highlighted. It is very important to understand this concept thoroughly, so that we separate ourselves from the average naive suckers that believe in amazing coincidences. Now that we have a good understanding how many possible combinations of 52 cards could theoretically exist, we are ready to continue our discussion about random number generators used in online gambling. But first we still have to understand what it means for a deck of cards to be randomly shuffled.

If we take a deck of cards, in any sequence, and give the cards one riffle shuffle, the result is not considered to be a random sequence. The reason is because the end sequence really consists of one half of the deck being dispersed throughout the other half of the deck. So, both halves of the initial sequence, still exist, with the cards in the same exact order, except that there are cards of the other sequence in between. Although it is not possible to predict the exact number of cards that would be inserted between each card, or groups of cards, of each initial sequence, the final sequence can still be exploited and approximate positions of all the cards can be predicted with a fair amount of accuracy. So, how many riffle shuffles does it take to achieve true randomness? We don't have to reinvent the wheel, and we don't have to go into all the theory. The answer is already a commonly-known fact. It takes a total of 7 riffle shuffles to achieve a truly random order of 52 cards. That is to say, after 7 riffle shuffles, the newly achieved deck order bears no resemblance with the initial deck order.

But we never see casino dealers shuffle a deck 7 times. That is true, but that is also an issue for a separate discussion. We want to know if a Random Number Generator used in an online poker room, can simulate the randomness achieved by shuffling a deck of cards 7 times. You should not be surprised to find out that the number of answers to this question equals the number of experts who have opinions about this. In other words, it really depends whom you ask. And it is also true that all RGN's are not the same. But the best way to answer this question is to describe how an RNG really works.

 

How Does an RNG Work?

To explain things in simple terms, there are two ways that computers can generate random numbers.

One way is to create a device that monitors a completely random natural event and sends its readings to a computer. For example, one could attach an ant counter to an ant house and count the number of ants that pass in front of the counter every minute. Since attaching an ant house to an online gambling server is hardly practical, experts have come up with other solutions. One viable solution is to place a piece of radioactive material in front of a Geiger counter and connect the Geiger counter to a computer. Since radioactive decay is random, the Geiger counter would generate truly random data. In practice this approach is pretty rare, and it is very unlikely that many gambling sites have Geiger counters connected to their machines.

An interesting solution had been developed by Silicon Graphics and used snapshots of lava lamps to generate true random numbers. This machine is no longer operational, but one of its inventors is carrying on the work (without the lava lamps) at the LavaRnd web site. Some other solutions use data from web page hits received by their own web servers. An interesting solution used by RANDOM.ORG involves a reader that measures atmospheric noise, which is also truly random and unpredictable.

Regardless if we use data from an ant house, radioactive decay, or atmospheric noise, we always need a piece of hardware that collects the random data. Although this approach may be viable for government-sponsored research labs, it is unlikely that gambling sites would bother with such equipment.

All of the methods mentioned above generate true random results but they have two main disadvantages. In most cases such methods require additional hardware. But the main disadvantage is that it requires a significant mount of time to gather the data and generate the results.

The more common approach to generate random numbers is to program a piece of software that follows an algorithm and generates a numerical result. Uh, but "algorithm" is a big word, so let's take a dictionary and see what it means: a logical step-by-step procedure for solving a mathematical problem with a finite number of steps, often involving repetition of the same basic operation. Now let's translate this into common English: it is basically a math formula. Let's break it down even further, with a simple example.

Here is an example of a simple RGN formula, from the book The C Programming Language:

int rand() 
{
  random_seed = random_seed * 1103515245 +12345; 
  return (unsigned int)(random_seed / 65536) % 32768; 
}

This formula assumes the existence of a variable called random_seed, which is initially set to some made up (ah... "random") number. The random_seed variable is multiplied by 1,103,515,245 and then 12,345 gets added to the product; random_seed is then replaced by this new value. The the whole calculation is repeated for the next number.

This RGN relies on the fact that the initial number, called the "random seed," is unknown to anyone outside the programmers. Furthermore, the algorithm itself is not publicly known and neither are the variables inside the algorithm. But does this sound like the definition of "random" to you?

The truth is, this is not truly a random number generator. In fact, this is only a pseudo random number generator. Any pseudo RNG depends on a predetermined seed value to start the sequence. If you start with the same seed and use the same algorithm, you will get the exact same sequence of values from the formula. So if you give the rand() function, shown above, the same seed on one computer and look at the stream of numbers it produces, it will be identical to the stream of numbers produced on any computer that runs the algorithm starting with the same seed.

To create a random and unpredictable sequence, the seed must be a truly random number. To get this truly random number for the seed, most programs use the current date and time, converted to an integer value (for example, converted to the number of seconds that have elapsed since January 1, 1970). Since this is a different number every time you start the program, it makes a good seed.

This is just the most basic explanation of how RNG's work. In reality RNG has become a science and in this world of rapidly evolving technology, things have already evolved beyond the oversimplified explanation described above. This explanation has just been kept to a bare minimum, in the interest of making it as understandable as possible, and not boring you to death with techno babel. But if one wishes to truly understand how RNG's work, one must seek information beyond what this site can offer.

However, now that we have the most basic understanding of RNG science, we can proceed by explaining the basis of online gambling scams. At this point, one can already conclude that the fundamental principle of an online gambling scam lies in the theory that any computer can be synchronized with the RNG computer, to produce identical RNG results, and thus "predict" the outcome of these "random" events, that are not truly random. But is this cheating just theoretical, or does it really exist?

 


« Poker Bots Page 1 2 3 4 5 6 Online Poker Cheating Software »

© CARDSHARK Online -- All Rights Reserved