Re: question about random generator
- From: "Antonio" <anconor@xxxxxxxxx>
- Date: 26 Jul 2005 07:34:35 -0700
Robert Gamble wrote:
> Antonio wrote:
> > pete wrote:
> > > Does "pseudo-random" mean the same thing as "uniformly distributed" ?
> >
> > Completely OT, but anyway... No, pseudo-random means that it looks like
> > it's random but it really isn't. There is no way to generate trully
> > random numbers with a computer, everything you do is deterministic, but
> > you can generate sequences that look like they're random but that
> > aren't. Hence the term _pseudo_-random.
>
> Yes, we know, you didn't say anything that wasn't completely obvious.
> The C Standard specifies that rand() generates pseudo-random numbers,
> the questions is whether a conforming implementation could generate a
> series of normal distributed numbers via the rand() function or if the
> term pseudo-random implies that the numbers must be generated with a
> uniform distribution. I was wondering the same thing myself, I think
> the intention is that the numbers be uniform but that may be debatable.
It may be completely obvious to you, and to many people (including
myself), but it doesn't seem to be obvious to "pete", since he asked.
What I was trying to explain is that pseudo-random does not imply
anything about the distribution of the numbers. You may get
pseudo-random numbers that look like a uniform distribution, or
pseudo-random numbers that look like a poisson distribution, or a
gaussian distribution, or anything you want. In fact if you are able to
generate pseudo-random numbers with any distribution, you can operate
with them to obtain any other distribution you want.
On the topic of wether the standard requires the distribution to be
uniform. Well I don't know the standard by hard, but many people here
seem to have a copy of it, so it should be a simple matter to check it.
Every implementation I've seen of C and almost any other language/tool
generates pseudo-random number using a multiplicative seed, simply
becase it's a good enough method and requires relatively few
operations.
And finally, I don't know if an implementation that generated normally
distributed numbers with the rand() function would conform to the
standard, but it would be beyond foolish.
.
- Follow-Ups:
- Re: question about random generator
- From: Peter Nilsson
- Re: question about random generator
- From: Robert Gamble
- Re: question about random generator
- References:
- question about random generator
- From: Marc Dansereau
- Re: question about random generator
- From: Eric Sosman
- Re: question about random generator
- From: Peter Nilsson
- Re: question about random generator
- From: Eric Sosman
- Re: question about random generator
- From: pete
- Re: question about random generator
- From: Antonio
- Re: question about random generator
- From: Robert Gamble
- question about random generator
- Prev by Date: Re: strcpy and strcat's return type
- Next by Date: Re: Token Parser
- Previous by thread: Re: question about random generator
- Next by thread: Re: question about random generator
- Index(es):
Relevant Pages
|