Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #26916 > unrolled thread

LC53, a respectable random generator?

Started byalbert@spenarnc.xs4all.nl (Albert van der Horst)
First post2013-11-23 16:25 +0000
Last post2013-11-28 18:14 -0800
Articles 20 on this page of 62 — 13 participants

Back to article view | Back to comp.lang.forth


Contents

  LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-23 16:25 +0000
    Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-23 17:34 -0800
      Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-23 19:03 -0800
      Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-24 04:58 +0000
    Re: LC53, a respectable random generator? "Rod Pemberton" <dont_use_email@xnohavenotit.cnm> - 2013-11-24 04:57 -0500
      Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-24 14:17 +0000
        Re: LC53, a respectable random generator? mhx@iae.nl - 2013-11-24 08:12 -0800
          Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-24 16:46 +0000
          Re: LC53, a respectable random generator? Bernd Paysan <bernd.paysan@gmx.de> - 2013-11-24 23:53 +0100
            Re: LC53, a respectable random generator? mhx@iae.nl - 2013-11-24 15:41 -0800
              Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-24 17:57 -0800
              Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-25 19:32 +0000
                Re: LC53, a respectable random generator? mhx@iae.nl - 2013-11-25 14:22 -0800
                Re: LC53, a respectable random generator? Bernd Paysan <bernd.paysan@gmx.de> - 2013-11-26 00:20 +0100
                  Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-26 03:29 +0000
                    Re: LC53, a respectable random generator? thomas.bartscher@gmail.com - 2013-11-25 23:08 -0800
                      Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-26 05:06 -0800
                        Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-26 14:03 +0000
                        Re: LC53, a respectable random generator? Bernd Paysan <bernd.paysan@gmx.de> - 2013-11-26 21:59 +0100
                        Re: LC53, a respectable random generator? thomas.bartscher@gmail.com - 2013-11-28 01:32 -0800
                  Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-25 19:43 -0800
                Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-25 19:31 -0800
                Re: LC53, a respectable random generator? "Elizabeth D. Rather" <erather@forth.com> - 2013-11-25 19:24 -1000
                  Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-26 05:17 -0800
                  Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-26 14:21 +0000
                  Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-28 18:49 -0800
              Re: LC53, a respectable random generator? mhx@iae.nl - 2013-11-25 13:52 -0800
            Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-24 18:03 -0800
            Re: LC53, a respectable random generator? Matthias Koch <matthias.koch@hot.uni-hannover.de> - 2013-11-25 13:41 +0100
              Re: LC53, a respectable random generator? mhx@iae.nl - 2013-11-25 10:23 -0800
                Re: LC53, a respectable random generator? Howerd <howerdo@yahoo.co.uk> - 2013-11-25 13:43 -0800
                  Re: LC53, a respectable random generator? mhx@iae.nl - 2013-11-25 15:16 -0800
                    Re: LC53, a respectable random generator? Howerd <howerdo@yahoo.co.uk> - 2013-11-26 13:38 -0800
                      Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-26 20:42 -0800
                        Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-27 11:46 +0000
                          Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-27 18:35 -0800
                      Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-26 21:41 -0800
                        Re: LC53, a respectable random generator? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-11-27 03:21 -0600
                          Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-27 15:37 +0000
                            Re: LC53, a respectable random generator? Bernd Paysan <bernd.paysan@gmx.de> - 2013-11-27 23:01 +0100
                              Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-27 23:39 +0000
                              Re: LC53, a respectable random generator? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-11-28 05:41 -0600
                                Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-28 13:47 +0000
                                  Re: LC53, a respectable random generator? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-11-28 09:10 -0600
                                Re: LC53, a respectable random generator? Bernd Paysan <bernd.paysan@gmx.de> - 2013-11-28 16:22 +0100
                                  Re: LC53, a respectable random generator? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-11-28 09:34 -0600
                                  Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-28 18:39 -0800
                        Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-27 16:44 +0000
              Re: LC53, a respectable random generator? Bernd Paysan <bernd.paysan@gmx.de> - 2013-11-25 19:51 +0100
        Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-24 11:13 -0800
          Re: LC53, a respectable random generator? Hans Bezemer <the.beez.speaks@gmail.com> - 2013-11-25 09:52 +0100
    Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-24 13:07 -0800
      Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-25 02:18 +0000
        Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-24 19:36 -0800
    Re: LC53, a respectable random generator? "Ed" <invalid@invalid.com> - 2013-11-26 12:57 +1100
      Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-26 21:25 -0800
      Re: LC53, a respectable random generator? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-11-27 15:48 +0000
    Re: LC53, a respectable random generator? Mark Wills <markrobertwills@yahoo.co.uk> - 2013-11-27 01:10 -0800
      Re: LC53, a respectable random generator? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-11-27 03:29 -0600
        Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-27 19:49 -0800
          Re: LC53, a respectable random generator? Bernd Paysan <bernd.paysan@gmx.de> - 2013-11-28 15:57 +0100
            Re: LC53, a respectable random generator? hughaguilar96@yahoo.com - 2013-11-28 18:14 -0800

Page 1 of 4  [1] 2 3 4  Next page →


#26916 — LC53, a respectable random generator?

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2013-11-23 16:25 +0000
SubjectLC53, a respectable random generator?
Message-ID<5290d6f8$0$3170$e4fe514c@dreader36.news.xs4all.nl>
In the wikipedia entry about Linear congruential generators there
is an entry with a Forth implementation : LC53.

There is no theoretical motivation or testresults behind it,
except a statement of Hugh Aguilar:
" invented it".
and
"
\ PRNG is not suitable for encryption; it is intended to be used in games and simulations.
"

It has nothing to offer over the first generator mentioned (from
Numerical Recipees) : less trusted source, slower implementation,
smaller period. It has with a high probability, never been used in
a program with some notoriety.

This may be a very poor generator, and it may reflect poorly on the
reputation of the Forth community. It may give a wrong impression about
the standing of Hugh's novice package in the Forth community.

I ask Hugh to remove the LC53 from the wikipedia entry, until such
time he has more explanation on his website about the quality of the
generator.

N.B. Numerical Recipees amounts to
    : RAND SEED @ 1664525 * 1013904223 + DUP SEED ! ;
If you need a simple generator for games or graphics, why bother?

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [next] | [standalone]


#26919

Fromhughaguilar96@yahoo.com
Date2013-11-23 17:34 -0800
Message-ID<40c88d42-05da-4ff6-b589-c5913ceb885a@googlegroups.com>
In reply to#26916
On Saturday, November 23, 2013 9:25:28 AM UTC-7, Albert van der Horst wrote:
> In the wikipedia entry about Linear congruential generators there
> is an entry with a Forth implementation : LC53.
> 
> There is no theoretical motivation or testresults behind it,
> except a statement of Hugh Aguilar:
> " invented it".
> and
> "
> \ PRNG is not suitable for encryption; it is intended to be used in games and simulations.
> "
> 
> It has nothing to offer over the first generator mentioned (from
> Numerical Recipees) : less trusted source, slower implementation,
> smaller period. It has with a high probability, never been used in
> a program with some notoriety.
 
