Adept Scientific - English
The world's best software and hardware 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  
UKdedksvnofi
Home
Products
Training
Events
 Buy Online
Downloads
Academic Discounts
Support
My Adept
International |  About Us |  Adept Scientific Blog |  Contact Us |  Press Room |  Jobs
Adept Scientific on Facebook Adept Scientific on Twitter Adept Scientific on YouBube Adept Scientific on LinkedIn


The Next Steps

• Ask us a question
• Watch Maple Video Demonstrations
• Buy Maple Now
• View Maple Pricing
• Download a Brochure
• Request a Brochure
• Request an Evaluation
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 16 Overview
Maple 16 Professional
Maple 16 Academic
Maple 16 Student Use
What's New in Maple 16
Maple New Features
Datasheet

Maple History
Recorded Online Seminars

MapleSim
MapleNet
Maple T.A.
BlockImporter™
Maple Toolboxes

Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

Latest Information

New Features: Professional
New Features: Academic
Maple Features
The Maple Reporter Online

Service & Support

Maple Primes
blogs, forums etc

Elite Maintenance Program
Application Centre
Powertools
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] Re: Does the rand() function really give random numbers?

Search email archive for  

[MUG] Re: Does the rand() function really give random numbers?
Author: Maple Group    Posted: 29/01/2001 19:08:54 GMT
Subject: Does the rand() function really give random numbers?


"Random number generators" on computers are almost always actually
pseudo-random number generators. They produce a sequence of numbers
using a deterministic algorithm. If you use the same seed to start
the "random" number generator, you always get the same sequence. This
can be either good or bad, depending on your point of view. Maple
always starts the seed off at 1. If you use the "randomize" function
with no argument, it will set the seed to a value based on the system
clock, and the subsequent sequence of "random" numbers will be different.
But if you want "numbers that really ARE random", it basically can't be
done in software.

Robert Israel
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Thu, 25 Jan 2001 21:19:32 -0500 (EST)
From: Edwin Clark
To: Nathan Sokalski
Subject: Does the rand() function really give random numbers?


Well, the short answer is that you cannot. Many will
probably send you the famous statement of von Neumann:

Anyone who considers arithmetical methods of producing
random numbers is, of course, in a state of sin.

The Maple rand operator is essentially a linear
congruential generator. For a useful and entertaining
introduction to such matters see Knuth's book
The Art of Computer Programming Vol 2--from which
the above quote was taken. By the way, I once previously
raised the question of exactly how good the Maple
rand operator is on this forum and got no replies.
So maybe there are no experts on (pseudo) random
number generators on this list?

--Edwin Clark
------------------------------------------------------
W. Edwin Clark, Math Dept, University of South Florida,
http://www.math.usf.edu/~eclark/
------------------------------------------------------
God created the null set and brackets; all the rest
is the work of Man.--Kronecker [updated by Paul Chernoff]
------------------------------------------------------



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Thu, 25 Jan 2001 21:30:30 -0500 (EST)
From: Carl DeVore
To:
Subject: Does the rand() function really give random numbers?


The random number sequence is simply an arithmetic progression
r[1], r[2], ..., r[n]
of finite length over a finite field with a very large characteristic. In
other words, the formula is
r[k+1]:= (a * r[k]) mod p
where a and p are very large hard-coded integers. You can print out the
very simple code for "rand" and see for yourself:
> interface(verboseproc= 3);
> print(rand);

The starting place in the sequence is determined by a global variable
named _seed. After you do a restart, _seed is set to 1. The procedure
"randomize" will set the value of _seed to some value based on the
computer's clock. So the easy solution to your problem is to once, in the
initialization code of your program, put the command "randomize();".

If you are using Maple to solve MasterMind logic problems, then I am very
interested in your project. Please tell me about it.

Carl Devore
University of Delaware



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Fri, 26 Jan 2001 08:21:12 +0100
From: Heike Koch-Beuttenmueller
To:
Subject: Does the rand() function really give random numbers?

It is normal thath the rand() - functions give the same sequence of
random numbers. For testing programs it is very useful of course. To get
different starting values , you can use randomize , for example:

restart;rand();

427419669081

> Seed:=randomize();

Seed := 980493650

> for i from 1 to 10 do
> rand();
> end do;

423631740631

701796052445

693596754556

242124931457

749125719897

963739144968

159578065105

515648360085

115409797637

254328354262

Mit freundlichen Gruessen

Heike Koch-Beuttenmueller

[View Complete Thread]



Previous by date: [MUG] integral - correct for evalf(Int(f)), incorrect for int(f),  Robert J Gooding
Next by date: [MUG] Re: Listing all variables, Maple Group
Previous thread: [MUG] logical operations in maple, Guy-Armand Kamendje
Next thread: [MUG] Listing all variables, Francois DEBROUCKE



Ready to buy?

For more pricing information:
Visit our webstore, call us on +1 800 724 8380 or email us at info@adeptscience.com

Featured Downloads

Maple 16 & MapleSim 5 Professional Brochure
Maple 16 Academic Datasheet
Maple 16 & MapleSim 5 Academic Brochure
Maple 16 What is New datasheet
Maple 16 Professional Datasheet
Maple Whitepaper: Driving Innovation - How mathematical modeling and optimisation increase efficiency and productivity in vehicle design.
MapleSim Whitepaper - Technological Superiority in Multi-Domain Physical Modelling and Simulation

Latest Downloads

Maple 16 Programming Guide
Maple 16 User Manual
Maple 16 Academic Datasheet
Maple 16 Professional Datasheet
Maple 16 & MapleSim 5 Academic Brochure

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

Latest News

Connectivity to major CAD systems extended in Maple 16
MapleSim Breaks New Ground in Hardware-in-the-Loop real-time simulation for planetary rovers
MapleSim Breaks New Ground in Hardware-in-the-Loop real-time simulation for planetary rovers
Maths software usability reaches new heights with Maple 16
"MapleSim was an eye-opener for us.
adept

Top of the Page

Popular Links: ChemDraw | ChemOffice | Data Acquisition | Data Analysis | EndNote | Maple | MapleSim | Mathcad | MathType | Quality Analyst | Reference Manager | VisSim

EU ePrivacy Directive | Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2012, Adept Scientific plc.
Site designed and maintained by Lyndon Ash

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