[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Help-gsl] Random number generation
From: |
Abbas Alhakim |
Subject: |
RE: [Help-gsl] Random number generation |
Date: |
Tue, 5 May 2009 15:39:16 -0400 |
Hi,
Here I don't see why you want to change the seed:
It seems to me that each iteration of your "loop?" will generate 600
Gaussians and, if you don't do anything but call the RNG, this will
produce distinct variables. Verify this by writing the first number out
of each 600 numbers and comparing them!
In other words, if you don't change the seeds you are guaranteed that
all the random nums are distinct. Putting different seeds randomly
however (such as when using the time) there is a (slight) chance that
you generate the same numbers.
Abbas
-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Vibhuti Dave
Sent: Tuesday, May 05, 2009 12:46 PM
To: address@hidden
Subject: [Help-gsl] Random number generation
Hi,
I am trying to generate a random sequence of numbers that have a
Gaussian
distribution with mean 0 and standard deviation of 1.
My code is attached. It is a simple code since I am beginner at
programming
and also using the GSL library for the first time. I need to run this
code a
1000 times. Each time, i want the code to generate 600 random numbers
with a
Gaussian distribution as specified above. My question is, is there a way
to
change the seed for the random function generator besides changing it at
command line. I cant run the code manually a 1000 times to make sure
that i
get to change the seed.
Any help would be appreciated, thanks
Vibhuti