From: Johannes Baagoe on
VK :

> On the matter of Math.random "randomness" vs. custom algorithms I
> would suggest the regular way of using Shannon's Clairvoyant. In
> the professional cryptography it is used to determine if the testing
> matter truly random or pseudo-random, given that the tester is truly
> random (based on pre-recorded physical process results).

Is it, now? You surprise me. I would have expected *much* more
sophisticated criteria.

Anyway, my PRNGs do not aim at cryptological security at all, only
at statistical randomness. It doesn't matter that their outputs can
be predicted. It matters very much that successive numbers have good
equidistribution properties up to some preferably high dimension.

> In your case you might make two clairvoyants: one based on the native
> Math.random, the other on some custom pseudo-random algorithm. Now let
> them play 1/0 (even/off, true/false) game to each other. Statistically
> 10,000 rounds with 10,000 moves in each round would suffice for an
> educated guess

I don't think so. I test about 10^35 numbers before I give a tentative
seal of approval, and about 10^38 before I become as satisfied as I am
likely ever to be. (It usually takes much less to *fail* a generator,
but it still takes more than 10^5 unless it is uncommonly bad.)

> and it will take lesser than a minute for them to play - of course
> setTimeout breaks will be needed.

Of course.

> If both are equally good then 50/50 wins +/-5%

What does that mean?

> Above 5% difference would suggest that one algorithm is better pseudo-
> random than the other.

Not really, if you act on that suggestion, you would be wrong once
in ten tests on the average. Odds are better than even that you would
be wrong at least once after only seven tests.

> The actual difference will show how much better it is so if it worth
> to abandon the native method for the custom one.

Again, no, it is not that easy. To get at least started on the subject,
try http://www.iro.umontreal.ca/~lecuyer/myftp/papers/testu01.pdf

--
Johannes
From: Johannes Baagoe on
VK :
> Johannes Baagoe :
>> VK :

>>> On the matter of Math.random "randomness" vs. custom algorithms I
>>> would suggest the regular way of using Shannon's Clairvoyant.

[...]

>> it is not that easy. To get at least started on the subject,
>> try http://www.iro.umontreal.ca/~lecuyer/myftp/papers/testu01.pdf

> It is irrelevant to the testing way I am talking about

It is, however, very relevant to that I am talking about.

> (and way more complex with way lesser reliability).

I'm sure Professor L'Ecuyer will be thrilled :)

Look - I won't loose much time on this, if for no other reason,
then because it is OT with the respect to javascript.

But you are utterly and preposterously wrong, on randomness, on
statistical tests and on cryptology. I advice the acquisition of a
minimal familiarity with the basic literature on the subjects if you
want to be taken seriously.

--
Johannes
From: Stefan Weiss on
On 19/04/10 15:02, VK wrote:
> On Apr 17, 6:35 am, Johannes Baagoe <baa...(a)baagoe.com> wrote:
>> I'm not sure of that, because I have no idea of how they generate their
>> random numbers. That is precisely the problem - one does not know.
>
> On the matter of Math.random "randomness" vs. custom algorithms I
> would suggest the regular way of using Shannon's Clairvoyant. In the
> professional cryptography it is used to determine if the testing
> matter truly random or pseudo-random, given that the tester is truly
> random (based on pre-recorded physical process results).

I couldn't find any mention of "Shannon's Clairvoyant" using Google (the
only results I got were other postings by you). There's a clairvoyant
algorithm for the placement of cache pages, and there are various
"Shannon" algorithms for binary search and data compression. Where could
I find a description of "Shannon's Clairvoyant" online?


--
stefan
From: VK on
On Apr 19, 9:28 pm, Johannes Baagoe <baa...(a)baagoe.com> wrote:
> Look - I won't loose much time on this, if for no other reason,
> then because it is OT with the respect to javascript.

ACK

> But you are utterly and preposterously wrong, on randomness, on
> statistical tests and on cryptology.

There is a very easy way to prove me wrong or right. Just use the
proposed test and compare the results with the "proper academical
approach" results. I'll post the test page and then invite you. Yours
to decide then if you want it or not.

P.S. A funny OT fact: you, Prof. L'Ecuyer or any human - unless drunk
and under drugs - are guaranteed to lose on 1,000 move party to the
Shannon's Clairvoyant. I accepting bets 1000:1 ($1000 of mine on each
$1 of yours). If Prof. L'Ecuyer knows the immediate explanation of
that (I do) then he might knows something on the randomness topic. If
you communicate with him, you may run this quick check.

From: Johannes Baagoe on
VK :

> There is a very easy way to prove me wrong or right. Just use the
> proposed test and compare the results with the "proper academical
> approach" results. I'll post the test page and then invite you. Yours
> to decide then if you want it or not.

OK, I enjoy challenges.

> P.S. A funny OT fact: you, Prof. L'Ecuyer or any human - unless drunk
> and under drugs - are guaranteed to lose on 1,000 move party to the
> Shannon's Clairvoyant.

Oh, I quite accept that. That is, unless I use a better source of
randomness than my all too human intuitions. Humans are lousy PRNGs.

> I accepting bets 1000:1 ($1000 of mine on each $1 of yours).

Fine, it has been a long time I haven't betted via Usenet -
last time I won 10 € by correctly predicting on a French
crypto newsgroup that Rijndael would be selected for AES.
(http://groups.google.com/group/fr.misc.cryptologie/msg/e6849c10a099256f)

I can afford to lose $10, can you afford to lose 10,000?

--
Johannes