Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Simulating the rolling of dices to produce truly random numbers?

80 views
Skip to first unread message

Mr. Man-wai Chang

unread,
Jan 10, 2018, 10:50:37 AM1/10/18
to

Is it possible? Any existing algorithms or published papers?

--
@~@ Remain silent! Drink, Blink, Stretch! Live long and prosper!!
/ v \ Simplicity is Beauty!
/( _ )\ May the Force and farces be with you!
^ ^ (x86_64 Ubuntu 9.10) Linux 2.6.39.3
不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa

Malcolm McLean

unread,
Jan 10, 2018, 11:33:29 AM1/10/18
to
On Wednesday, January 10, 2018 at 3:50:37 PM UTC, Mr. Man-wai Chang wrote:
> Is it possible? Any existing algorithms or published papers?
>
Yes and no.

It's easy enough to simulate a cube bouncing on a solid surface, the problem
is to give it enough chaos to pass muster as a die.

Robert Wessel

unread,
Jan 10, 2018, 11:52:41 AM1/10/18
to
On Wed, 10 Jan 2018 23:50:19 +0800, "Mr. Man-wai Chang"
<toylet...@gmail.com> wrote:

>
>Is it possible? Any existing algorithms or published papers?


If it's done in a deterministic fashion, then no, it won't be any more
"truly" random than any other PRNG.

If you have a source of non-deterministic input, there are certainly
better ways to turn that into proper true random output ("whitening").

Mr. Man-wai Chang

unread,
Jan 10, 2018, 11:55:34 AM1/10/18
to
We possibly could not randomize the first contact point between the box
and the surface? :)

Mr. Man-wai Chang

unread,
Jan 10, 2018, 11:55:37 AM1/10/18
to
On 11/1/2018 00:52, Robert Wessel wrote:
>
> If it's done in a deterministic fashion, then no, it won't be any more
> "truly" random than any other PRNG.
>
> If you have a source of non-deterministic input, there are certainly
> better ways to turn that into proper true random output ("whitening").

We possibly could not randomize the first contact point between the box
and the surface? :)

Robert Wessel

unread,
Jan 10, 2018, 11:56:05 AM1/10/18
to
Or you could use real dice:

http://gamesbyemail.com/news/diceomatic

One of my favorite pieces of over-engineering. Be sure to watch the
video.

Mr. Man-wai Chang

unread,
Jan 10, 2018, 11:58:18 AM1/10/18
to
On 11/1/2018 00:55, Robert Wessel wrote:
>
> Or you could use real dice:
>
> http://gamesbyemail.com/news/diceomatic
>
> One of my favorite pieces of over-engineering. Be sure to watch the
> video.
>

Could you shrink the whole thing into the size of a capacitor, and make
it accessible by electronics? :)

Rick C. Hodgin

unread,
Jan 10, 2018, 11:58:21 AM1/10/18
to
On Wednesday, January 10, 2018 at 10:50:37 AM UTC-5, Mr. Man-wai Chang wrote:
> Is it possible? Any existing algorithms or published papers?

VIA C7 and later CPUs have an on-die random number generator as part
of their crypto engine. You can setup an inexpensive C7 machine on
your network and have it generate truly random numbers for you by
remote procedure call all day long.

--
Rick C. Hodgin

Mr. Man-wai Chang

unread,
Jan 10, 2018, 11:59:23 AM1/10/18
to
I found people selling USB devices in Amazon claimed to generate good
random numbers...

Robert Wessel

unread,
Jan 10, 2018, 11:59:34 AM1/10/18
to
On Thu, 11 Jan 2018 00:55:29 +0800, "Mr. Man-wai Chang"
<toylet...@gmail.com> wrote:

>On 11/1/2018 00:52, Robert Wessel wrote:
>>
>> If it's done in a deterministic fashion, then no, it won't be any more
>> "truly" random than any other PRNG.
>>
>> If you have a source of non-deterministic input, there are certainly
>> better ways to turn that into proper true random output ("whitening").
>
>We possibly could not randomize the first contact point between the box
>and the surface? :)


Again, if you do it deterministically, you've not created true
randomness. If you have a way of doing non-deterministically, which
means you have a non-deterministic input to your system, just start
from there, and don't go through the silly exercise of simulating the
physical motion of dice.

IOW, you can't create real random dice rolls unless you have an actual
source of true randomness to input to your dice simulation algorithm.

Mr. Man-wai Chang

unread,
Jan 10, 2018, 12:00:52 PM1/10/18
to
On 11/1/2018 00:59, Robert Wessel wrote:
>
> Again, if you do it deterministically, you've not created true
> randomness. If you have a way of doing non-deterministically, which
> means you have a non-deterministic input to your system, just start
> from there, and don't go through the silly exercise of simulating the
> physical motion of dice.
>
> IOW, you can't create real random dice rolls unless you have an actual
> source of true randomness to input to your dice simulation algorithm.

So there is mechanics that could never be modeled using mathematics and
computers?

Robert Wessel

unread,
Jan 10, 2018, 12:07:53 PM1/10/18
to
On Thu, 11 Jan 2018 00:59:14 +0800, "Mr. Man-wai Chang"
<toylet...@gmail.com> wrote:

>On 11/1/2018 00:58, Rick C. Hodgin wrote:
>> On Wednesday, January 10, 2018 at 10:50:37 AM UTC-5, Mr. Man-wai Chang wrote:
>>> Is it possible? Any existing algorithms or published papers?
>>
>> VIA C7 and later CPUs have an on-die random number generator as part
>> of their crypto engine. You can setup an inexpensive C7 machine on
>> your network and have it generate truly random numbers for you by
>> remote procedure call all day long.
>
>I found people selling USB devices in Amazon claimed to generate good
>random numbers...


Tread carefully. The problem is that proper random output is really
hard to verify. Building a device that appears to emit random bits,
and passes any black-box test for randomness, but actually is fully
deterministic, is easy. Building a device that actually produces good
quality true random bits reliably is rather harder. And as I said,
you pretty much can't tell the different from the outside.

Most recent Intel CPUs include the RDRAND facility, although there is
some controversy about the whitening procedure they use. That being
said it's perfectly reasonable to use RDRAND as one of several inputs
into an entropy pool, even if you don't trust Intel.

Malcolm McLean

unread,
Jan 10, 2018, 12:15:23 PM1/10/18
to
On Wednesday, January 10, 2018 at 5:00:52 PM UTC, Mr. Man-wai Chang wrote:
>
> So there is mechanics that could never be modeled using mathematics and
> computers?
>
Basically, the flow of fluids. You can model them by making an arbitrarily
fine lattice, but you can never describe the behaviour perfectly, and
small errors accumulate, leading to big changes in results after a few
steps, depending on your approximations.

Mr. Man-wai Chang

unread,
Jan 10, 2018, 12:15:28 PM1/10/18
to
On 11/1/2018 01:07, Robert Wessel wrote:
> Tread carefully. The problem is that proper random output is really
> hard to verify. Building a device that appears to emit random bits,
> and passes any black-box test for randomness, but actually is fully
> deterministic, is easy. Building a device that actually produces good
> quality true random bits reliably is rather harder. And as I said,
> you pretty much can't tell the different from the outside.

Is there mathematics to prove that something is 100% random? I supposed
most mathematics are NOT random, otherwise, the results would not be
reproducable .... :)

Robert Wessel

unread,
Jan 10, 2018, 12:16:27 PM1/10/18
to
On Thu, 11 Jan 2018 01:00:42 +0800, "Mr. Man-wai Chang"
<toylet...@gmail.com> wrote:

>On 11/1/2018 00:59, Robert Wessel wrote:
>>
>> Again, if you do it deterministically, you've not created true
>> randomness. If you have a way of doing non-deterministically, which
>> means you have a non-deterministic input to your system, just start
>> from there, and don't go through the silly exercise of simulating the
>> physical motion of dice.
>>
>> IOW, you can't create real random dice rolls unless you have an actual
>> source of true randomness to input to your dice simulation algorithm.
>
>So there is mechanics that could never be modeled using mathematics and
>computers?


According to most interpretations of Quantum Mechanics, there are
phenomenon that are objectively unpredictable. For example, there is
no apparent way, and if QM is correct, no possible way, to determine
when an unstable atomic nucleus will decay, not matter how much
information we have about that nucleus before hand. We can make
*statistical* statements about such things (eg. half of all carbon-14
atoms in a lump of coal will decay in 5700 years), but the individual
events are not predictable (there's no telling when a particular
carbon-14 will decay).

Joe Pfeiffer

unread,
Jan 10, 2018, 12:20:41 PM1/10/18
to
"Mr. Man-wai Chang" <toylet...@gmail.com> writes:

