Re: question about random generator



Robert Gamble wrote:
> Antonio wrote:
> > 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.
>
> You are missing the point. The standard only states that the numbers
> generated are "pseudo-random", pete knows this, I know this, anyone who
> has a copy of the Standard knows this. He was specifically refering to
> this wording in the Standard and asking if this requirement alone
> implied a uniform disribution since the Standard does not discuss
> distribution requirements.
>


Then I have already answered your question. No, in no way pseudo-random
implies a uniform distribution. If the point is wether the creators of
the standard had a uniform distribution in mind when they phrased the
standard, well I wasn't one of them and AFAIK neither were you, so we
could talk for ages and still get to no conclusion.

If the standard just says that rand() generates pseudo-random integer
numbers between 0 and RAND_MAX >= 32767, then it says that, and only
that. If no reference to a certain distribution is made any
distribuiton would be valid. Of course the requirement that the values
must be within a certain range rules out lots of distributions
(poisson, gauss, Student-t, chi^2, cauchy...). So, from my POV, a
rand() function that returned 0 with p probability and 32767 with (1 -
p) probability would conform to the standard... while beeing almost
totally useless.

.



Relevant Pages

  • Re: question about random generator
    ... pseudo-random means that it looks like ... > uniform distribution. ... anything about the distribution of the numbers. ... On the topic of wether the standard requires the distribution to be ...
    (comp.lang.c)
  • Re: Confidence interval
    ... mean will be 0 and standard deviation is 1. ... distribution for tolerance limits and acceptability. ... Your opinion IS the method, whether you call it mathematical or not. ... Bayesian statistics is based on the PERSONAL or SUBJECTIVE ...
    (sci.stat.consult)
  • Re: random numbers from a lognormal distribution
    ... >Shouldn't that be "If X is a standard normal variate then ... and standard deviation from the normal distribution to the lognormal ... functions, and for any non-decreasing function g, the percentiles ... In particular, if m is the median of a normal distribution, then ln ...
    (sci.stat.math)
  • Re: Thoughts on some stdlib modules
    ... makes no sense to make the Python standard distribution like this. ... not an OS and cannot control all of the little factors that make package management feasible for ... As a side note, with the Numeric/numarray unification, the Numeric ...
    (comp.lang.python)
  • Re: question about random generator
    ... >> The C Standard specifies that randgenerates pseudo-random numbers, ... >> the intention is that the numbers be uniform but that may be debatable. ... > anything about the distribution of the numbers. ...
    (comp.lang.c)