heatmap
heatmap
  • Threads: 272
  • Posts: 2348
Joined: Feb 12, 2018
August 29th, 2018 at 9:18:58 AM permalink
Lets say i have and RNG and I can produce N possible combinations of a set of numbers, only limited to the size of my seed.

I want to know, Out of those possible combinations, is there any combinations that will come out that might be deemed not random, and if so, how can you say the RNG is producing random sequences if you consider non-random to also be random?

or am i missing something here?
Dalex64
Dalex64
  • Threads: 1
  • Posts: 1067
Joined: Feb 10, 2013
Thanked by
heatmap
August 29th, 2018 at 9:58:37 AM permalink
https://en.wikipedia.org/wiki/Pseudorandom_number_generator

It all depends on what you might deem non-random, I suppose.
charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 3011
Joined: Jun 17, 2011
Thanked by
heatmap
August 29th, 2018 at 12:10:23 PM permalink
There are various ways to test a RNG to see whether they are relatively random or have some inherrent problems. One method is to check the random numbers using various tests.
(a) Choose pairs of numbers and determine how often A is greater than B (it should be near 50%)
(b) Choose four numbers and try out similar tests.
(c) Run games such as Craps and see whether you get the expected house edge
(d) Generate points X=0-1 Y=0-1 and work out those in Unit circle, compare with Pi/4.
Google search gives more tests such as parking cars etc.

One thing you might also consider, is the need to look for is that unexpected things occur as often as you'd expect (Chi test etc).
gordonm888
Administrator
gordonm888
  • Threads: 61
  • Posts: 5357
Joined: Feb 18, 2015
Thanked by
heatmap
August 29th, 2018 at 1:03:43 PM permalink
Let me answer in a different way.

(pseudo) -Random number generators (RNGs) are used in Monte Carlo simulations in the physical sciences and for some engineering applications (including nuclear weapons simulations). In the U.S. over the past 6 decades there have been enormous amounts of money poured into studying random number generators at both universities and federal research laboratories in order to assure the "fitness" of the RNGs to produce stochastic randomness.

Any current use of RNGs by the casino industry is piggybacking on this large amount of academic and military research. It is fine to have an inquisitive mind and ask lots of questions, but if you are interested in understanding automated shufflers, it is important to be able to identify when your line of inquiry is likely to be a dead end. I also have issues with automated shufflers but IMO worrying about randomness of RNGs is akin to worrying about whether electricity really works the way we think it does.

The devil is in the software in the programmable integrated chips in the automated shufflers, not in stochastic randomness defects of RNGs used by the software.
So many better men, a few of them friends, are dead. And a thousand thousand slimy things live on, and so do I.
heatmap
heatmap
  • Threads: 272
  • Posts: 2348
Joined: Feb 12, 2018
August 29th, 2018 at 2:15:29 PM permalink
Quote: gordonm888

Let me answer in a different way.

(pseudo) -Random number generators (RNGs) are used in Monte Carlo simulations in the physical sciences and for some engineering applications (including nuclear weapons simulations). In the U.S. over the past 6 decades there have been enormous amounts of money poured into studying random number generators at both universities and federal research laboratories in order to assure the "fitness" of the RNGs to produce stochastic randomness.

Any current use of RNGs by the casino industry is piggybacking on this large amount of academic and military research. It is fine to have an inquisitive mind and ask lots of questions, but if you are interested in understanding automated shufflers, it is important to be able to identify when your line of inquiry is likely to be a dead end. I also have issues with automated shufflers but IMO worrying about randomness of RNGs is akin to worrying about whether electricity really works the way we think it does.

The devil is in the software in the programmable integrated chips in the automated shufflers, not in stochastic randomness defects of RNGs used by the software.



follow up question...

lets say i got a hold of an RNG and start producing numbers

i start a brute force attack and map all combinations of bits to an outcome as well as measure the win/loss percentage

i know this might not work for every rng but have you ever heard of anyone attempting something like this - obviously youd need lots of computing power and time
Dalex64
Dalex64
  • Threads: 1
  • Posts: 1067
Joined: Feb 10, 2013
Thanked by
heatmap
August 29th, 2018 at 5:23:40 PM permalink
That kind of attack can be done, usually by pregenerating a bunch of sequences and then matching the observed results to the sequence to know what comes next. You have to know which algorithm is being used, or have many sequences for many algorithms prepared.

That is why so many prng's, such as slot machines, continuously generate numbers at high speeds so that when a player hits a button, they aren't getting the next number in the sequence.
teliot
teliot
  • Threads: 43
  • Posts: 2871
Joined: Oct 19, 2009
Thanked by
charliepatrick
August 30th, 2018 at 7:15:54 AM permalink
Quote: heatmap

Lets say i have and RNG and I can produce N possible combinations of a set of numbers, only limited to the size of my seed.

I want to know, Out of those possible combinations, is there any combinations that will come out that might be deemed not random, and if so, how can you say the RNG is producing random sequences if you consider non-random to also be random?