> This may be a very poor generator, and it may reflect poorly on the
> reputation of the Forth community. It may give a wrong impression about
> the standing of Hugh's novice package in the Forth community.
> 
> I ask Hugh to remove the LC53 from the wikipedia entry, until such
> time he has more explanation on his website about the quality of the
> generator.

You don't need my permission to remove it --- anybody can edit Wikipedia pages. Just zap it on the grounds that it is "original research," which is the worst sin known in the Wikipedia world (the "original sin," so to speak). Don't forget to mention that my code "may" be of poor quality --- you never know!

I also have a link in the left-leaning red-black tree article, so you can go zap that one too, for the same reason. I had a link in the slide-rule article to my slide-rule program, but it has already been zapped for being original research, so you don't get the satisfaction of zapping it yourself.

Go for it Albert! Zapping my stuff on Wikipedia is your big opportunity to feel like a winner --- both the Wikipedia and the comp.lang.forth crowd will cheer you --- this will be your moment of glory!

> N.B. Numerical Recipees amounts to
>     : RAND SEED @ 1664525 * 1013904223 + DUP SEED ! ;

What a moron you are! If you multiply a 32-bit number (SEED) by a 16-bit number (1664525), it will overflow. 

But all is not lost! Those clever devils who wrote "Numerical Recipes" foresaw the overflow problem and made their multiplier a 16-bit number (1664525), and also made the divisor 2^32. In a language such as C or Pascal, a 16-bit compiler can implement this prng. The SEED is broken up into two 16-bit numbers, the low and the high parts. Each is multiplied by the 16-bit multiplier separately. Although these are 16x16 multiplications, 32x32 multiplication is used (the LONG INT type in C) so the product will be 32-bit. The product of the high multiplication is then shifted left by 16 bits, and the two products added together for a 32-bit result. This is effectively the same as multiplying the original SEED by the multiplier and taking the MOD of 2^32. It is still necessary to add in the C value, which is 32-bit, but is small enough that it won't overflow when added to any 32-bit number.

This is a lot of complicated rigmarole, but it allows the prng to be implemented on a 16-bit C compiler. In Forth, all of this rigmarole is not necessary, because we have mixed-precision arithmetic. Quite humorously however, the morons at Forth Inc. implemented their prng using the "Numerical Recipes" values, and they didn't use mixed-precision arithmetic --- they did the complicated rigmarole described above --- most likely, they just ported the algorithm directly from a C implementation without understanding how it worked, and without realizing that Forth's mixed-precision arithmetic could significantly simplify and speed up the implementation.

In my LC53, the multiplier does not fit in 16-bits, but it is a 32-bit number. Because of this, LC53 can't be implemented on a 16-bit C compiler (or a 16-bit Forth either). LC53 can only be implemented on a 32-bit C compiler by using LONG INT types, so all of the arithmetic is 64-bit. This is grossly slow, compared to using mixed-precision arithmetic on a 32-bit Forth system.

Wikipedia editors are, for the most part, morons who know nothing about any subject, but for psychological reasons want to be big experts on every subject. I think that you will fit right in Albert --- Wikipedia can be your new home!

C.L.F. is dying out. There are almost no posts with any technical content anymore. The C.L.F. crowd is so bored that they now respond to posts by Gavino and WJ etc., although those clowns are ignored on all of the other forums. I have left C.L.F. --- I only responded to this post because Albert specifically called me out regarding LC53 --- but I don't post here anymore. The C.L.F. crowd are going to need a new home after C.L.F. dies out --- so you can all go over to Wikipedia and edit articles there --- you can be big experts on every subject under the sun, and not just on Forth and linear-congruential prngs and stuff like that, which you are limited to here on C.L.F..

[toc] | [prev] | [next] | [standalone]


#26920

Fromhughaguilar96@yahoo.com
Date2013-11-23 19:03 -0800
Message-ID<c049c5be-42c4-4cf1-aad1-e2310372511c@googlegroups.com>
In reply to#26919
On Saturday, November 23, 2013 6:34:25 PM UTC-7, hughag...@yahoo.com wrote:
> On Saturday, November 23, 2013 9:25:28 AM UTC-7, Albert van der Horst wrote:
> > N.B. Numerical Recipees amounts to
> >     : RAND SEED @ 1664525 * 1013904223 + DUP SEED ! ;
> 
> What a moron you are! If you multiply a 32-bit number (SEED) by a 16-bit number (1664525), it will overflow. 

Well, maybe I'm the moron --- 1664525 is not a 16-bit number, but is actually a 32-bit number. I was typing without thinking, as Albert's post and got my goat --- I just assumed that the LC prng he was advocating was one of the many floating around that use a 16-bit multiplier for the reason described.

This is the Wikipedia article where I included a link to my novice package, which Albert finds so offensive:
http://en.wikipedia.org/wiki/Linear_congruential_generator

Somewhat humorously, I found a mention of my LC53 in this Wikipedia article:
http://en.wikipedia.org/wiki/Lehmer_random_number_generator

I didn't put that there though, and I hadn't even noticed the article before (because I rarely read Wikipedia articles). My LC53 seems to spreading like a virus! Albert will have to track down every occurrence and zap them all --- this can be his new career!

[toc] | [prev] | [next] | [standalone]


#26921

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2013-11-24 04:58 +0000
Message-ID<5291877d$0$3202$e4fe514c@dreader36.news.xs4all.nl>
In reply to#26919
In article <40c88d42-05da-4ff6-b589-c5913ceb885a@googlegroups.com>,
 <hughaguilar96@yahoo.com> wrote:
>On Saturday, November 23, 2013 9:25:28 AM UTC-7, Albert van der Horst wrote:
>> In the wikipedia entry about Linear congruential generators there
>> is an entry with a Forth implementation : LC53.
>>
>> There is no theoretical motivation or testresults behind it,
>> except a statement of Hugh Aguilar:
>> " invented it".
>> and
>> "
>> \ PRNG is not suitable for encryption; it is intended to be used in
>games and simulations.
>> "
>>
>> It has nothing to offer over the first generator mentioned (from
>> Numerical Recipees) : less trusted source, slower implementation,
>> smaller period. It has with a high probability, never been used in
>> a program with some notoriety.
>
>> This may be a very poor generator, and it may reflect poorly on the
>> reputation of the Forth community. It may give a wrong impression about
>> the standing of Hugh's novice package in the Forth community.
>>
>> I ask Hugh to remove the LC53 from the wikipedia entry, until such
>> time he has more explanation on his website about the quality of the
>> generator.
>
>You don't need my permission to remove it --- anybody can edit Wikipedia
>pages. Just zap it on the grounds that it is "original research," which
>is the worst sin known in the Wikipedia world (the "original sin," so to
>speak). Don't forget to mention that my code "may" be of poor quality
>--- you never know!

Of course I don't need not your permission, but it seems not a nice
thing to do.

