## Random Number Generator (RNG) take your time to read all if you're a serious player

### Terms

232 = 232 – two to the power of 32 .

Bad RNG - This is a RNG which will not form a circle of RandSeeds .

c1 - First constant of the LCG RNG formula .

c2 - The second constant of the LCG RNG formula .

Casino Software Provider- A company that provides software and server support for theonline casinos. Most known Casino Software Providers are Micro gamming, Playtech and RTG (Real Time Gaming) .

Good RNG - This is a RNG which will form a circle of RandSeeds .

mod - Modulo operation. 5 mod 3=2; 7 mod 3=1 .

RandSeed - A variable which stores the number from where is obtained the outcome at the casino .

RNG - Random Number Generator .

RNG circle - The circle which is made by the LCG RNG formula .

TST - Technical Systems Testing (TST) is an internationally recognized Accredited Testing .

Facility (ATF) offering a full range of testing and consultation services for Terrestrial traditional / land-based) and Interactive-based gaming, wagering, lottery, eCommerce and Information Technology industries, to ensure that gaming operates in a manner that is fair, secure and auditable .

Random Number Generation -There are many theories on random numbers. Here I selected the most known methods of obtaining random numbers and then I will show you how the casinos have random numbers and how they generate them.

In order to understand all the terms, which I will use for explaining everything, I will tell you a little history .

### Introduction

many applications of randomness have led to many different methods for generating random data. these methods may vary as to how unpredictable or statistically random they are, and how quickly they can generate random numbers.

before the advent of computational random number generators, generating large amount of sufficiently random numbers (important in statistics) required a lot of work. results would sometimes be collected and distributed as random number tables.

### physical methods

the earliest methods for generating random numbers - dice, coin flipping, roulette wheels are still used today, mainly in games and gambling, as they tend to be too slow for applications in statistics and cryptography.

some physical phenomena, such as thermal noise in zener diodes appear to be truly random and can be used as the basis for hardware random number generators. however, many mechanical phenomena feature asymmetries and biases that make their outcomes not truly random. the many successful attempts to exploit such phenomena by gamblers, especially in roulette and blackjack are testimony to these effects.

### computational methods

hardware random number generator in computing, a hardware random number generator is an apparatus that generates random numbers from a physical process. such devices are typically based on microscopy c phenomena such as thermal noise or the photoelectric effect or other quantum phenomena.

these processes are, in theory, completely unpredictable, and the theory's assertions of these processes are, in theory, completely unpredictable, and the theory's assertions of unpredictability are subject to experimental test. a quantum-based hardware random number generator typically contains an amplifier to bring the output of the physical process into the macroscopic realm, and a transducer to convert the output into a digital signal.

### problems

it is very easy to misconstruct devices that generate random numbers. also, they break silently, often producing decreasingly random numbers as they degrade. an example might be the rapidly decreasing radioactivity of the smoke alarms mentioned earlier. as the radioactive intensity decreases, its sensor will b e required to compensate, not an easily accomplished task. failure modes in such devices are plentiful and are neither easy nor quick nor cheap to detect.

because they are quite fragile, and fail silently, statistical tests on their output should be performed continuously. many, but not all, such devices include some such tests into the software that reads the device .

### Pseudo-Random generators

Most computer "random number generators" are not hardware devices, but are software routines implementing algorithms. Often they are supplied with such system software as language compilers (e.g., as one or more library routines) or operating systems (e.g., as system calls).

Linear congruential generators (LCGs) represent one of the oldest and best -known pseudorandom number generator algorithms. The theory behind them is easy to understand, and they are easily implemented and fast.

LCGs are defined by the recurrence relation:

where Vn is the sequence of random values and A, B and M are generator -specific integer constants. mod is the modulo operation.

The period of a general LCG is at most M, and in most cases less than that. The LCG will have a full period if :

This is the fastest-evaluated of all random number generators; Also they pass with success .

**Diehard tests :** The Diehard tests are a battery of statistical tests for measuring the quality of a set of random numbers. They were developed by George Marsaglia over several years and first published in 1995 on a CD-ROM of random numbers. Collectively they are considered one of the most stringent such tests known.

The tests are :

**Birthday Spacing :** Choose random points on a large interval. The spacing between the points should be asymptotically Poisson distributed. The name is based on the birthday paradox.

**Overlapping Permutations :** Analyze sequences of five consecutive random numbers. The 120 possible orderings should occur with statistically equal probability. Ranks of matrices: Select some number of bits from some number of random numbers to form a matrix over {0,1}, then determine the rank of the matrix. Count the ranks.

**Monkey Tests :** Treat sequences of some number of bits as "words". Count the overlapping words in a stream. The number of "words" that don't appear should follow a known distribution. The name is based on the infinite monkey theorem.

**Count the 1's :** Count the 1 bits in each of either successive or chosen bytes. Convert the counts to "letters", and count the occurrences of five -letter "words". Parking Lot Test: Randomly place unit circles in a 100 x 100 square. If the circle overlaps an existing one, try again. After 12,000 tries, the number of successfully "parked" circles should follow a certain normal distribution.

**Minimum Distance Test :** Randomly place 8,000 points in a 10,000 x 10,000 square, then find the minimum distance between the pairs. The square of this distance should be exponentially distributed with a certain mean.

**Random Spheres Test :** Randomly choose 4,000 points in a cube of edge 1,000. Center a sphere on each point, whose radius is the minimum distance to another point. The smallest sphere's volume should be exponentially distributed with a certain mean. The Squeeze Test: Multiply 231 by random floats on [0,1) until you reach 1. Repeat this 100,000 times. The number of floats needed to reach 1 should follow a certain distribution.

**Overlapping Sums Test :** Generate a long sequence of random floats on [0,1). Add sequences of 100 consecutive floats. The sums should be normally distributed with characteristic mean and sigma.

**Runs Test :** Generate a long sequence of random floats on [0,1). Count ascending and descending runs. The counts should follow a certain distribution.

**The Craps Test :** Play 200,000 games of craps, counting the wins and the number of throws per game. Each count should follow a certain distribution. As you see Hardware random number generator pre sent numerous problems, especially when it need a fast RandSeed calculation. That's why casinos work only with Pseudo -random generatorsThe Craps Test: Play 200,000 games of craps, counting the wins and the number of throws per game. Each count should follow a certain distribution. As you see Hardware random number generator pre sent numerous problems, especially when it need a fast RandSeed calculation. That's why casinos work only with Pseudo -random generators

- Statistical randomness
- Internal state of the RNG
- Unpredictability
- Non-repeatability
- Re-seeding and cycling
- Read more there Here

### Casino’s RNG Formula

The casino’s RNG (Random Number Generator) is a simple mathematical recursive function RandSeed (n) = ((c1*RandSeed (n-1)) + c2) mod M, where c1, c2- two constants, M-modulo factor usually 2^32 or 2^64 Seeing this formula, you may think that the RandSeed keeps increasing to infinite, as we multiply the last RandSeed by c1 and add c2. Anyway this does not happen and the reason for this is “mod M”. There is always a limit to the RandSeed’s value and it depends on how many bits the algorithm was made to work. If the algorithm work s on 32-bits, then the range of RandSeed will be from -2147483648 to +2147483647. So if the next RandSeed will be greater than +2147483647, it starts again from -2147483648.

For example, let’s choose c1=84783 and c2=4236381 (later you will find out that not any number can work for c1 and c2). Also we have RandSeed1= 53478. After we make the calculations we receive:

If we do this for 2^32 times we will get back to the RandSeed (2^32) = RandSeed1.

ALL the online casinos are based on this simple formula. It was proved by me, by a fact I saw as you will see later and by other who cracked already the casino RNG.

**What does it mean that a casino software provider is approved ?**

Sometimes you may read that some organizations, like TST, tested the RNG and the casino software of a certain provider, and they said that its RNG is good. This means they just verified if the casino is actually using this formula (RNG) in order to get the outcome to the user without taking into consideration the winnings he made. The uncertified casinos may use the above formula together with the winnings verification process. It's a very simple algorithm added to the RNG, which can be made by everyone, in order to bring all the users to failure at last

Here we will talk just about verified casinos, since the unverified casinos are almost impossible to be beaten. They are programmed to make you lose, though this is not a rule for all so read further.

**Casinos that use not ONLY RNG. How were they beaten ?**

You understand very well that I can't give you names here and I will not name these casinos even if you ask me

Though this kind of casinos seam unbeatable, they were still beaten by my friend more than one year ago. At the start I thought he was joking, but he was very serious and very committed to winning at an unverified casino.

Firstly, you should know that your balance is not monitored by a human being, but by a program. It “takes care” of everything and makes in such way that you lose all your bankroll. Also it does not make you to lose straight way , they are also programmed to make you win.

Anyway if the user does not match to a certain condition (which represent the games the user plays, the bets he makes and the way he plays), the algorithm won't know what to do with him and it will make him to lose. So, it depends on MANY factors. Knowing these factors, you can trick this algorithm and win. It's a kind of game, but well, this was made by a friend of mine more than one year ago.

At the beginning he made a gambling website and registered as affiliate of each of these casinos. He didn't make much money as affiliate, since he was having a very low number of users and the casinos were not very well converting. Anyway he analyzed the betting process of those players, who signed up under his affiliate code, and the way the algorithm was making them to win and finally to lose. So the algorithm verifies if a player deposited a lot the n it let him increase the bankroll with 40% and after that it makes him lose all his money.

This gives you an impression that it is possible to win at this casino, that’s why after you lose everything, you just think this wasn’t your lucky day, but this casino is good. Usually this makes people to deposit even more money in the same or next day. If a player deposited a low sum of money then the algorithm makes him stay with the same bankroll for a while and after some time the player loses. He starts thinking that he didn't have the necessary balance for winning, so he deposits more in the casino.

After detecting all these aspects (here were not told all of them) of that algorithm he deposited $3,000 at the casino and he made about $5,000 with the tricks, which he discovered. He was surprised about the big number of unverified casinos, which were using this algorithm, that’s why he was satisfied when finally he mocked at their algorithm of beating us.

The casinos, where he was playing, have already been closed. As you see these casinos are opened only for cheating us and they don't care about their reputation. Also they are intended to a small number of players.

Here comes a question :

**What gives an advantage to the casino ?**

**Why the payouts always are <100% ? **

**Why the payouts always are <100% ? **

The advantage depends, particularly, on each game. The roulette’s advantage is the single “0” (for European Roulette) or “0 and 00” (for American Roulette). It is also called the house edge.

So, to say that the outcome of the RNG can’t be beaten it's not correct. The idea is that the “RNG + house edge” can't be beaten.

Now let’s discuss here how we are going to bet the RNG. At the end of e-book you will see how the "RNG + house edge" will be beaten 100% by beating the RNG. I say this, because you will know the outcome (like the number that will land on the next spin) which you will receive from the casino

Let's get back to the main formula of the RNG

**What do we need in order to beat the “RNG?**

To beat the RNG we need just two constants c1 and c2. But knowing these 2 constants, we will also need at least one RandSeed and so we will be able to find out the next RandSeeds, in such way the RNG is beaten.

Now let's say we DO have the 2 constants and we know that the RandSeed for a particular spin is for instance 53478.

So c1=84783, c2=4236381 and RandSeed1=53478. Making the calculations we will know that RandSeed2=243294359.

**And what do we have with THIS? So we have the RandSeed, and what of it ?**

We need the number that will land (for the roulette game).

That's why here comes the next question.

**How is the number formed from the RandSeed ?**

There were some people who were stating that the outcome (the number for the roulette game) results from “RandSeed mod 37” (since there are 37 possible outcomes as the roulette has 0...36 numbers). This method of obtaining the outcome is very primitive and those , who made it, are really stupid.

At the start I was happy, since I thought that I found a way to beat the RNG. However I didn't succeed. So I knew that the formula is more than just RandSeed mod to 37 or to 53 (for the blackjack game). It took me some time to find it .

So I’ll show you exactly how the number is formed from the RandSeed. L et's say we have currently a RandSeed= 1732545654. Now we’ll make some calculations. Run the Calculator program from Start-> Programs-> Accessories-> Calculator. Then select “Scientific” from “View” menu. Enter the RandSeed number and check the “Bin” radio box

**What advantages does this formula give?**

This formula involves only binary operations, which are easily executed by the computer. Also this formula removes the weakness given by RandSeed mod 37 .

You should notify that the RandSeeds 1732545654 and 1732545655 give the same outcome, because we remove the last 16 binary digits. And not only the next RandSeed but also a group of 65536 ( 2^16 ) RandSeeds would give the same outcomes in the casino. This means that a new outcome comes at every group of 65536 RandSeeds. So if the first group of 65536 RandSeeds gives one outcome ( let’s say number “23” for the roulette game ) then the next group will give an outcome ( this is the next number of the first outcome for the roulette game. For our example, it is the number “24” ) .

So the question is how the RandSeed passes from one group to another. Knowing this it will result in beating again the RNG, as we will know which group of RandSeeds is the next one and thus the outcome in roulette.

So we already know the formula used to transform the RandSeed in the outcome given to you by the casino’s server. So all we need is to have those RandSeeds and we can safely predict the outcome. This is where we will make the research now. As we see, this simple formula is good enough to give random numbers .

**But what does it mean good enough ?**

**What properties should have this formula ?**

**Why it has to be exactly this one ?**

We are going to answer at these questions referring again to the formula :

There were many proposals before this formula appeared. The main idea was to find out the formula which would get each RandSeed once and after the last RandSeed it would start with the initial startup RandSeed.

This is what I named a Good RNG. Suppose we have 10

Consider the RNG circle like a roulette wheel.

**Does it matter what values we take for the constants ?**

Well, for example, if c1 is a divisor of 5 or an even number then this formula will not make a circle. The second constant should not be “0” or “1”. The c2 constant generally is a big number. The other properties of c1 and c2 are mentioned on the first chapter. So, as you see here is a bit of work before making the RNG .

ALL the online casinos are based on this RNG formula. The diffe rence between them is these 2 constants. Now let me tell you one thing. Knowing these 2 constants, it results in having the outcome for any game of the online casino. Anyway the transformation of the Randseed in the outcome also depends on the game played. For example, we use the same formula both for the blackjack and for the roulette game, but for the blackjack we have “RandSeed mod to the number of cards” .

Knowing the RNG and some outcomes, we can find all the next outcomes in a few minutes.

### RNG Beating the Casinos:

There are many methods of beating the casinos. In this edition, I present two of them.

**First Method :**

First method is to go directly to the casino servers and take those 2 constants from there. Actually we don’t take the algorithm or something like this. You should know that t here is an algorithm for generating the RandSeeds and sending them to the other algorithm, where the outcomes are obtained.

**Second Method :**

The second Methode is making the outcomes depending on the game played. So actually, what we need is to intercept the RandSeed while it is sent from the first algorithm to the second one. We need just 3 or 4 RandSeeds in order to find out the Constants

This seems impossible, but it was already done

By roulette syllabus,

G. Seth