# Question: Using random numbers

September 09 2012 by
false

1

I have been using random numbers in other applications than Maple. Usually there is a function, which will give a pseudo random real number between 0 and 1. When I looked for it in Maple I got quite confused, because there are a lot of different options here - obviously because Maple can deliver random numbers/objects in many ways, even following a certain distrubution. I found out it doesn't work by just using rand(), since it is always starting with the same value. Then I found the command randomize() to fix this problem ...

I only need Maple to generate a series of real numbers between 0 and 1, one at a time. I have considered the following:

> restart;
> randomize();
> rand()/(1000000000000.);

But I found another way to do it, using a special package:

> restart;
> with(RandomTools[MersenneTwister]);
> randomize();
> GenerateFloat();

My question: Which one is preferable? Are they calculated equally fast? I will be delighted for any comments, which can clarify the situation for me.

NB! I need the numbers to come from a uniform distribution in the interval [0,1).

Erik