Adept Scientific - English
The world's best software for research, science and engineering.
flag arrow
clearclear
 

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKusdedksvnofi
Home
Products
Training
Consultancy
 Buy Online
Downloads
Education
Support
My Adept
International |  About Us |  Contact Us |  Press Room |  Jobs


The Next Steps

• Ask us a question
• Maple Product Tour
• Buy Maple Now
• View Maple Pricing
• Find out about Online Training
• Download a Brochure
• Request a Brochure
• Download a Demo
• Request a Demo
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 11 Professional
Maple 11 Academic
Maple 11 Student Use
Recorded Online Seminars
FREE Training Resources


MapleNet
Maple T.A.
MapleConnect
BlockImporter for Simulink
BlockBuilder for Simulink
Maple Toolboxes
Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

View Maple 10 in Action
Product Comparison Chart

Latest Information

New Features: Professional
New Features: Academic
The Maple Reporter
The Maple Reporter Online
Numerical Algorithms Group
(NAG)


Service & Support

Maple 10 Training Videos
MaplePrimes, blogs, forums
Elite Maintenance Program
Application Centre
Powertools
Maple User Group (MUG)
Join the Maple User Group
(MUG)

Search the Knowledge Base
Technical Support request

List Archives >  Maple User Group List Archive >  Archive by date >  This Month By Date >  This Month By Topic

[MUG] Maple and PseudoRandomGenerator

Search email archive for  

[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



Ready to buy?

Maple - single user licence
Add to shopping basket
$ 1,895.00
Upgrade to Maple 12 from v11
Add to shopping basket
$ 995.00
Upgrade to Maple 12 from v10 & below
Add to shopping basket
$ 1,395.00

Featured Downloads

Maple White Paper: Technical Knowledge - An Asset You Can Afford to Lose?
Maple in Electronics Application Pack
Maple in Robotics & Aerospace Application Pack
Maple in Finance Application Pack

Product Reviews

"Without the Maple software, we would have to spend weeks generating the equations of motion for every experiment. Then the chances that we did it right would basically be near zero. There would always be a mistake somewhere. It is very difficult to set up a dynamic motion model by hand."
- Jean-Claude PiedBeouf, Ph.D Manager of Robotics, Canadian Space Agency

"Its very good - highly accurate and easy to use. The speed of Maple allows me to change equations and quickly reintegrate them into the application, so more possibilities can be explored to achieve the precise effect desired."
Shawn Neely, Senior R & D Director for PDI/Dreamworks
adept

Top of the Page

Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2007, Adept Scientific plc.
Site designed and maintained by Adeptise

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055