>
>I also have a link in the left-leaning red-black tree article, so you
>can go zap that one too, for the same reason. I had a link in the
>slide-rule article to my slide-rule program, but it has already been
>zapped for being original research, so you don't get the satisfaction of
>zapping it yourself.

If you add a link to a Forth implementation of red-black trees, that
is totally in order.

>
>Go for it Albert! Zapping my stuff on Wikipedia is your big opportunity
>to feel like a winner --- both the Wikipedia and the comp.lang.forth
>crowd will cheer you --- this will be your moment of glory!
>
>> N.B. Numerical Recipees amounts to
>>     : RAND SEED @ 1664525 * 1013904223 + DUP SEED ! ;
>
>What a moron you are! If you multiply a 32-bit number (SEED) by a 16-bit
>number (1664525), it will overflow.

Of course:
: * M* DROP ;   \ Ignore m.s. part.
Also the + may overflow which doesn't lead to an exception in Forth,
because they could be interpreted as an unsigned number.
That is exactly how these random number generators work,
"silently ignore overflow".
(And 1664525 is not a 16 bit number, by the way.)

<SNIP>

>
>Wikipedia editors are, for the most part, morons who know nothing about
>any subject, but for psychological reasons want to be big experts on
>every subject. I think that you will fit right in Albert --- Wikipedia
>can be your new home!

An interesting remark ... from a Wikipedia editor!

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#26923

From"Rod Pemberton" <dont_use_email@xnohavenotit.cnm>
Date2013-11-24 04:57 -0500
Message-ID<op.w61slwx45zc71u@localhost>
In reply to#26916
On Sat, 23 Nov 2013 11:25:28 -0500, Albert van der Horst  
<albert@spenarnc.xs4all.nl> wrote:

> In the wikipedia entry about Linear congruential generators
> there is an entry with a Forth implementation : LC53.
>
> There is no theoretical motivation or test results behind it,
> except a statement of Hugh Aguilar:
> " invented it".

LOL. Classic.

> and
> "
> \ PRNG is not suitable for encryption; it is intended to
> be used in games and simulations.
> "
...

> It has nothing to offer over the first generator mentioned (from
> Numerical Recipees) : less trusted source, slower implementation,
> smaller period. It has with a high probability, never been used in
> a program with some notoriety.

ROFL!

You wrote a "this has no purpose" clause for him!  Or, was that
the obligatory "this sucks" clause?  Now, I'm confused...

Sorry Hugh, too funny, not that you care...


Rod Pemberton

[toc] | [prev] | [next] | [standalone]


#26926

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2013-11-24 14:17 +0000
Message-ID<52920a77$0$615$e4fe514c@dreader34.news.xs4all.nl>
In reply to#26923
In article <op.w61slwx45zc71u@localhost>,
Rod Pemberton <dont_use_email@xnohavenotit.cnm> wrote:
>On Sat, 23 Nov 2013 11:25:28 -0500, Albert van der Horst
><albert@spenarnc.xs4all.nl> wrote:
>
>> In the wikipedia entry about Linear congruential generators
>> there is an entry with a Forth implementation : LC53.
>>
>> There is no theoretical motivation or test results behind it,
>> except a statement of Hugh Aguilar:
>> " invented it".
>
>LOL. Classic.
>
>> and
>> "
>> \ PRNG is not suitable for encryption; it is intended to
>> be used in games and simulations.
>> "
>...
>
>> It has nothing to offer over the first generator mentioned (from
>> Numerical Recipees) : less trusted source, slower implementation,
>> smaller period. It has with a high probability, never been used in
>> a program with some notoriety.
>
>ROFL!
>
>You wrote a "this has no purpose" clause for him!  Or, was that
>the obligatory "this sucks" clause?  Now, I'm confused...

I wrote an assesment for LC53 as it stands now, the disclaimer about
suitability is from Hugh.

You make it seem like I want to make fun of Hugh.
This is an invitation to back up his generator with some theory.
What he should do IMO is to run the tests from Knuth's TAO
and publish the results on his website. Even if the outcome is
soso, that would make the Wikipedia entry respectable.
If the outcome is really bad, then of course it is better to
remove the Wikipedia mention.

>
>Sorry Hugh, too funny, not that you care...

Hugh's novice thing is an honest effort. There may be flaws
in theoretical underpinnings (discussions with Passaniti come
to mind), as far as programming and documentation is concerned
it is pretty solid.

>
>
>Rod Pemberton

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#26927

Frommhx@iae.nl
Date2013-11-24 08:12 -0800
Message-ID<d5eb8f1b-1bcb-4bbb-a3ff-04f961193323@googlegroups.com>
In reply to#26926
On Sunday, November 24, 2013 3:17:27 PM UTC+1, Albert van der Horst wrote:
[..]
> This is an invitation to back up his generator with some theory. 
> What he should do IMO is to run the tests from Knuth's TAO 
> and publish the results on his website. Even if the outcome is 
> soso, that would make the Wikipedia entry respectable. 
> If the outcome is really bad, then of course it is better to 
> remove the Wikipedia mention. 

Marsaglia's Diehard test is more convenient.

The results are very bad. The birthday and gorilla tests 
are even off the scale.

-marcel
-- -------------------------
FORTH> init-seeds diehard
DIEHARD is checking Ran-HA..

        .---------------------------------------------------------------.
        |           This is the "tough" BIRTHDAY SPACINGS TEST          |
        | Choose 4096 birthdays in a "year" of 2^32 days. Thus each     |
        | birthday is a 32-bit integer and the test uses 2^12 of them,  |
        | so that j, the number of duplicate spacings, is asympotically |
        | Poisson distributed with lambda=4.  Generators that pass the  |
        | earlier tests for m=1024 and n=2^24 often fail this test, yet |
        | those that pass this test seem to pass the "weaker" test.     |
        | Each set of 4096 birthdays provide a Poisson variate j, and   |
        | 500 such j's lead to a chisquare test to see if the result    |
        | is consistent with the Poisson distribution with lambda=16.   |
        `---------------------------------------------------------------'
            Table of Expected versus Observed counts:
Duplicates    0     1     2     3     4     5     6     7     8     9  >=10
Expected     91   366   732   976   976   781   520   297   148    66    40
Observed   1102  1578  1274   661   277    79    23     3     2     1     0
(O-E)^2/E******4008.0 400.0 102.1 501.4 631.5 476.0 291.7 144.9  64.2  40.7
            Birthday Spacings: Sum(O-E)^2/E = *******, p =  1.000
 ( 5.068 seconds elapsed. )

        .-------------------------------------------------------------.
        | This is the GCD TEST.   Let the (32-bit) RNG produce two    |
        | successive integers u,v.  Use Euclids algorithm to find the |
        | gcd, say x, of u and v. Let k be the number of steps needed |
        | to get x.   Then k is approximately binomial with p=.376    |
        | and n=50,  while the distribution of x is very close to     |
        | Pr(x=i)=c/i^2, with c=6/pi^2.   The gcd test uses ten       |
        | million such pairs u,v to see if the resulting frequencies  |
        | of k's and x's are consistent with the above distributions. |
        | Congruential RNG's---even those with prime modulus---fail   |
        | this test for the distribution of k, the number of steps,   |
        | and often for the distribution of gcd values x as well.     |
        `-------------------------------------------------------------'
