|
![](/i/fill.gif) |
Kenneth wrote:
> Nicolas George <nicolas$george@salle-s.org> wrote:
>
>
>>You are asking two different kinds of problems here: the randomness of one
>>sequence versus the randomness of the mapping seed -> first term. The first
>>one is guaranteed (it would not be called rand() otherwise), not the first.
>>For all you know, the first term could be the seed itself.
>>
>
>
> I'm not sure I really understand that whole concept. (Long ago, Warp helped me
> out with a detailed discussion of the finer points of rand and seed; I need to
> revisit that post for a 'refresher course'.)
>
> Ken W.
>
I'm going to intrude here... This isn't anything new to this
discussion, but it's described a bit differently and might give you
another way to think about it.
The key is that the rand() function _should_ be seeded once and only
once. Then the _sequence_ of numbers it produces from that seed is
statistically random. (Pseudo random of course, but statistically
truely random.)
Your original approach continually re-seeded the rand() function which
would effectively override the normal random sequence. The patterns you
were seeing were due to the non-random selection of the seed values.
The techniques suggested to overcome this are ways of being able to
continue using the sequence produced by the rand() function from it's
one and only seed.
Make sense?
-=- Larry -=-
Post a reply to this message
|
![](/i/fill.gif) |