> Is it possible? Any existing algorithms or published papers?

There are a zillion ways to generate truly random numbers, all based on
somehow reading a suitably random input -- no need to simulate dice.

To use a simulation of dice to get random numbers, you'd need to have a
source of random numbers available to you, to perturb the the behavior
of the dice. So you'd be using a (relatively) much more efficient
source of randomness to drive a really inefficient source.

Mr. Man-wai Chang

unread,
Jan 10, 2018, 12:22:44 PM1/10/18
to
On 11/1/2018 01:20, Joe Pfeiffer wrote:
> There are a zillion ways to generate truly random numbers, all based on
> somehow reading a suitably random input -- no need to simulate dice.
>
> To use a simulation of dice to get random numbers, you'd need to have a
> source of random numbers available to you, to perturb the the behavior
> of the dice. So you'd be using a (relatively) much more efficient
> source of randomness to drive a really inefficient source.

Are you saying that dices are NOT random enough?

(I remember Mr. Einstein's statement: "God does not play dice" :)

Robert Wessel

unread,
Jan 10, 2018, 12:25:46 PM1/10/18
to
On Thu, 11 Jan 2018 01:15:18 +0800, "Mr. Man-wai Chang"
<toylet...@gmail.com> wrote:

>On 11/1/2018 01:07, Robert Wessel wrote:
>> Tread carefully. The problem is that proper random output is really
>> hard to verify. Building a device that appears to emit random bits,
>> and passes any black-box test for randomness, but actually is fully
>> deterministic, is easy. Building a device that actually produces good
>> quality true random bits reliably is rather harder. And as I said,
>> you pretty much can't tell the different from the outside.
>
>Is there mathematics to prove that something is 100% random? I supposed
>most mathematics are NOT random, otherwise, the results would not be
>reproducable .... :)


No, there is not. In at least some philosophical sense, the notion
that you can take a string of bits and say that they're random is
absurd. By definition, once you've generated the bits, they're no
longer random.

There are tests for "randomness" that people regularly do. Perhaps
the most famous is the suite of tests known as "Diehard", although
it's rather outdated now. The problem is that these just look for
some statistical measure of things "looking*" random, they can't
really test for actual randomness. For example, it is perfectly
plausible for a series of fair coins flips to generate 100 heads in a
row (in fact it's exactly as likely as any other particular sequence
of 100 coin flips). Things like Diehard will almost always flag that
result as having "bad" randomness.


*Yeah, and we don't really know what that means, and in practice turns
out to be a bunch of heuristics with little solid justification.

Rick C. Hodgin

unread,
Jan 10, 2018, 12:27:27 PM1/10/18
to
On Wednesday, January 10, 2018 at 12:15:28 PM UTC-5, Mr. Man-wai Chang wrote:
> On 11/1/2018 01:07, Robert Wessel wrote:
> > Tread carefully. The problem is that proper random output is really
> > hard to verify. Building a device that appears to emit random bits,
> > and passes any black-box test for randomness, but actually is fully
> > deterministic, is easy. Building a device that actually produces good
> > quality true random bits reliably is rather harder. And as I said,
> > you pretty much can't tell the different from the outside.
>
> Is there mathematics to prove that something is 100% random? I supposed
> most mathematics are NOT random, otherwise, the results would not be
> reproducable .... :)

I wrote an article on Geek.com years ago about a Tong Fang notebook,
and it allowed either an Intel Celeron-M or VIA C7-M. The VIA C7-M
also had a random number generator and I tested it when I was testing
the notebook.

When the CPU was cold (below about 40C) it was distributed evenly on
many millions of repeated runs. When it began to heat up it had a
propensity toward generating values closer to 0 and 255 per byte:

https://www.geek.com/blurb/vias-c7-m-powered-tongfang-notebook-560893/

The contact I had for VIA Technologies at the time (Van Smith) told
me that in order be statistically random it shouldn't matter if there
is a propensity toward specific values, as long as it's truly un-
predictable.

I disagreed with him, but he has a math degree and I don't. :-) I
think he was trying to make the company he worked for look good in
light of some 0-leaning and 255-leaning 8-bit "randomly generated"
values.

It was an impressive thing to see when it was cold, however. It
was nearly perfectly distributed over 10s of millions of samples.

I still have the notebook. And it still has the C7-M in it. My
wife used it running Ubuntu 7.04 for about a year back in the
late 2000s.

--
Rick C. Hodgin

Robert Wessel

unread,
Jan 10, 2018, 12:32:33 PM1/10/18
to
On Thu, 11 Jan 2018 01:22:35 +0800, "Mr. Man-wai Chang"
<toylet...@gmail.com> wrote:

>On 11/1/2018 01:20, Joe Pfeiffer wrote:
>> There are a zillion ways to generate truly random numbers, all based on
>> somehow reading a suitably random input -- no need to simulate dice.
>>
>> To use a simulation of dice to get random numbers, you'd need to have a
>> source of random numbers available to you, to perturb the the behavior
>> of the dice. So you'd be using a (relatively) much more efficient
>> source of randomness to drive a really inefficient source.
>
>Are you saying that dices are NOT random enough?
>
>(I remember Mr. Einstein's statement: "God does not play dice" :)


While was Einstein rejecting quantum mechanics with that statement,
the broad consensus is that he was seriously wrong. QM (in its modern
form) is considered a massively solid theory, backed by masses of
evidence, and tons of tested and verified theoretical predictions. And
everyone fully understands that is also incomplete, and in conflict
with relativity's understanding of gravity (and relativity also has
massive support). Which is why the search for the so-called
"Theory-of-Everything", is such a thing...

Joe Pfeiffer

unread,
Jan 10, 2018, 12:38:19 PM1/10/18
to
"Mr. Man-wai Chang" <toylet...@gmail.com> writes:

> On 11/1/2018 01:20, Joe Pfeiffer wrote:
>> There are a zillion ways to generate truly random numbers, all based on
>> somehow reading a suitably random input -- no need to simulate dice.
>>
>> To use a simulation of dice to get random numbers, you'd need to have a
>> source of random numbers available to you, to perturb the the behavior
>> of the dice. So you'd be using a (relatively) much more efficient
>> source of randomness to drive a really inefficient source.
>
> Are you saying that dices are NOT random enough?
>
> (I remember Mr. Einstein's statement: "God does not play dice" :)

Dice are plenty random enough -- you're talking about simulating them.
A *simulation* of dice won't be random enough unless you put randomness
into it.

Mr. Man-wai Chang

unread,
Jan 10, 2018, 12:43:42 PM1/10/18
to
On 11/1/2018 01:27, Rick C. Hodgin wrote:
> I wrote an article on Geek.com years ago about a Tong Fang notebook,
> and it allowed either an Intel Celeron-M or VIA C7-M. The VIA C7-M
> also had a random number generator and I tested it when I was testing
> the notebook.
>
> When the CPU was cold (below about 40C) it was distributed evenly on
> many millions of repeated runs. When it began to heat up it had a
> propensity toward generating values closer to 0 and 255 per byte:
> ....
> I still have the notebook. And it still has the C7-M in it. My
> wife used it running Ubuntu 7.04 for about a year back in the
> late 2000s.

Interesting observation... thanks for talking about it.

Mr. Man-wai Chang

unread,
Jan 10, 2018, 12:46:08 PM1/10/18
to
On 11/1/2018 01:25, Robert Wessel wrote:
>
> No, there is not. In at least some philosophical sense, the notion
> that you can take a string of bits and say that they're random is
> absurd. By definition, once you've generated the bits, they're no
> longer random.
>
> There are tests for "randomness" that people regularly do. Perhaps
> the most famous is the suite of tests known as "Diehard", although
> it's rather outdated now. The problem is that these just look for
> some statistical measure of things "looking*" random, they can't
>....
> *Yeah, and we don't really know what that means, and in practice turns
> out to be a bunch of heuristics with little solid justification.

The only way to prove something being random is to analyze its outcomes
using statistics, I believe. And hence Big Data?

Mr. Man-wai Chang

unread,
Jan 10, 2018, 12:49:03 PM1/10/18
to
On 11/1/2018 01:38, Joe Pfeiffer wrote:
>
> Dice are plenty random enough -- you're talking about simulating them.
> A *simulation* of dice won't be random enough unless you put randomness
> into it.

Could I say the same to quantum mechanics and its implementations? :)

Jerry Stuckle

unread,
Jan 10, 2018, 1:00:35 PM1/10/18
to
There are true random number generators in hardware. They use the noise
generated by a forward-biased diode as a generator. This noise is truly
random and the circuitry is simple and cheap.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstu...@attglobal.net
==================

Richard Heathfield

unread,
Jan 10, 2018, 1:15:21 PM1/10/18
to
On 10/01/18 17:32, Robert Wessel wrote:

<snip>

> QM (in its modern form) is considered a massively
> solid theory, backed by masses of
> evidence[... It] is also incomplete, and in conflict
> with relativity's understanding of gravity [...].
> Which is why the search for the so-called
> "Theory-of-Everything", is such a thing...

I suppose it's almost too obvious to mention, especially as there are so
many great minds involved in the search --- but has anyone looked behind
the settee?

--
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

Scott Lurndal

unread,
Jan 10, 2018, 1:20:29 PM1/10/18
to
Joe Pfeiffer <pfei...@cs.nmsu.edu> writes:
>"Mr. Man-wai Chang" <toylet...@gmail.com> writes:
>
>> Is it possible? Any existing algorithms or published papers?
>
>There are a zillion ways to generate truly random numbers, all based on
>somehow reading a suitably random input -- no need to simulate dice.

When I was at SGI, a couple of colleagues published a paper
on using a Lava Lamp as a source of randomness in a random
number generator.

https://en.wikipedia.org/wiki/Lavarand

Lew Pitcher

unread,
Jan 10, 2018, 1:23:24 PM1/10/18
to
Which the company "Cloudflair" uses today to generate random numbers for
encryption purposes

https://www.fastcodesign.com/90137157/the-hardest-working-office-design-in-
america-encrypts-your-data-with-lava-lamps
--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

Joe Pfeiffer

unread,
Jan 10, 2018, 1:43:49 PM1/10/18
to
"Mr. Man-wai Chang" <toylet...@gmail.com> writes:

> On 11/1/2018 01:38, Joe Pfeiffer wrote:
>>
>> Dice are plenty random enough -- you're talking about simulating them.
>> A *simulation* of dice won't be random enough unless you put randomness
>> into it.
>
> Could I say the same to quantum mechanics and its implementations? :)

Yes.

Robert Wessel

unread,
Jan 10, 2018, 1:49:06 PM1/10/18
to
On Thu, 11 Jan 2018 01:45:59 +0800, "Mr. Man-wai Chang"
<toylet...@gmail.com> wrote:

>On 11/1/2018 01:25, Robert Wessel wrote:
>>
>> No, there is not. In at least some philosophical sense, the notion
>> that you can take a string of bits and say that they're random is
>> absurd. By definition, once you've generated the bits, they're no
>> longer random.
>>
>> There are tests for "randomness" that people regularly do. Perhaps
>> the most famous is the suite of tests known as "Diehard", although
>> it's rather outdated now. The problem is that these just look for
>> some statistical measure of things "looking*" random, they can't
>>....
>> *Yeah, and we don't really know what that means, and in practice turns
>> out to be a bunch of heuristics with little solid justification.
>
>The only way to prove something being random is to analyze its outcomes
>using statistics, I believe. And hence Big Data?


Certainly nothing like that would ever constitute "proof". Nor would
any of those sorts of tests actually distinguish true randomness from
a decent PRNG.

Robert Wessel

unread,
Jan 10, 2018, 2:07:48 PM1/10/18
to
There are many sources of physical randomness (or entropy). Most of
them are, at least theoretically, fairly simple. Getting them to
operate reliably and verifiable in that mode is often far more
difficult. To use the example of junction noise, the production
depends considerable on the exact voltages, noise in the power supply,
temperature, and the exact doping of the individual device in
question. Fiddle with any of those and the amount of actual entropy
in the output can vary massively. And the detector's performance will
*also* be affected by those things.

There's a reason that most of the so-called "simple" generators
include adjustments. It's "simple" except that you have to fiddle
with the knobs (physical or otherwise) until you get the device
operating in a region where you're getting something like that looks
like random output. And don't turn on a big electrical load on the
same circuit, or let the room get hot, or you'll have to fiddle some
more.

So while the actual core generator is often pretty simple, getting
from there to reliable output that you can trust is quite a bit more
complex.

And essentially all physical entropy sources show heavy biases and
whatnot, and need considerable whitening before they can be used.

Robert Wessel

unread,
Jan 10, 2018, 2:10:07 PM1/10/18
to
On Wed, 10 Jan 2018 18:15:05 +0000, Richard Heathfield
<r...@cpax.org.uk> wrote:

