Analyzing Random numbers

Thread Starter

Wendy

Joined Mar 24, 2008
23,798
There is always going to be a margin of error. Again comes with the territory, If I flip a coin 1001 times and get 50.05% I would not quibble with the results. A consistent 60/40 bias with 10 flips is something else. Only with large samples can you analyze a generator
 
Last edited:

nsaspook

Joined Aug 27, 2009
16,321
Note that superdeterminism is not equivalent to believing there is no randomness. Superdeterminism is the much stronger belief that a) there is no such thing as statistical independence (everything is correlated); and b) that every experimental choice ever performed was caused specifically to give the desired outcome (with respect to Bell's theorem).

In other words, one can believe that the universe is deterministic (no randomness) and at the same time not believe in superdeterminism (conspiratorial universe).
Then it's just a matter of processing power to convert a completely deterministic universe to superdeterminism when we "know" exactly where each particle of the universe will be at any given moment in the future, or was in the past, or will ever be. The conspiratorial part is the loss of 'free will' to change or control what happens because we are set pieces moving in time.
 

Ya’akov

Joined Jan 27, 2019
10,235
Then it's just a matter of processing power to convert a completely deterministic universe to superdeterminism when we "know" exactly where each particle of the universe will be at any given moment in the future, or was in the past, or will ever be. The conspiratorial part is the loss of 'free will' to change or control what happens because we are set pieces moving in time.
In discussions with a colleague, a specialist in quantum theory, I brought this up and he pointed about that chaos theory prevents this even in principle. The sensitivity to initial starting conditions means that even if the behavior of the system is, in fact, deterministic, there would not be enough particles in the universe to define the starting state accurately enough to prevent deviation of the model from the actual behavior after a finite time.

This idea, which is quite mainstream and demonstrable, suggests that whatever “deterministic” might mean, it’s not what people think.

Chaos and complexity, and the concomitant emergent behaviors, really make the idea of determinism fraught. Add in the problems of computability of certain even relatively simple systems and there doesn’t seem to be a hope for simulating reality... ...at least not from inside it since we don’t have enough bits to simulation the underlying simulation... ;)
 
Another example: if we flip 10 fair coins, the probability of flipping the sequence HHTHTHHTTH (where H stands for heads and T for tails) is exactly the same as flipping HHHHHHHHHH, though the former "looks" more random than the latter. Predictability doesn't help here. The best we can do is consider a large number of such events and see if they follow the probability distribution of some other process that we consider random.
Yes, that is certainly true - that the probability of getting any sequence is the same as getting any other sequence. That is, the p of any sequence of 10 flips with a fair coin is .5 to the 10th. Typically, probability expressions and "problems" consider "that outcome and ones more extreme" or "at least 5 heads", that sort of thing. So too do tests for the significance of the difference between groups and tests of deviations from an expected outcome if it is a fair coin.

But, when you say, "The best we can do is consider a large number of such events and see if they follow the probability distribution of some other process that we consider random." I would word it differently. We would consider the other process to be theoretical rather than actual. That is, for example, we expect the outcome to look like a normal distribution if it is random process. We don't have another process that we consider random, except in a theoretical sense.

The problem, in a very real sense, is that the assessments of a difference as a departure from randomness are always from what the theoretical different is and, in the end, a subjective judgement. We believe that in a truly random situation, a sequence of 10 heads is not only possible, but would be expected to occur with the calculated probability, but if you see it on the street, you suspect a biased coin.

This is what I was getting at in post #19. We also have statistical tests for equivalence rather than difference. These too have that same limitations.

In practice, we mitigate the inconvenience of a subjective evaluations by increasing the n. Flip that coin a billion times and if you get a billion heads, we conclude, with greater confidence that if we flipped it 10 times, that it can't be true coin. Of course, theoretically, it could be a true coin, but you would get very little argument that it is a true coin.

My point (which I made in post #7) is that, no test will prove that a process is random. I don't think that you would disagree. In practice, then, the evaluation of a PRNG involves a suite of tests, some of them are listed in the aforementioned old article http://www.drdobbs.com/testing-random-number-generators/184403185. The Die Hard suite https://en.wikipedia.org/wiki/Diehard_tests is a common one, but I think math nerds have a bunch of them, e.g., https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-22r1a.pdf

Can we agree that for any PRNG "we" come up with, we would have to evaluate it using a suite of tests and compare "our" PRNG with how it compares to others against such a metric? Because, rightly or wrongly, that it where I see the current state-of-the-art, not withstanding credible arguments that one can be "better" than another for specific purposes.
 

nsaspook

Joined Aug 27, 2009
16,321
In discussions with a colleague, a specialist in quantum theory, I brought this up and he pointed about that chaos theory prevents this even in principle. The sensitivity to initial starting conditions means that even if the behavior of the system is, in fact, deterministic, there would not be enough particles in the universe to define the starting state accurately enough to prevent deviation of the model from the actual behavior after a finite time.

This idea, which is quite mainstream and demonstrable, suggests that whatever “deterministic” might mean, it’s not what people think.

Chaos and complexity, and the concomitant emergent behaviors, really make the idea of determinism fraught. Add in the problems of computability of certain even relatively simple systems and there doesn’t seem to be a hope for simulating reality... ...at least not from inside it since we don’t have enough bits to simulation the underlying simulation... ;)
Yes, I was taught the same thing long ago.