Euclid's algorithm:
 p-value, steps to gcd: 0.640036
 p-value, distance of gcd's: 0.892458
 ( 2.323 seconds elapsed. )

        .---------------------------------------------------------------.
        |   This is the GORILLA test, a strong version of the monkey    |
        |   tests that I developed in the 70's. It concerns strings     |
        |   formed from specified bits in 32-bit integers from the RNG. |
        |   We specify the bit position to be studied, from 0 to 31,    |
        |   say bit 3. Then we generate 67,108,889 (2^26+25) numbers    |
        |   from the generator and form a string of 2^26+25 bits by     |
        |   taking bit 3 from each of those numbers. In that string of  |
        |   2^26+25 bits we count the number of 26-bit segments that    |
        |   do not appear. That count should be approximately normal    |
        |   with mean 24687971 and std. deviation 4170. This leads to   |
        |   a normal z-score and hence to a p-value. The test is        |
        |   applied for each bit position 0 (leftmost) to 31.           |
        |   (Some older tests use Fortran's 1-32 for most- to least-    |
        |   significant bits. Gorilla and newer tests use C's 0 to 31.) |
        `---------------------------------------------------------------'
Gorilla test for 2^26 bits, positions 0 to 31:
Note: lengthy test -- ~20 minutes for 900 MHz PC
Bits  0 to  7 || 0.000 0.000 0.001 0.000 0.000 0.000 0.000 0.000
Bits  8 to 15 || 0.000 0.006 0.000 0.000 0.000 0.000 0.001 0.000
Bits 16 to 23 || 0.001 0.000 0.000 0.003 0.000 0.003 0.000 0.000
Bits 24 to 31 || 0.003 0.000 0.291 0.049 0.102 0.611 0.001 0.000
ADKS test for the above 32 p values:  1.000
 ( 49.874 seconds elapsed. )

        .---------------------------------------------------------------.
        |           THE OVERLAPPING 5-PERMUTATION TEST                  |
        | This is the OPERM5 test.  It looks at a sequence of ten       |
        | million 32-bit random integers.  Each set of five consecutive |
        | integers can be in one of 120 states, for the 5! possible     |
        | orderings of five numbers.  Thus the 5th, 6th, 7th,...numbers |
        | each provide a state. As many thousands of state transitions  |
        | are observed,  cumulative counts are made of the number of    |
        | occurences of each state.  Then the quadratic form in the     |
        | weak inverse of the 120x120 covariance matrix yields a test   |
        | that the 120 cellcounts came from the specified (asymptotic)  |
        | distribution with the specified means and 120x120 covariance. |
        `---------------------------------------------------------------'
      The OPERM5 test for 10 million (overlapping) 5-tuples for Ran-HA.
      p-values for 5 runs: 0.5952 0.9339 0.8200 0.5496 0.1751
 ( 7.197 seconds elapsed. ) ok

[toc] | [prev] | [next] | [standalone]


#26928

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2013-11-24 16:46 +0000
Message-ID<52922d71$0$26894$e4fe514c@dreader37.news.xs4all.nl>
In reply to#26927
In article <d5eb8f1b-1bcb-4bbb-a3ff-04f961193323@googlegroups.com>,
 <mhx@iae.nl> wrote:
>On Sunday, November 24, 2013 3:17:27 PM UTC+1, Albert van der Horst wrote:
>[..]
>> This is an invitation to back up his generator with some theory.
>> What he should do IMO is to run the tests from Knuth's TAO
>> and publish the results on his website. Even if the outcome is
>> soso, that would make the Wikipedia entry respectable.
>> If the outcome is really bad, then of course it is better to
>> remove the Wikipedia mention.
>
>Marsaglia's Diehard test is more convenient.
>
>The results are very bad. The birthday and gorilla tests
>are even off the scale.
>
>-marcel
>-- -------------------------
>FORTH> init-seeds diehard
>DIEHARD is checking Ran-HA..
>
>        .---------------------------------------------------------------.
>        |           This is the "tough" BIRTHDAY SPACINGS TEST          |
>        | Choose 4096 birthdays in a "year" of 2^32 days. Thus each     |
>        | birthday is a 32-bit integer and the test uses 2^12 of them,  |
>        | so that j, the number of duplicate spacings, is asympotically |
>        | Poisson distributed with lambda=4.  Generators that pass the  |
>        | earlier tests for m=1024 and n=2^24 often fail this test, yet |
>        | those that pass this test seem to pass the "weaker" test.     |
>        | Each set of 4096 birthdays provide a Poisson variate j, and   |
>        | 500 such j's lead to a chisquare test to see if the result    |
>        | is consistent with the Poisson distribution with lambda=16.   |
>        `---------------------------------------------------------------'
>            Table of Expected versus Observed counts:
>Duplicates    0     1     2     3     4     5     6     7     8     9  >=10
>Expected     91   366   732   976   976   781   520   297   148    66    40
>Observed   1102  1578  1274   661   277    79    23     3     2     1     0
>(O-E)^2/E******4008.0 400.0 102.1 501.4 631.5 476.0 291.7 144.9  64.2  40.7
>            Birthday Spacings: Sum(O-E)^2/E = *******, p =  1.000
> ( 5.068 seconds elapsed. )
>
>        .-------------------------------------------------------------.
>        | This is the GCD TEST.   Let the (32-bit) RNG produce two    |
>        | successive integers u,v.  Use Euclids algorithm to find the |
>        | gcd, say x, of u and v. Let k be the number of steps needed |
>        | to get x.   Then k is approximately binomial with p=.376    |
>        | and n=50,  while the distribution of x is very close to     |
>        | Pr(x=i)=c/i^2, with c=6/pi^2.   The gcd test uses ten       |
>        | million such pairs u,v to see if the resulting frequencies  |
>        | of k's and x's are consistent with the above distributions. |
>        | Congruential RNG's---even those with prime modulus---fail   |
>        | this test for the distribution of k, the number of steps,   |
>        | and often for the distribution of gcd values x as well.     |
>        `-------------------------------------------------------------'
>Euclid's algorithm:
> p-value, steps to gcd: 0.640036
> p-value, distance of gcd's: 0.892458
> ( 2.323 seconds elapsed. )
>
>        .---------------------------------------------------------------.
>        |   This is the GORILLA test, a strong version of the monkey    |
>        |   tests that I developed in the 70's. It concerns strings     |
>        |   formed from specified bits in 32-bit integers from the RNG. |
>        |   We specify the bit position to be studied, from 0 to 31,    |
>        |   say bit 3. Then we generate 67,108,889 (2^26+25) numbers    |
>        |   from the generator and form a string of 2^26+25 bits by     |
>        |   taking bit 3 from each of those numbers. In that string of  |
>        |   2^26+25 bits we count the number of 26-bit segments that    |
>        |   do not appear. That count should be approximately normal    |
>        |   with mean 24687971 and std. deviation 4170. This leads to   |
>        |   a normal z-score and hence to a p-value. The test is        |
>        |   applied for each bit position 0 (leftmost) to 31.           |
>        |   (Some older tests use Fortran's 1-32 for most- to least-    |
>        |   significant bits. Gorilla and newer tests use C's 0 to 31.) |
>        `---------------------------------------------------------------'
>Gorilla test for 2^26 bits, positions 0 to 31:
>Note: lengthy test -- ~20 minutes for 900 MHz PC
>Bits  0 to  7 || 0.000 0.000 0.001 0.000 0.000 0.000 0.000 0.000
>Bits  8 to 15 || 0.000 0.006 0.000 0.000 0.000 0.000 0.001 0.000
>Bits 16 to 23 || 0.001 0.000 0.000 0.003 0.000 0.003 0.000 0.000
>Bits 24 to 31 || 0.003 0.000 0.291 0.049 0.102 0.611 0.001 0.000
>ADKS test for the above 32 p values:  1.000
> ( 49.874 seconds elapsed. )
>
>        .---------------------------------------------------------------.
>        |           THE OVERLAPPING 5-PERMUTATION TEST                  |
>        | This is the OPERM5 test.  It looks at a sequence of ten       |
>        | million 32-bit random integers.  Each set of five consecutive |
>        | integers can be in one of 120 states, for the 5! possible     |
>        | orderings of five numbers.  Thus the 5th, 6th, 7th,...numbers |
>        | each provide a state. As many thousands of state transitions  |
>        | are observed,  cumulative counts are made of the number of    |
>        | occurences of each state.  Then the quadratic form in the     |
>        | weak inverse of the 120x120 covariance matrix yields a test   |
>        | that the 120 cellcounts came from the specified (asymptotic)  |
>        | distribution with the specified means and 120x120 covariance. |
>        `---------------------------------------------------------------'
>      The OPERM5 test for 10 million (overlapping) 5-tuples for Ran-HA.
>      p-values for 5 runs: 0.5952 0.9339 0.8200 0.5496 0.1751
> ( 7.197 seconds elapsed. ) ok

I hate to see that someone is doing Hughs homework, but anyway.

Now we have come this far. Would you publish your test on your website?
I will then proceed with the wikipedia article adding a note like:
"look what happens if you try to invent a random generator without
theoretical background." and a reference to your site.

This was a test of the LC53 random generator. (Adding this information
to the body of the article too.)

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#26931

FromBernd Paysan <bernd.paysan@gmx.de>
Date2013-11-24 23:53 +0100
Message-ID<l6u00q$6cl$1@online.de>
In reply to#26927
mhx@iae.nl wrote:

> On Sunday, November 24, 2013 3:17:27 PM UTC+1, Albert van der Horst wrote:
> [..]
>> This is an invitation to back up his generator with some theory.
>> What he should do IMO is to run the tests from Knuth's TAO
>> and publish the results on his website. Even if the outcome is
>> soso, that would make the Wikipedia entry respectable.
>> If the outcome is really bad, then of course it is better to
>> remove the Wikipedia mention.
> 
> Marsaglia's Diehard test is more convenient.
> 
> The results are very bad. The birthday and gorilla tests
> are even off the scale.

To be honest, a linear congruental generator is supposed to fail quickly in 
any serious random number test suite.  This doesn't mean it's not a good LC 
generator, it just means linear congruental is not a good way to produce 
random numbers.  Dieharder, Big Crush, and the AFAIK most recent TestU01 
suite are even better finding weaknesses than the original Diehard (which 
can be considdered out of date, as it doesn't find many weaknesses).

The only advantage of an LC generator is that it is written in one line, and 
fast.  That's all.  If you want a simple random number generator in 
software, and you don't care much about its quality, take it.  If you want a 
simple random number generator in hardware, take a long enough xorshift 
generator.  If you want perfect quality no matter the costs, take a 
cryptographic one.  Some of those, like RC4, aren't actually that expensive.  
RC4 has a bias for the first few thousand bytes, but after that, it is still 
considered "good enough" to pass at least the random number tests and any 
attempts outside the NSA to crack it; more recent stream ciphers and all the 
SHA-3 finalists will for sure produce something that not only passes the 
tests, but also theoretical analysis.  However, they are easily by a factor 
10 slower than an LC generator (~10 cycles per produced byte).

The 128 bit xorshift generator here passes even the diehard test:

http://en.wikipedia.org/wiki/Xorshift

If Hugh wants a better, yet still very simple PRNG in his novice suite that 
does pass a reasonable test suite and is fast and easy to implement, he 
should implement that one; the German Wikipedia has even (relatively good) 
variants for 32 and 64 bits:

http://de.wikipedia.org/wiki/Xorshift

The test I use for a first look at the quality is FFT.  I generate 2^n 
random numbers, pass them through FFT, and what I expect as output values is 
something close to a Gauss distribution around the expected average with the 
expected sigma.  This test detects all kinds of repetitive patterns and 
biases in the random numbers.  If it passes that test, I let TestU01 run.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

[toc] | [prev] | [next] | [standalone]


#26932

Frommhx@iae.nl
Date2013-11-24 15:41 -0800
Message-ID<c511a675-b363-45ec-a1a5-631779449696@googlegroups.com>
In reply to#26931
On Sunday, November 24, 2013 11:53:14 PM UTC+1, Bernd Paysan wrote:
> mhx@iae.nl wrote:
[..]
> The test I use for a first look at the quality is FFT.  I generate 2^n 
> random numbers, pass them through FFT, and what I expect as output values is 
> something close to a Gauss distribution around the expected average with the 
> expected sigma.  This test detects all kinds of repetitive patterns and 
> biases in the random numbers.  If it passes that test, I let TestU01 run.

That's an (hardware) engineer's evaluation :-) You could also
look at a geometrical representation of the output or listen to it.

For a Forth random generator many sources are available, 
e.g. this is a lits from the past 10 years:

 	' .RAN-MWC256
\	' .RANKISS      
\	' .RANDOM    
\	' .RANNEXT   
\	' .RANNEXT2
\	' .RANDNEXT  
\	' .RAN-APHWB 
\ 	' .RAN-FAKE
\ 	' .RAN-GFORTH
\	' .RAN-RANGE
\	' .RAN-MT
\	' .RAN4
\	' .RANR250
\	' .RANR250x2
\	' .RANR250sx2
\	' .RAN-HA
\	' .RANGGUBS

Most of them pass the test. MCW256 is not much slower 
than RANDOM (an LC variant that is reasonable). Most
have problems with 64 bit Forths and should be modernized.

-marcel

[toc] | [prev] | [next] | [standalone]


#26934

Fromhughaguilar96@yahoo.com
Date2013-11-24 17:57 -0800
Message-ID<90573c20-c8e0-49e5-9fa5-e3ebdc480ed7@googlegroups.com>
In reply to#26932
On Sunday, November 24, 2013 4:41:23 PM UTC-7, m...@iae.nl wrote:
> For a Forth random generator many sources are available, 

Well, I looked up RAND in SwiftForth v2. Here it is:

VARIABLE BUD

: RAND  ( -- u )  BUD @  3141592621 *  1+  DUP BUD ! ;

It isn't any good, which is why I came up with LC53. I misremembered when I said that it had a 16-bit multiplier; it is 32-bit also.

They credit Wil Baden with this in the source-code. It doesn't provide a full period. His multiplier looks suspiciously close to pi --- most likely he just pulled that number out of the air with the vague idea that it looked randomish.

[toc] | [prev] | [next] | [standalone]


#26950

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2013-11-25 19:32 +0000
Message-ID<5293a5dc$0$3199$e4fe514c@dreader36.news.xs4all.nl>
In reply to#26932
In article <c511a675-b363-45ec-a1a5-631779449696@googlegroups.com>,
 <mhx@iae.nl> wrote:
>On Sunday, November 24, 2013 11:53:14 PM UTC+1, Bernd Paysan wrote:
>> mhx@iae.nl wrote:
>[..]
>> The test I use for a first look at the quality is FFT.  I generate 2^n
>> random numbers, pass them through FFT, and what I expect as output values is
>> something close to a Gauss distribution around the expected average with the
>> expected sigma.  This test detects all kinds of repetitive patterns and
>> biases in the random numbers.  If it passes that test, I let TestU01 run.
>
>That's an (hardware) engineer's evaluation :-) You could also
>look at a geometrical representation of the output or listen to it.
>
>For a Forth random generator many sources are available,
>e.g. this is a lits from the past 10 years:
>
>       ' .RAN-MWC256
>\      ' .RANKISS
>\      ' .RANDOM
>\      ' .RANNEXT
>\      ' .RANNEXT2
>\      ' .RANDNEXT
>\      ' .RAN-APHWB
>\      ' .RAN-FAKE
>\      ' .RAN-GFORTH
>\      ' .RAN-RANGE
>\      ' .RAN-MT
>\      ' .RAN4
>\      ' .RANR250
>\      ' .RANR250x2
>\      ' .RANR250sx2
>\      ' .RAN-HA
>\      ' .RANGGUBS
>
>Most of them pass the test. MCW256 is not much slower
>than RANDOM (an LC variant that is reasonable). Most
>have problems with 64 bit Forths and should be modernized.

For tForth we used one published in EDN. I still use that one.
Which one do you supply as a standard in iForth?

I see that gForth as well as SwiftForth use a simple LCG.
As far as I can see, they don't supply a reference, testset, testdata
or other motivation.

I fear neither of those fare too well on the harsh tests you use.
Hugh suggests that the only difference with his LC53 is that
Anton Ertl and Elizabeth Rather inspire more confidence than he does.

It sounds like you have a whole machinery in place to tests rng's.
Would you mind adding LC53 to the list?

\ Comma for clarity, not a double number.
: LC53  -5 um* -333,333,333 + nip ;
( : doit seed @ LC53 dup seed ! ; )

>
>-marcel

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#26954

Frommhx@iae.nl
Date2013-11-25 14:22 -0800
Message-ID<e5b4b8a2-7b79-4b68-9701-ad06b0400566@googlegroups.com>
In reply to#26950
On Monday, November 25, 2013 8:32:44 PM UTC+1, Albert van der Horst wrote:
> In article <c511a675-b363-45ec-a1a5-631779449696@googlegroups.com>,
>  <mhx@iae.nl> wrote:
> >On Sunday, November 24, 2013 11:53:14 PM UTC+1, Bernd Paysan wrote:
> >> mhx@iae.nl wrote:
[..]
[..]
> For tForth we used one published in EDN. I still use that one.
> Which one do you supply as a standard in iForth?

The same:
 
  : RANDOM  seed 1078373 * 2311527 + 9 ROL DUP TO seed ;

As you can see, I added  9 ROL , because the common criticism 
is that the low bits of such a generator are not very random. 
This cleans up the result remarkably well for the single cycle
it costs (see below). 
 
> I see that gForth as well as SwiftForth use a simple LCG.
> As far as I can see, they don't supply a reference, testset, testdata
> or other motivation.

The iForth dist has the diehard suite (in Forth) to take care of
that. 
 
> I fear neither of those fare too well on the harsh tests you use.
> Hugh suggests that the only difference with his LC53 is that
> Anton Ertl and Elizabeth Rather inspire more confidence than he does.

Anybody passes that test :-)

