Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #26931
| From | Bernd Paysan <bernd.paysan@gmx.de> |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: LC53, a respectable random generator? |
| Date | 2013-11-24 23:53 +0100 |
| Organization | 1&1 Internet AG |
| Message-ID | <l6u00q$6cl$1@online.de> (permalink) |
| References | <5290d6f8$0$3170$e4fe514c@dreader36.news.xs4all.nl> <op.w61slwx45zc71u@localhost> <52920a77$0$615$e4fe514c@dreader34.news.xs4all.nl> <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. 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/
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
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
csiph-web