While I agree in principle, the fall back to chaos as a layer on top of determinism for pseudo-randomness is a cop-out to saying it's not possible the way WE (no “God’s-eye view”) currently understand the universe today.;) With actual randomness it doesn't matter what size the universe is or the number of particles in it.

https://www.americanscientist.org/article/quantum-randomness
 
Last edited:

Ya’akov

Joined Jan 27, 2019
10,235
Yes, I was taught the same thing long ago.

While I agree in principle, the fall back to chaos as a layer on top of determinism for pseudo-randomness is a cop-out to saying it's not possible the way WE (no “God’s-eye view”) currently understand the universe today.;) With actual randomness it doesn't matter what size the universe is or the number of particles in it.
I guess I am saying that randomness isn't the opposite of determinism. In the classical world, the chaos and complexity create an uncertainty which is not the same as mathematical randomness but has the same epistemic effect the further from time 0 we go.

In general, time (and space) and so anything that relies on motion, which for humans is everything we can ever know, fades into obscurity the further away in time or space, or the more precision we demand. It is not "random" in the sense that nuclear decay or other quantum events are, but it is as unknowable, and even Newtonian systems become uncomputable very quickly.

Conflating mathematical randomness with the essential unpredictability of sufficiently complex or chaotic systems can lead to confused arguments. For me, most times I hear people talk about "determinism", they are actually talking about predictability which is not possible for anything that exceeds a relatively local scope, and is certainly not possible for the universe as a whole due to that problem of no possible representation.
 
Here is one project idea that is relevant to the thread and that I have had on the never-ending list of projects for a long time.

Many years ago, I saw a column by Forest Mims where he used two legs of a three leg bipolar transistor to generate noise - a nice cheap white noise machine, I thought and I had fun building it and playing with it. I am not saying that he discovered the property.

The technique has found its way into many PRNG and you can see many such circuits (in fact I linked one into an earlier thread). So, what I thought is:

Using a MINIMUM number of components, use such a noise generator as the voltage source to be read by an A to D that would seed or be used directly to form the pseudorandom value. This is, again, not a new idea, but I have never seen a minimalist implementation, as I would define minimalist.

So, take the circuit here https://makezine.com/projects/really-really-random-number-generator/

