View Single Post
  #5   Report Post  
 
Posts: n/a
Default

Allie wrote:

I've been trying to generate random numbers using excel's random number
generator in the analysis toolpak. I'm using Uniform number generation
between 0 and 1, and I am using a random seed, as I would like to be able to
re-generate the same numbers in the future.

Using seeds from 1 to 10, when i fill a range of 16 cells with random
numbers, the first cell filled is always the lowest. This is an extremely
unlikely circumstance with a true RN generator.


Not at all.

First, because you are seeding the RNG, it is not
"a true RNG" at all. The sequence is predictable
and repeatable, which is your intention.

Second, if we knew the RNG algorithm, it might not
be surprising at all that a low seed (1 to 10) might
generate a very low number initially, perhaps even
the lowest value a small set (16) of numbers.

In fact, if you increase the set to 100 with a seed
of 10, the first number is not the smallest. The
same is true of a set of 16 numbers if you choose a
large seed, e.g. 10000.

MS Excel documentation should offer some guidance for
choosing a seed. It can greatly affect not only the
range of numbers generated, but also the apparent
randomness (distribution over the range) of at least
the first small set of numbers. I do not find any
such guidance in the Help text.

In any case, all of this is common to all RNGs. An
RNG simply uses a recursive mathematical formula.
For example, a linear congruential method might use
the formula X[n+1] = (a*X[n] + c) mod m, where X[0]
is the seed or a deterministic function of the seed
(apparently the latter for the ATP RNG, since its
seed must be an integer), and a, c and m are chosen
by the RNG designer, hopefully based on the plethora
of research literature on the subject. For an
introduction, see Knuth, Art of Computer Programming,
vol 2 (Seminumerical Algorithms).

I hope this gives you some insight into your observation.
If it bothers you (I don't know why it would), choose
a different seed or generate a larger set of numbers.