 |
|
List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] Maple and PseudoRandomGenerator
| [MUG] Maple and PseudoRandomGenerator |
|
Author: Jerome BENOIT
Posted: Thu, 17 Oct 2002 17:55:45 +0300
|
>> From: Jerome BENOIT "benoit"
Dear MUG:
in the OnlineHelp page "The random subpackage of the stats package" we read
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
It must be noted that the design of good uniform generators, independent
of each other, is not an easy task. A randomly chosen random number
generator will most likely be of poor quality.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
So I have a naive question:
What does Maple use as "good uniform generator" ?
Thanks,
Jerome BEMOIT
|
| [MUG] Re: Maple and PseudoRandomGenerator |
|
Author: Carl Devore
Posted: Mon, 21 Oct 2002 13:20:54 -0400
|
>> From: Carl Devore "devore"
On Thu, 17 Oct 2002, Jerome BENOIT wrote:
> in the OnlineHelp page "The random subpackage of the stats package" we read
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> It must be noted that the design of good uniform generators, independent
> of each other, is not an easy task. A randomly chosen random number
> generator will most likely be of poor quality.
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
It would be nice if they gave the source for that paraphrasing. The quote
is "The moral of this story is that _random numbers should not be
generated with a method chosen at random_. Some theory should be used."
from _The Art of Computer Programming: Volume 2: Seminumerical Algorithms_
by Donald Knuth (page 6, 3rd edition).
> What does Maple use as "good uniform generator" ?
Look at showstat(rand);
It shows that the random number generator is a linear congruential
generator with a modulus of 10^12-11 (the largest 12-digit prime), a
multiplier of 427419669081, and a shift of 0. Note that much Maple code
makes the slight mistake of generating uniform random number in the
interval (0,1) by taking the output of rand() and dividing by 10^12. The
correct divisor is 10^12-11.
|
| [MUG] Re: Maple and PseudoRandomGenerator |
|
Author: Jerome BENOIT
Posted: Wed, 23 Oct 2002 01:45:56 +0300
|
>> From: Jerome BENOIT "benoit"
Thanks for the reply:
in a few words, the Maple "good uniform generators" is bad ?
Is there better Random Numenber Generator available in Maple somewhere ?
Thanks,
Jerome
|
| [MUG] Re: Maple and PseudoRandomGenerator |
|
Author: Maple User Group
Posted: Tue, 29 Oct 2002 14:30:28 -0500
|
>> From: Maple User Group "maple_gr"
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Sun, 27 Oct 2002 11:21:52 -0500 (EST)
From: Carl Devore "devore"
To: "maple-list"
Subject: Maple and PseudoRandomGenerator
On Wed, 23 Oct 2002, Jerome BENOIT wrote:
> in a few words, the Maple "good uniform generators" is bad ?
> Is there better Random Numenber Generator available in Maple somewhere ?
I did not say that it was bad. I don't know what other replies that you
may have received via private email. I just pointed out that the minor
error of dividing by 10^12 rather than 10^12-11 is often made. I did not
say that it was good either. There are a large number of tests of randon
number generators (RNGs) presented in _The Art of Computer Programming:
Volume 2_. Knuth devotes 260 pages to RNGs. The world's leading expert
on RNGs, George Marsaglia, reads this mailing list (or reads it
occasionally). Perhaps he has something to say.
The linear congruential generator would certainly be bad in a gambling
application, because it is possible for a savvy programmer to "crack" the
code and predict what the next number will be. But maybe it is good for
simulations.
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Mon, 28 Oct 2002 17:32:42 -0800 (PST)
From: Michael Monagan "mmonagan"
To: "maple-list"
Subject: Maple and PseudoRandomGenerator
Maple's rand(...) uses a linear congruential generator.
I.e. of the form x[k+1] = a*x[k] mod p where p = 10^12-11 is prime
and a = 427419669081 was a "randomly" chosen primitive element.
I tested the generator using the spectral test (as described in
Knuth in Vol II Semi numerical algorithms) and based on that
test this generator is better than all of the generators in his table
(because the modulus p used in Maple is bigger than his choices).
Mike
----------------------------------------------------------------
Dr. Michael Monagan,
Department of Mathematics, Tel: (604) 291-4279
Simon Fraser University, Fax: (604) 291-4947
Burnaby, BC, CANADA V5A 1S6 e-mail: "monagan"
|
Previous by date: [MUG] Re: Simplex Bug (?), Robert Israel
Next by date: [MUG] Re: Question about programming maple with graphic commands, Raphael Giromini
Previous thread: [MUG] Weird behavior of Maple 6 under XP and NT, Rafal Ablamowicz
Next thread: [MUG] Re: Question about programming maple with graphic commands, Raphael Giromini
|
|
|