Could we, construct a simple version, maybe clipping the output with a zener (used as intended and not the noise source) to be a constant input to a PIC A2D. Either an A2D on a large pic just to provide a PRN when needed, or as a stand-alone unit, say with a pic10f300 series (I think those are the cheapest with an A2D and associated code to deliver, on-demand, a "better" PRN?

I would want it to use a minimal number of components and operate on 5V or 3.3V. I mention clipping the output with the idea that you might not get full range output but you could "clip" the width of the A2D in a commensurate fashion.

You could use this to seed a "shift-register" PRNG like what I posted in #25. Of course, if it works well as a seed, why bother to use a seed, just use the number.

I wonder if it would be susceptible to heat in a detectable way, PRNG-wise?
 

Thread Starter

Wendy

Joined Mar 24, 2008
23,798
There was a reason I left chaos out of my discussions. Say what you will I believe randomness exists and can be darn useful if you can make it, If true AI (I call it synthetic intelligence)is ever created I suspect a good random function will be needed some where.

While I am not the sharpest pin in the cushion I do like hanging out with folks smarter than me in the hopes some of it will rub off. AAC is a good place for this.
 

WBahn

Joined Mar 31, 2012
32,823
About coin flips, Richard Feynman used to demonstrate in his lectures how the result was decidedly non-random. In theory, yes. In practice, no.

I tried, but couldn't find a You Tube of it. He was a very good coin flipper and bongo player.
A human can learn how to flip a coin so that it usually comes out the way they want it to. But all that means is that it's not a "fair coin toss". That would also be true if there is an inadvertent bias introduced by a human coin tosser (or whatever is tossing the coin). Then there's always the question of the coin itself -- since a real coin has different impressions on front and back, does that impact the outcome in any measurable way?
 

nsaspook

Joined Aug 27, 2009
16,321
I guess I am saying that randomness isn't the opposite of determinism. In the classical world, the chaos and complexity create an uncertainty which is not the same as mathematical randomness but has the same epistemic effect the anything that relies on motion, which for humans is everything we can ever know,
This one reason I question the 'particle' limit to computation. In the string framework there are 10 to the 500 power of possible universes where only one is ours. Is it possible to use the same type of complexity in freedom of movement to compute classical existence to a degree that matches human perception?
 

Ya’akov

Joined Jan 27, 2019
10,235
x
This one reason I question the 'particle' limit to computation. In the string framework there are 10 to the 500 power of possible universes where only one is ours. Is it possible to use the same type of complexity in freedom of movement to compute classical existence to a degree that matches human perception?
In the end, I don't expect reality is very compressible. I don't really know if we'll find a clever way to avoid the limit but people who know a lot more than me seemed quite convinced there was a hard limit and that even a small part of the world exceeds it.

I'll never know, that's about all I am certain of...
 

bogosort

Joined Sep 24, 2011
696
Then it's just a matter of processing power to convert a completely deterministic universe to superdeterminism when we "know" exactly where each particle of the universe will be at any given moment in the future, or was in the past, or will ever be. The conspiratorial part is the loss of 'free will' to change or control what happens because we are set pieces moving in time.
You're conflating philosophical determinism (no free will) with Bell's theoretical loophole (superdeterminism), but the two are entirely different.

Bell's theorem shows that the universe is fundamentally non-classical. The two big classical ideas are that the universe has physical realism -- i.e., the universe has objective properties that are independent of observation -- and locality (no "spooky action at a distance"). Using a thought experiment, Bell found a set of inequalities that any realistic and local model must obey; specifically, he found the upper bound on correlations between measurements. He then showed that quantum correlations exceed this upper bound, thus demonstrating that the universe cannot be classical: you either must give up physical realism, locality, or both.

But Bell though of one more possibility, a loophole that could provide the same correlation results yet not require a non-classical universe. In his thought experiment, he used two scientists acting independently to perform the measurements. Implicit in this, he assumed that they were able to prepare their experiments independently and with randomly chosen initial parameters. Bell acknowledged that if this assumption were false -- i.e., if each scientist unwittingly prepared their experiments in exactly the right way so as to create the "unexpected" bound-exceeding correlations -- then the universe might well be classical. But, assuming that each scientist used a different "random" seed for their parameters (one used an arbitrary sequence from PI, the other counted ticks from a Geiger counter), this would require that the universe had somehow planted the necessary "random values" into the digits of PI and the decay rate of the exact substance at hand for the scientist. And if this experiment were repeated, using a different source of "randomness", these new sources, too, would have been prepared before hand, presumably at the Big Bang.

Bell called this notion Superdeterminism, and did not think it was a credible line of thought. Indeed, actual physicists have performed Bell's experiment several times -- years apart, in different countries, using different types of detectors, etc. -- and they've all found Bell's inequalities to be violated in the same way. If superdeterminism were true, then the universe was designed from the very beginning to produce these exact results at exactly the time each of the experiments was performed. This is a much stronger statement than "the scientists had no free will", as in the latter case, regardless of the causal influences that guided the scientists choices, after a number of experiments we would expect the actual correlations to come through.

In other words, superdeterminism is the very specific idea that the universe has conspired to fool scientists performing Bell's experiment into believing that correlations are not classical. While it's possible, I suppose, I wouldn't bet on it. ;)
 

bogosort

Joined Sep 24, 2011
696
Can we agree that for any PRNG "we" come up with, we would have to evaluate it using a suite of tests and compare "our" PRNG with how it compares to others against such a metric?
Absolutely. I was more commenting on the idea of randomness, which I find interesting, both philosophically and mathematically.
 

nsaspook

Joined Aug 27, 2009
16,321
You're conflating philosophical determinism (no free will) with Bell's theoretical loophole (superdeterminism), but the two are entirely different.

Bell's theorem shows that the universe is fundamentally non-classical. The two big classical ideas are that the universe has physical realism -- i.e., the universe has objective properties that are independent of observation -- and locality (no "spooky action at a distance"). Using a thought experiment, Bell found a set of inequalities that any realistic and local model must obey; specifically, he found the upper bound on correlations between measurements. He then showed that quantum correlations exceed this upper bound, thus demonstrating that the universe cannot be classical: you either must give up physical realism, locality, or both.

But Bell though of one more possibility, a loophole that could provide the same correlation results yet not require a non-classical universe. In his thought experiment, he used two scientists acting independently to perform the measurements. Implicit in this, he assumed that they were able to prepare their experiments independently and with randomly chosen initial parameters. Bell acknowledged that if this assumption were false -- i.e., if each scientist unwittingly prepared their experiments in exactly the right way so as to create the "unexpected" bound-exceeding correlations -- then the universe might well be classical. But, assuming that each scientist used a different "random" seed for their parameters (one used an arbitrary sequence from PI, the other counted ticks from a Geiger counter), this would require that the universe had somehow planted the necessary "random values" into the digits of PI and the decay rate of the exact substance at hand for the scientist. And if this experiment were repeated, using a different source of "randomness", these new sources, too, would have been prepared before hand, presumably at the Big Bang.

Bell called this notion Superdeterminism, and did not think it was a credible line of thought. Indeed, actual physicists have performed Bell's experiment several times -- years apart, in different countries, using different types of detectors, etc. -- and they've all found Bell's inequalities to be violated in the same way. If superdeterminism were true, then the universe was designed from the very beginning to produce these exact results at exactly the time each of the experiments was performed. This is a much stronger statement than "the scientists had no free will", as in the latter case, regardless of the causal influences that guided the scientists choices, after a number of experiments we would expect the actual correlations to come through.

In other words, superdeterminism is the very specific idea that the universe has conspired to fool scientists performing Bell's experiment into believing that correlations are not classical. While it's possible, I suppose, I wouldn't bet on it. ;)
IMO they both are philosophical and in the results compatible with each other.

I'm headed to Vagas so I will make a bet against superdeterminism at the gaming table.
 

bogosort

Joined Sep 24, 2011
696
IMO they both are philosophical and in the results compatible with each other.

I'm headed to Vagas so I will make a bet against superdeterminism at the gaming table.
Your trip to Vegas presents a fine illustration of the difference between determinism and superdeterminism. In the deterministic view, if you find yourself always throwing snake eyes at the craps table for dozens of throws, you'd conclude that the dice were loaded. In the superdeterministic view, you'd conclude that the dice were fine, rather the universe's creation had been specifically prepared such that, 14 billion years later, you'd walk to a craps table and experience an anomalous result.

They're not compatible views. Most scientists would say that the universe is causal and deterministic; I've never heard of anyone actually espousing superdeterminism. Quite so, as it is was not invented to be rational line of thought -- it was invented solely for the purpose of demonstrating a theoretical loophole.
 

nsaspook

Joined Aug 27, 2009
16,321
Your trip to Vegas presents a fine illustration of the difference between determinism and superdeterminism. In the deterministic view, if you find yourself always throwing snake eyes at the craps table for dozens of throws, you'd conclude that the dice were loaded. In the superdeterministic view, you'd conclude that the dice were fine, rather the universe's creation had been specifically prepared such that, 14 billion years later, you'd walk to a craps table and experience an anomalous result.

They're not compatible views. Most scientists would say that the universe is causal and deterministic; I've never heard of anyone actually espousing superdeterminism. Quite so, as it is was not invented to be rational line of thought -- it was invented solely for the purpose of demonstrating a theoretical loophole.
What happens next when the dice are loaded and the universe is against you?

Easy, ask the:
tc.jpg
for another drink.

"Alice laughed: "There's no use trying," she said; "one can't believe impossible things." "I daresay you haven't had much practice," said the Queen. "When I was younger, I always did it for half an hour a day. Why, sometimes I've believed as many as six impossible things before breakfast."

"From Alice and Wonderland" - Lewis Carroll
 
Last edited:

MrAl

Joined Jun 17, 2014
13,702
Hi,

Think about something truly random in 3 dimensions and then imagine an observer in the 4th Euclidean dimension watching. Is the process still random? Not necessarily.
If that is too difficult, then think of something in one dimension that is truly random and then imagine we look at it in 2 dimensions. Is it still random? Well one interesting example is the digits of pi. They pass every test for true randomness yet in two dimensions we know that pi is the ratio of the circumference of a circle to its diameter. So in one respect the digits are random, yet when we think about it in another way it's perfect and can only be one way.

So pi is an interesting number where if you wanted to you could pick a starting point and just keep reading off the digits from a table.
You could also look up how they test billions of digits for randomness.

One test that i've used in the past that i remember is the mean. The mean of an infinite number of samples of a true random variable is 1/2 of the sum of the two extremes (given every number between is generated also). So if you generate numbers 3, 4, and 5, the mean is 4 so after an infinite number of generations you better get 4 exactly. If you do get 4, you passed one test. If you DONT get 4, then you dont have a true random number generator.
Now to be practical, we can only generate a finite number of samples. So the next idea is that the more samples you generate, the closer the mean comes out to the average of all the individual numbers, namely 4 in the above example.
Of course a pseudo RNG that generates all 4's or just 3's and 5's will also come up the same, so you have to be sure that isnt happening too.
This leads to other tests which you should really look into.
If i remember right, mathematicians use a minimum of 10 billion samples for any test. If could be more now though.
 
Top