>On 10/01/18 17:32, Robert Wessel wrote:
>
><snip>
>
>> QM (in its modern form) is considered a massively
>> solid theory, backed by masses of
>> evidence[... It] is also incomplete, and in conflict
>> with relativity's understanding of gravity [...].
>> Which is why the search for the so-called
>> "Theory-of-Everything", is such a thing...
>
>I suppose it's almost too obvious to mention, especially as there are so
>many great minds involved in the search --- but has anyone looked behind
>the settee?


Well, that would certainly be embarrassing...

I wonder if any of my socks are back there too?

Chris M. Thomasson

unread,
Jan 10, 2018, 3:30:14 PM1/10/18
to
On 1/10/2018 7:50 AM, Mr. Man-wai Chang wrote:
>
> Is it possible? Any existing algorithms or published papers?
>

Fwiw, you can take a look at some:

https://en.wikipedia.org/wiki/Hardware_random_number_generator

Perhaps: https://www.random.org as well...

David Brown

unread,
Jan 10, 2018, 4:07:27 PM1/10/18
to
On 10/01/18 17:58, Mr. Man-wai Chang wrote:
> On 11/1/2018 00:55, Robert Wessel wrote:
>>
>> Or you could use real dice:
>>
>> http://gamesbyemail.com/news/diceomatic
>>
>> One of my favorite pieces of over-engineering.  Be sure to watch the
>> video.
>>
>
> Could you shrink the whole thing into the size of a capacitor, and make
> it accessible by electronics? :)
>

Yes - get a high resolution g-sensor or micro-mechanical gyro, and use
the lowest few bits. There is always enough shaking (at least here on
earth) to give high entropy on them.

Mr. Man-wai Chang

unread,
Jan 10, 2018, 4:16:26 PM1/10/18
to
On 11/1/2018 02:23, Lew Pitcher wrote:
>>
>> When I was at SGI, a couple of colleagues published a paper
>> on using a Lava Lamp as a source of randomness in a random
>> number generator.
>
> Which the company "Cloudflair" uses today to generate random numbers for
> encryption purposes
>
> https://www.fastcodesign.com/90137157/the-hardest-working-office-design-in-
> america-encrypts-your-data-with-lava-lamps
>

Fixing the broken link by wrapping it with "<" and ">". OE issue.

<https://www.fastcodesign.com/90137157/the-hardest-working-office-design-in-america-encrypts-your-data-with-lava-lamps>

David Brown

unread,
Jan 10, 2018, 4:58:54 PM1/10/18
to
On 10/01/18 18:27, Rick C. Hodgin wrote:
> On Wednesday, January 10, 2018 at 12:15:28 PM UTC-5, Mr. Man-wai Chang wrote:
>> On 11/1/2018 01:07, Robert Wessel wrote:
>>> Tread carefully. The problem is that proper random output is really
>>> hard to verify. Building a device that appears to emit random bits,
>>> and passes any black-box test for randomness, but actually is fully
>>> deterministic, is easy. Building a device that actually produces good
>>> quality true random bits reliably is rather harder. And as I said,
>>> you pretty much can't tell the different from the outside.
>>
>> Is there mathematics to prove that something is 100% random? I supposed
>> most mathematics are NOT random, otherwise, the results would not be
>> reproducable .... :)
>
> I wrote an article on Geek.com years ago about a Tong Fang notebook,
> and it allowed either an Intel Celeron-M or VIA C7-M. The VIA C7-M
> also had a random number generator and I tested it when I was testing
> the notebook.
>
> When the CPU was cold (below about 40C) it was distributed evenly on
> many millions of repeated runs. When it began to heat up it had a
> propensity toward generating values closer to 0 and 255 per byte:
>
> https://www.geek.com/blurb/vias-c7-m-powered-tongfang-notebook-560893/
>
> The contact I had for VIA Technologies at the time (Van Smith) told
> me that in order be statistically random it shouldn't matter if there
> is a propensity toward specific values, as long as it's truly un-
> predictable.
>

He is right. The mathematics of random numbers is difficult, and I
don't pretend to understand much of it (even though I /do/ have a maths
degree). But basically there are two interesting points about a random
sequence - the distribution of the values, and the non-determinism of
the sequence.

What you were seeing here is that at higher temperatures, the random
number generator no longer has a nice flat distribution - some numbers
turn up more often than others when you look at a large number of
samples. This is something that is easy to check, and it is easy to
think that the numbers are no longer "as random". It is true that they
will have less entropy - you no longer have close to 8 bits of entropy
in your 8-bit numbers. But it is very simple to deal with this - you
can combine multiple samples in a way that linearises the distribution.
A simple method is to use a good hashing function. It does not have to
be a "cryptographically secure" hashing function - even a simple CRC
will do.

