Re: the "hat" container class [C++]
From: Gerry Quinn (gerryq_at_DELETETHISindigo.ie)
Date: 05/29/04
- Next message: q_at_q.com: "Re: [OT] The Year 2038 Problem"
- Previous message: Ian Woods: "Re: RFC: wideline algorithm"
- In reply to: Michael Wojcik: "Re: the "hat" container class [C++]"
- Next in thread: Michael Wojcik: "Re: the "hat" container class [C++]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 29 May 2004 13:00:29 +0100
In article <c98eb501tnq@news4.newsguy.com>, mwojcik@newsguy.com says...
>
> In article <MPG.1b214e016f910486989682@news.indigo.ie>, Gerry Quinn <gerryq@DELETETHISindigo.ie> writes:
> >
> > Note that this is potentially an issue with ALL pseudo-random number
> > generators, however sophisticated. While some generators might not
> > return similar values at startup, any of them seeded with values from a
> > small range will return only a relatively small set of possible
> > sequences.
> >
> > I wonder how many of those who scorn rand() and insist on the benefits
> > of fancy pseudo-random generators are aware of this?
>
> Obviously, anyone who worries about a PRNG without understanding
> seeding is ignorant.
Like this person?
<<< QUOTE >>>
(An aside: I don't have the post you quoted, but invoking rand
twice and discarding the values after srand(time(NULL)) looks
like cargo cult programming to me. I don't know what practical
value it's meant to have.)
<<< END QUOTE >>>
> On the other hand, remarks like "any [generator] seeded with values
> from a small range will return only a relatively small set of
> possible sequences" suggest that perhaps the stones are not yours to
> throw.
>
> Clearly, the best any PRNG can do is generate as many sequences as
> there are possible seed values, where the "seed" is the portion of
> the PRNG's internal state that can be set by any mechanism outside
> the generator itself. That's all the entropy it has available to
> select a sequence. No need to waffle about "relatively small sets".
But if the seed value is set from a small range of values, the amount of
entropy theoretically available to the PRNG is largely irrelevant,
because only some of it is used. And automagically finding seeds much
better than the current time is non-trivial.
> I'd hope that most of the programmers sophisticated enough to know
> that there are choices of PRNGs would also understand this very basic
> concept. But I've been disappointed before.
A quick Google search shows that, by default, Mathematica seeds its
random number generator with the time of day. I think that is
sufficient proof that inadequate seeding is commonplace, perhaps the
norm.
But of course, we don't have to go as far as the Wolfram Institute to
prove this - your remark about "cargo cult programming" on this thread
demonstrated, as do the remarks to which I am now responding, that your
enthusiasm for pontification should be restrained until your knowledge
of the subject, at least in its practical aspects, is a little greater.
- Gerry Quinn
- Next message: q_at_q.com: "Re: [OT] The Year 2038 Problem"
- Previous message: Ian Woods: "Re: RFC: wideline algorithm"
- In reply to: Michael Wojcik: "Re: the "hat" container class [C++]"
- Next in thread: Michael Wojcik: "Re: the "hat" container class [C++]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|