Re: 1. (vol60, i4) Re: how to build a really working random seed ? (Marcel) (James Gere)
James Gere <[email protected]>
| Newsgroups | gmane.comp.lang.forth.gforth |
|---|---|
| Message-ID | <CAB21L-0hmLEFN1BFbU1U8Pz+tpG7t1gYLfVXcJ5i+GdSCZBS2w@mail.gmail.com> |
Dear Marcel,
maybe that last was too terse.
The point is, verifying the rnd function returns all non-zero numbers,
is of linear order ( or less). I take it you checked the period of the
(rnd)->(rnd)' function and found it to be, 2^32-1, for a non-zero value.
This and 0->0 are enough to prove that (rnd)->(rnd)' is 1-to-1.
(rnd)->(rnd)' is of the form:
(rnd)' = G( F( (rnd) ) )
. The form of the take-off function, rnd, is:
rnd = F( (rnd) )
. As long as F() is 1-to-1, all values of (rnd) will also eventually be
returned by rnd. So, you need only check that the period of F()-iterated
is 2^32-1 for a nonzero argument.
Sincerely,
James Gere