To try this, repeat your tests on a hot Via C7 but instead of plotting
the results of each 8-bit generated random number, take 8 samples and
pass them through an 8-bit CRC function - then use /that/ as your random
number for plotting. You'll find it very close to linear.


What is much more important is the non-determinism of the sequence. It
is easy to make pseudo-random number generators that have linear
distributions - it is a lot harder to make one with good entropy in the
sequence. (It is easy to have a fake dice that rolls as many 1's as it
does 6's - it is much harder to make one that will give 11111 roughly
every 7776 sets of 5 rolls, and similarly for any length of sequence.)
That is the key benefit of physical random number generators like the
one in processors like this, which typically measure thermal noise over
a resistor or a diode. That is your source of true entropy - you then
use it as a seed for a pseudo random number generator that gives you a
quick and easy sequence with a good distribution.

Chris M. Thomasson

unread,
Jan 10, 2018, 5:18:14 PM1/10/18
to
Fwiw and imvho, here is a fairly handy tool that performs some tests
against an RNG binary:

http://www.fourmilab.ch/random

Chi square is nice, along with Monte Carlo pi, Arithmetic mean, ect...

[...]

Ben Bacarisse

unread,
Jan 10, 2018, 6:16:54 PM1/10/18
to
Even some very simple mechanical systems exhibit unmanageable
sensitivity to initial conditions, for example,. a double pendulum:

https://www.youtube.com/watch?v=U39RMUzCjiU (tech. version)

https://www.youtube.com/watch?v=mZ1hF_-cubA (cool version!)

--
Ben.

Alexander Huszagh

unread,
Jan 10, 2018, 10:20:04 PM1/10/18
to
On Wednesday, January 10, 2018 at 7:50:37 AM UTC-8, Mr. Man-wai Chang wrote:
> Is it possible? Any existing algorithms or published papers?
>
> --
> @~@ Remain silent! Drink, Blink, Stretch! Live long and prosper!!
> / v \ Simplicity is Beauty!
> /( _ )\ May the Force and farces be with you!
> ^ ^ (x86_64 Ubuntu 9.10) Linux 2.6.39.3
> 不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
> http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa

If you want a truly random number generator, just use your system's CSPRNG. Use `/dev/urandom` on Unix-like systems (except OpenBSD), `CryptGenRandom` on Windows, and `getentropy` on OpenBSD. This should be a cryptographically-secure random number generator, which would be the best PRNG (a CSPRNG) available. You can do a lot of exotic ways to read data from a truly random external source (like a lava lamp), but why do that when you probably just want your system's CSPRNG?

Chad

unread,
Jan 11, 2018, 5:53:14 AM1/11/18
to
I thought a random number generator, which is a uniform probability distribution, could be made more random via the central limit theorem.

Richard Damon

unread,
Jan 11, 2018, 7:48:06 AM1/11/18
to
On 1/11/18 5:52 AM, Chad wrote:
> I thought a random number generator, which is a uniform probability distribution, could be made more random via the central limit theorem.
>

The Gaussian/Normal distribution isn't really 'more random' than a
uniform distribution. (It somewhat depends also on your definition of
'Random' is)

What is true is that in the physical world, most 'random' sources are
actually made up of a large number of mostly independent random events,
which by the Central Limit Theorem, says they will appear to have a
Gaussian distribution, so if you want to model such noise sources, you
want a Gaussian random number generator, not a uniform probability
generator.

Jerry Stuckle

unread,
Jan 11, 2018, 12:48:09 PM1/11/18
to
That depends entirely on the design of the system, but as the noise is
generated by quantum effects, it is by definition random.

Of course you need to be able to do some adjusting on the circuitry.
You need to ensure you are getting sufficient noise pulses within the
time you want to make it random. If you're only getting 100 pulses
every second, you're not going to get a 32 bit random number.

The best generators are designed to overflow multiple times during the
sample time - the more the better. And they usually have multiple noise
sources - for instance. if you want a 32 bit random number they might
have four 8-bit counters, each fed by its own generator and each can
roll over thousands of times during the sample period. The result is a
32 bit random number with flat distribution.

And for faster sampling they might have 32 generators, each driving a
single flip-flop and flipping one bit on a noise pulse. More circuitry
but still very simple.
0 new messages