All the simple generators mentioned by you were analyzed in TAO
and a very simple recipe was given there to make the best of them 
(which does not make them perfect). The iForth and Baden generators 
follow that rule, but I don't remember it now and can't check if 
the others do. 

> It sounds like you have a whole machinery in place to tests rng's.
> Would you mind adding LC53 to the list?
> 
> \ Comma for clarity, not a double number.
> : LC53  -5 um* -333,333,333 + nip ;
> ( : doit seed @ LC53 dup seed ! ; )> 

That is .RAN-HA .

-marcel
-- -----------
FORTH> diehard
DIEHARD is checking RANDOM..

        .---------------------------------------------------------------.
        |           This is the "tough" BIRTHDAY SPACINGS TEST          |
        | Choose 4096 birthdays in a "year" of 2^32 days. Thus each     |
        | birthday is a 32-bit integer and the test uses 2^12 of them,  |
        | so that j, the number of duplicate spacings, is asympotically |
        | Poisson distributed with lambda=4.  Generators that pass the  |
        | earlier tests for m=1024 and n=2^24 often fail this test, yet |
        | those that pass this test seem to pass the "weaker" test.     |
        | Each set of 4096 birthdays provide a Poisson variate j, and   |
        | 500 such j's lead to a chisquare test to see if the result    |
        | is consistent with the Poisson distribution with lambda=16.   |
        `---------------------------------------------------------------'
            Table of Expected versus Observed counts:
Duplicates    0     1     2     3     4     5     6     7     8     9  >=10
Expected     91   366   732   976   976   781   520   297   148    66    40
Observed    101   333   727  1006   974   788   500   290   180    61    40
(O-E)^2/E   1.0   3.0   0.0   0.9   0.0   0.1   0.8   0.2   6.5   0.4   0.0
            Birthday Spacings: Sum(O-E)^2/E =  12.951, p =  0.775
 ( 4.739 seconds elapsed. )

        .-------------------------------------------------------------.
        | This is the GCD TEST.   Let the (32-bit) RNG produce two    |
        | successive integers u,v.  Use Euclids algorithm to find the |
        | gcd, say x, of u and v. Let k be the number of steps needed |
        | to get x.   Then k is approximately binomial with p=.376    |
        | and n=50,  while the distribution of x is very close to     |
        | Pr(x=i)=c/i^2, with c=6/pi^2.   The gcd test uses ten       |
        | million such pairs u,v to see if the resulting frequencies  |
        | of k's and x's are consistent with the above distributions. |
        | Congruential RNG's---even those with prime modulus---fail   |
        | this test for the distribution of k, the number of steps,   |
        | and often for the distribution of gcd values x as well.     |
        `-------------------------------------------------------------'
Euclid's algorithm:
 p-value, steps to gcd: 0.588402
 p-value, distance of gcd's: 0.434185
 ( 2.130 seconds elapsed. )

        .---------------------------------------------------------------.
        |   This is the GORILLA test, a strong version of the monkey    |
        |   tests that I developed in the 70's. It concerns strings     |
        |   formed from specified bits in 32-bit integers from the RNG. |
        |   We specify the bit position to be studied, from 0 to 31,    |
        |   say bit 3. Then we generate 67,108,889 (2^26+25) numbers    |
        |   from the generator and form a string of 2^26+25 bits by     |
        |   taking bit 3 from each of those numbers. In that string of  |
        |   2^26+25 bits we count the number of 26-bit segments that    |
        |   do not appear. That count should be approximately normal    |
        |   with mean 24687971 and std. deviation 4170. This leads to   |
        |   a normal z-score and hence to a p-value. The test is        |
        |   applied for each bit position 0 (leftmost) to 31.           |
        |   (Some older tests use Fortran's 1-32 for most- to least-    |
        |   significant bits. Gorilla and newer tests use C's 0 to 31.) |
        `---------------------------------------------------------------'
Gorilla test for 2^26 bits, positions 0 to 31:
Note: lengthy test -- ~20 minutes for 900 MHz PC
Bits  0 to  7 || 0.334 0.163 0.375 0.400 0.523 0.755 0.120 0.905
Bits  8 to 15 || 0.051 0.785 0.259 0.232 0.034 0.984 0.668 0.991
Bits 16 to 23 || 0.820 0.461 0.188 0.283 0.446 0.432 0.525 0.183
Bits 24 to 31 || 0.274 0.837 0.463 0.363 0.137 0.254 0.844 0.882
ADKS test for the above 32 p values:  0.381
 ( 27.467 seconds elapsed. )

        .---------------------------------------------------------------.
        |           THE OVERLAPPING 5-PERMUTATION TEST                  |
        | This is the OPERM5 test.  It looks at a sequence of ten       |
        | million 32-bit random integers.  Each set of five consecutive |
        | integers can be in one of 120 states, for the 5! possible     |
        | orderings of five numbers.  Thus the 5th, 6th, 7th,...numbers |
        | each provide a state. As many thousands of state transitions  |
        | are observed,  cumulative counts are made of the number of    |
        | occurences of each state.  Then the quadratic form in the     |
        | weak inverse of the 120x120 covariance matrix yields a test   |
        | that the 120 cellcounts came from the specified (asymptotic)  |
        | distribution with the specified means and 120x120 covariance. |
        `---------------------------------------------------------------'
      The OPERM5 test for 10 million (overlapping) 5-tuples for RANDOM.
      p-values for 5 runs: 0.5366 0.1736 0.2796 0.9093 0.0519
 ( 6.873 seconds elapsed. ) ok

[toc] | [prev] | [next] | [standalone]


#26956

FromBernd Paysan <bernd.paysan@gmx.de>
Date2013-11-26 00:20 +0100
Message-ID<l70lve$2jq$1@online.de>
In reply to#26950
Albert van der Horst wrote:
> It sounds like you have a whole machinery in place to tests rng's.
> Would you mind adding LC53 to the list?
> 
> \ Comma for clarity, not a double number.
> : LC53  -5 um* -333,333,333 + nip ;

Hm, wasn't Hugh's LC53

: lc53  -333333333 um* -5 um/mod drop ;

?  Don't make Hugh look more stupid than he actually is ;-).

The linear congruent random number generator in Gforth is a mod 2^n 
generator, which has the known (and pretty awful) weakness that the least n 
bits have a period of 2^n each.  LC53 does not have this particular 
weakness, because it uses a prime (2^32-5) as modulus.  In so far, there's 
nothing fundamentally wrong with LC53, other than linear congruent 
generators just can't be that good.

I took the opportunity to replace the standard random number generator in 
Gforth with one based on our new hash function, which uses a combination of 
multiplication, rotate, add, and xor as primitives.  This has a 128 bit 
state, and should survive stringent tests (SmallCrush already passed and 
RabbitFile on a 8MB sample, too).

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

[toc] | [prev] | [next] | [standalone]


#26958

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2013-11-26 03:29 +0000
Message-ID<529415b6$0$1706$e4fe514c@dreader35.news.xs4all.nl>
In reply to#26956
In article <l70lve$2jq$1@online.de>, Bernd Paysan  <bernd.paysan@gmx.de> wrote:
>Albert van der Horst wrote:
>> It sounds like you have a whole machinery in place to tests rng's.
>> Would you mind adding LC53 to the list?
>>
>> \ Comma for clarity, not a double number.
>> : LC53  -5 um* -333,333,333 + nip ;
>
>Hm, wasn't Hugh's LC53
>
>: lc53  -333333333 um* -5 um/mod drop ;

Oops.
>
>?  Don't make Hugh look more stupid than he actually is ;-).

Whatever he is, he is not stupid.
I just read the documentation of the slide rule (You know with the time
capsule). After about 55 pages (of 300) it turns into a cross between
Nostradamus and the Book of Relevation, with proposals to change the
rules of poker thrown in for good measure. Absolutely intriguing.
On its technical merits the slide rule program could be mentioned in
wikipedia, but I can see why the reference was deleted.

>
>The linear congruent random number generator in Gforth is a mod 2^n
>generator, which has the known (and pretty awful) weakness that the least n
>bits have a period of 2^n each.  LC53 does not have this particular
>weakness, because it uses a prime (2^32-5) as modulus.  In so far, there's
>nothing fundamentally wrong with LC53, other than linear congruent
>generators just can't be that good.

I'm I right that LC53 is about as good as the lcg in Gforth (before the
change) albeit with different strength and weaknesses?