or am i missing something here?

Your question makes no sense at all. To see this, just use reducto-ad-absurdum and ask yourself which of the following sequences is not random:

0,0
0,1
1,0
1,1

The RNG should produce each roughly 25% of the time. Likewise for any other sequence of any length, it should occur with frequency corresponding to its probability. One can't speak of a sequence as being random or non-random. One can only speak of the RNG producing that sequence with an appropriate frequency. A sequence test is one type of test that may be in a suite of tests.

Read about the Diehard tests and other tests on Wikipedia. Educate yourself -- Google is your friend.

https://en.wikipedia.org/wiki/Diehard_tests
https://en.wikipedia.org/wiki/TestU01
Climate Casino: https://climatecasino.net/climate-casino/
charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 3011
Joined: Jun 17, 2011
August 30th, 2018 at 9:00:35 AM permalink
Quote: teliot

...the Diehard tests...

Thanks - I had forgotten the exact name or these.

I actually use the Mersenne RNG for simulations (running casino games for analysis) using time/date in the initial seed - so it was interesting to read there are even better methods these days.
teliot
teliot
  • Threads: 43
  • Posts: 2871
Joined: Oct 19, 2009
August 30th, 2018 at 11:17:36 AM permalink
Quote: charliepatrick

Thanks - I had forgotten the exact name or these.

I actually use the Mersenne RNG for simulations (running casino games for analysis) using time/date in the initial seed - so it was interesting to read there are even better methods these days.

Vector, lattice and sequence tests are some of the toughest for RNG's to pass. As one of the articles says, if you increase the sequence to a long enough length, by definition the RNG will fail. For example, if the sequence length is the same as the period length then only one sequence will occur (per seed). If that's your sequence, then it will always occur when you run the RNG (with that seed), otherwise it will never occur.

I had this bias happen to me one time using VBA simulations for baccarat in Excel for a client. The client wanted to simulate various scenarios for player cheating. The built in RNG has period 2^24 = 16,777,216. I believe the RNG broke down when investigating its various sequence p-values when I was looking at the outcomes for six Bankers (or Players) in a row. You have to program your own RNG to do better in VBA. Fortunately this task is trivial.

This sequence problem (and other short-period biases) is why long period RNGs are essential when doing gambling simulations. For example, the Mersenne Twister has period 2^19937 − 1, which is about 10^6000 = 1,000,000,000,000,000 .... (about six thousand zeroes).

Eventually all RNGs give bad p-values when testing for the distribution of sufficiently long sequences. For the purposes of gaming related concerns, this theoretical burden is not a practical issue.
Climate Casino: https://climatecasino.net/climate-casino/
anonbit
anonbit
  • Threads: 0
  • Posts: 20
Joined: Sep 20, 2018
September 20th, 2018 at 4:21:07 AM permalink
I can’t figure out how we can distinguish random and non-random combinations. Random number generators create numerous sequences in which I can find various relations but this doesn’t mean that RNGs are broken. The thing is we can find specific patterns in every combination. To reveal the real results, it’s better not to find consequences but calculate percentage and check its ratio. I bet, stats will be close to ideally random.
heatmap
heatmap
  • Threads: 272
  • Posts: 2348
Joined: Feb 12, 2018
September 20th, 2018 at 12:28:35 PM permalink
Quote: anonbit

I can’t figure out how we can distinguish random and non-random combinations. Random number generators create numerous sequences in which I can find various relations but this doesn’t mean that RNGs are broken. The thing is we can find specific patterns in every combination. To reveal the real results, it’s better not to find consequences but calculate percentage and check its ratio. I bet, stats will be close to ideally random.



I just realized people were still speaking in this thread. Ive come across more info on at least one of the actual methods used to generate random numbers. Its called the fortuna PRNG.
anonbit
anonbit
  • Threads: 0
  • Posts: 20
Joined: Sep 20, 2018
October 8th, 2018 at 5:39:57 AM permalink
Please tell me details, very interesting.
anonbit
anonbit
  • Threads: 0
  • Posts: 20
Joined: Sep 20, 2018
October 8th, 2018 at 5:40:52 AM permalink
Please tell me details, very interesting.
heatmap
heatmap
  • Threads: 272
  • Posts: 2348
Joined: Feb 12, 2018
October 8th, 2018 at 7:24:19 AM permalink
Quote: anonbit

Please tell me details, very interesting.



from what i understand, there are these "pools" of numbers. these pools, are also called entropy, or what causes the PRNG to be random.

each one of these pools is constantly being refreshed all the time. one pool is being refreshed more than the other pool.

the amount of refreshing causes even more randomness.

there is a lifetime to the PRNG though, apparently, so the amount of refreshing of pools is limited so the randomness is preserved for a long period of time.

if someone has a better more thorough explanation feel free and also correct me if im wrong.
  • Jump to: