gege
|
Random Number GeneratorRandom Number Generator
The Random Number Generator (RNG) is the brain of the slot machine. While most player know that there is a computer chip picking the numbers, they do not fully understand how it works and this can lead to some of the many myths and misconceptions about a slot machine.
One of the most common myths is that a machine has a cycle that can let a player know when it is due to hit. Many “Snake Oil Salesmen” will try to sell you a system for doing just that. Save your money, it can't be done. Inside the slot machine is a microprocessor similar to the one in your home computer.
Instead of running Word or Excel, it runs a special program, the RNG that generates numbers to correspond to the symbols on the reel of the slot machine.
You might say that the RNG is in perpetual motion. As long as there is power to the machine, it is constantly selecting random numbers every millisecond. The RNG generates a value between 0 and 4 billion (approx number), which is then translated into a specific set of numbers to correspond to the symbols on the reels. The outcome of each spin is determined by the number selected by the RNG. This number is chosen when you hit the spin button or deposit a coin.
The RNG uses a formula known as an algorithm, which is a series of instructions for generating the numbers. The scope of this is beyond most of our mathematical knowledge but can be checked for accuracy. This is done by the Casino Control Board and other testing laboratories to make sure that the program performs, as it should, so that the player will not be cheated.
While all of this may sound reasonable, it still does not give the layman a basic understanding about how the RNG works. Although this is not precisely how the RNG operates, it should give you a basic understanding of the principles of how the winning spins are determined.
Reel type slot machines have a number of spaces on each reel that contain a symbol or blank. These are referred to as the physical stops. Most of the old mechanical machines had reels that could hold 20 symbols while the modern slots have reels with 22 physical stops. The micro processing technology allows the new machines to be able to accommodate a large number of “Virtual stops.”
For this example, let's simplify things and imagine that there are only 10 stops on each reel. With 10 stops there can be 1,000 different combinations. We get this number by multiplying the number of symbols on each reel (10 x 10 x 10 = 1,000). The 1,000 combinations that can be attained are known as a cycle and this is the word that sometimes confuses a player into thinking that the machine has cycles of winning and losing.
The odds of a three number combination being picked are one in a thousand.
Theoretically, if you play 1,000 spins, you should see each of these number combinations once. However, we all know that this is not the case. If you played a million spins, you would see that the numbers would even out to be closer to the actual probability.
This is similar to flipping a coin 100 times. Although the odds are 50 -50, you are unlikely to see 50 heads and 50 tails after 100 spins.
Many of you have seen the Daily pick 3-lottery drawing. They have three glass bowls or drums each containing ten balls numbered 0 -9. The balls are mixed up and when the top is lifted, a ball pops up the tube showing you the first number.
This is repeated for the second and third number to give you a three digit winning combination.
Understanding The Random Number Generator (RNG)
A Simple Example
To use this as an example of the operation of the slot machine, we will replace the numbers 0 -9 on the balls with slot symbols. In each bowl, we will have one ball with the jackpot symbol on it. Two balls with a Bar, three balls with a cherry and four balls which are blank.
Imagine the RNG in the slot machine as the person drawing the winning combination.
Here is the breakdown of the number of times out of a thousand that the winning combination made.
3 Jackpot 1 (1x1x1)
3 Bars 8 (2x2x2)
3 Cherries 27 (3x3x3)
Total Wins 37
There are 963 losing combinations consists of:
3 blanks
2 blanks and a symbol.
1 blank and two different symbols.
3 mixed symbols.
The RNG picks these combinations of numbers thousands of times each second. Now imagine a sting of blinking lights where only one bulb can be lit at a time. The electrical current is zipping from bulb to bulb down the string.
When you push a button, the current stops moving and the bulb in that position lights up. In this example, the light represents the three-digit number just picked by the RNG. If you hesitated a second before pushing the button, the results would be different. This is the same, as you are getting up from a machine and seeing someone else sit down and hit the jackpot. The chances are astronomical that you would have hit.
How Can A Computer Generate A Random Number?
There are two ways that computers can generate random numbers:
You can create some sort of device that monitors a completely random natural event and sends its results to the computer. For example, you could 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 create truly random numbers. This approach is pretty rare, because not many people have Geiger counters connected to their machines.
You can create a formula that generates a pseudo-random number. When designing the formula, the idea is for it to produce a string of numbers that would look random to anyone who did not know what the formula is. Characteristics of a good formula include:
No repetition: The sequence does not cycle around and repeat itself.
Good numeric distribution: If the formula is producing random numbers between 0 and 9, the number of zeros, ones, twos, etc., then what it produces should be roughly equal over a long period of time.
Lack of predictability: You have no way to predict what the next number will be unless you know the formula and the seed (the initial value).
Here's an example of a simple random-number formula:
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 number. The random_seed variable is multiplied by 1,103,515,245 and then 12,345 get added to the product; random_seed is then replaced by this new value. This is actually a pretty good pseudo-random number generator. It has a good distribution and it is non-repeating. If you use it to produce random numbers between 0 and 9, here are the first 20 values that it produces if the seed is 10:
4
4
6
0
7
4
2
3
5
0
5
6
6
4
5
6
7
6
7
4
If you have it produce 10,000 values between 0 and 9, here's the distribution:
0 - 1015
1 - 1024
2 - 1048
3 - 996
4 - 988
5 - 1001
6 - 996
7 - 1006
8 - 965
9 - 961
Any pseudo-random number formula depends on the seed value to start the sequence. If you start with the same seed, you will get the same sequence of values from the formula. So if you give the rand() function shown above the seed of 10 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 it with a seed of 10.
In the case of the Global Positioning System, this reproducibility is used as a way to give each satellite a predictable but different pattern of values that the GPS receiver can track.
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.
|