>
>I took the opportunity to replace the standard random number generator in
>Gforth with one based on our new hash function, which uses a combination of
>multiplication, rotate, add, and xor as primitives.  This has a 128 bit
>state, and should survive stringent tests (SmallCrush already passed and
>RabbitFile on a 8MB sample, too).

The wcm proposed by Marsaglia for 64 bits, has a 121 bit state, with
the multiplier 0x4000..001.

So everybody is making their own tweaks on rng's, with the 9 ROL of
mhx and all. As long as they pass enough tests, you're in the clear.
Seems like Hugh could join the club if only he was willing to
run some tests.

>
>--
>Bernd Paysan
>
Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#26962

Fromthomas.bartscher@gmail.com
Date2013-11-25 23:08 -0800
Message-ID<9dac6fa6-0c03-46e8-8bd7-8a7301d72ea6@googlegroups.com>
In reply to#26958
> Whatever he is, he is not stupid.
> I just read the documentation of the slide rule (You know with the time
> capsule). After about 55 pages (of 300) it turns into a cross between
> Nostradamus and the Book of Relevation, with proposals to change the
> rules of poker thrown in for good measure. Absolutely intriguing.
> On its technical merits the slide rule program could be mentioned in
> wikipedia, but I can see why the reference was deleted.

Thank you for the recommendation. Will read.

[toc] | [prev] | [next] | [standalone]


#26969

Fromhughaguilar96@yahoo.com
Date2013-11-26 05:06 -0800
Message-ID<12486958-6ccf-433e-a54e-4ae4805e71e7@googlegroups.com>
In reply to#26962
On Tuesday, November 26, 2013 12:08:12 AM UTC-7, thomas.b...@gmail.com wrote:
> > Whatever he is, he is not stupid.
> > I just read the documentation of the slide rule (You know with the time
> > capsule). After about 55 pages (of 300) it turns into a cross between
> > Nostradamus and the Book of Relevation, with proposals to change the
> > rules of poker thrown in for good measure. Absolutely intriguing.
> 
> > On its technical merits the slide rule program could be mentioned in
> > wikipedia, but I can see why the reference was deleted.

> Thank you for the recommendation. Will read.

If you do read it, you will be disappointed to discover that I make no mention of Nostradamus or the Book of Revelation. I don't believe in Nostradamus or divining the future from the Book of Revelation (aka "End-Times"). I don't even believe that the Bible is anything more than a book written by people with an agenda. Albert is a liar --- he is just making this stuff up.

I have always considered Albert to be a harmless fool, roughly comparable to Arthur Murray (aka Mentifex). Both of them have written a Forth program which they claim to be a big Artificial Intelligence break-through (ciForth means "Computer Intelligence Forth" and Albert refers to it as "she," and Mentifex has his Singularity on the way). Given this thread however, I no longer consider Albert to be harmless. Arthur Murray has always been a gentleman though, and I've never known him to attack anybody on the internet (Jeff Fox has helped Arthur with his Forth and has also described Arthur as being a gentleman).

Why is Albert attacking me? What did I ever do to him? Did somebody shoot his dog, and he thinks that it was me?

Apparently Albert is aware that Bernd Payson had booted me off the Forth-200x mailing list because I said that quotations need to have access to the creator function's local variables in order to be useful. Now he wants to kick me when I'm down, and boost his own "standing in the Forth community." This isn't working very well. For one thing, I'm not really down; getting booted off the Forth-200x mailing list is like getting fired from Taco Bell --- it is not a total heart-breaker for me. For another thing, I don't really care about LC53 or the LLRB tree --- inventing LC53 was the work of one day, and I didn't invent LLRB trees at all, but just implemented them (although that was the work of several days).

So far, the only people who have supported Albert are these:

Bernd Payson --- He wants people to think that I'm "stupid" so he can continue to fake up his quotation code that doesn't work.

Marcel Hendrix --- He is the guy who posted my LC53 encryption-cracking program on C.L.F. with my name removed from the copyright notice:
https://groups.google.com/forum/#!searchin/comp.lang.forth/LC53%7Csort:relevance/comp.lang.forth/wP5nw1ClzsM/E-TV9v2y9RoJ

Elizabeth Rather --- She wants people to believe that she is important enough to be "blessed by having some brilliant programmers around me" --- Wil Baden in this case.

None of these people have my respect, so their support for Albert's attack isn't a heart-breaker for me. Honestly, the whole attack seems foolish to me --- the more they call me "stupid" (Bernd's term) for my LC53, the more foolish they make themselves appear. I already deleted the reference to LC53 from the Wikipedia LCG article, so why do they continue to attack me here --- isn't it true that Albert's original demand was only that I delete the reference to LC53 from the Wikipedia LCG article?

[toc] | [prev] | [next] | [standalone]


#26971

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2013-11-26 14:03 +0000
Message-ID<5294aa2e$0$3173$e4fe514c@dreader36.news.xs4all.nl>
In reply to#26969
In article <12486958-6ccf-433e-a54e-4ae4805e71e7@googlegroups.com>,
 <hughaguilar96@yahoo.com> wrote:
>On Tuesday, November 26, 2013 12:08:12 AM UTC-7, thomas.b...@gmail.com wrote:
>> > Whatever he is, he is not stupid.
>> > I just read the documentation of the slide rule (You know with the time
>> > capsule). After about 55 pages (of 300) it turns into a cross between
>> > Nostradamus and the Book of Relevation, with proposals to change the
>> > rules of poker thrown in for good measure. Absolutely intriguing.
>>
>> > On its technical merits the slide rule program could be mentioned in
>> > wikipedia, but I can see why the reference was deleted.
>
>> Thank you for the recommendation. Will read.
>
>If you do read it, you will be disappointed to discover that I make no
>mention of Nostradamus or the Book of Revelation. I don't believe in
<SNIP>
Can't you just take it for what it is? Being compared to well-known
and revered books is a compliment.

>
>I have always considered Albert to be a harmless fool, roughly
>comparable to Arthur Murray (aka Mentifex). Both of them have written a
>Forth program which they claim to be a big Artificial Intelligence
>break-through (ciForth means "Computer Intelligence Forth" and Albert
>refers to it as "she," and Mentifex has his Singularity on the way).

I don't care about your insults, but I can't let this factual
incorrectness stand. My plan was to do work in ai with ciforth, hence
the name. I've accomplished no break-through and have all but given up
to do worthwile research on the subject. Even if I should claim
worthwile results, that it is a long cry from the grandiose claims of
Mentifex.

<gratuitous insults deleted>

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#26981

FromBernd Paysan <bernd.paysan@gmx.de>
Date2013-11-26 21:59 +0100
Message-ID<l73231$g42$1@online.de>
In reply to#26969
hughaguilar96@yahoo.com wrote:
> Apparently Albert is aware that Bernd Payson had booted me off the
> Forth-200x mailing list

You have issued a request for beeing bootet (yes, you really asked for it, 
you said we should get a spine, it was not just by misbehaving), and it was 
granted.  Peter Knaggs is the owner of the list and the only one who can 
actually boot somebody.  You received a mail from him, not from me.  We had 
a formal discussion and it was a consensus that to prevent further damage 
(several people had already left the list, as they couldn't stand your 
repeated insults), we need to grant your request for beeing booted.  The 
list has become a much better place since then.

We knew you would completely misrepresent this to the outside world, as you 
always do.  But fortunately, the outside world knows who's the troublemaker.

We have a spine, and we do kick incurable troublemakers like you in the ass 
if we are forced to.  Otherwise, we are polite to everybody.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

[toc] | [prev] | [next] | [standalone]


#27026

Fromthomas.bartscher@gmail.com
Date2013-11-28 01:32 -0800
Message-ID<37bc7fbf-06fb-4792-8318-819dec81e9da@googlegroups.com>
In reply to#26969
I am not disappointed, sorry to disappoint you.
Just accept that your slide rule documentation is a worthwhile read, even if not
for the reason you intended it to be.

[toc] | [prev] | [next] | [standalone]


Page 1 of 4  [1] 2 3 4  Next page →

Back to top | Article view | comp.lang.forth


csiph-web