Mersenne Twister -- A Revised C++ Implementation

  • Thread starter Scott Robert Ladd
  • Start date
S

Stephen Howe

A random number generator that does not generate uniformly distributed
numbers is of very questionable use.

Not at all. I could have a random number generator returning doubles that
generates a random number between 0 and 1 with a Normal distribution, mean
0.5, standard deviation 1. I can think of a use for that. I can think of
other non-uniform random number generator distributions, all statistical
that are of use.

Your mathematical credentials are suspect. You seem to be way more
incompetent than the OP.

Stephen Howe
 
C

Carsten Hansen

Stephen Howe said:
Not at all. I could have a random number generator returning doubles that
generates a random number between 0 and 1 with a Normal distribution, mean
0.5, standard deviation 1. I can think of a use for that. I can think of
other non-uniform random number generator distributions, all statistical
that are of use.

Your mathematical credentials are suspect. You seem to be way more
incompetent than the OP.

Stephen Howe

A normal distribution has infinite range. So, generating random numbers
between 0 and 1 with a Normal distribution doesn't make sense.
Yes, you can have a truncated Normal distribution, but that is not what you
are writing.

I'm well aware that there are non-uniform random number distributions. In
the fall I corrected two errors in Knuth's Vol. 2 about non-uniform RNG. I
have the check to prove it.
I commented about the code which is intended to generate a uniform
distribution. I doesn't as others have pointed out.
As for my credentials, I have a Ph.D. in Mathematics (Penn State '89).

Carsten Hansen
 
S

Stephen Howe

A normal distribution has infinite range. So, generating random numbers
between 0 and 1 with a Normal distribution doesn't make sense.

It does if you are returning cumulative probabilites. So

_ x
|
p(x) = 1.0 / (sqrt (2.0 * pi))I exp(- (x * x) / 2.0)
_I
-Inf

That will lie between 0.0 and 1.0.

Stephen Howe
 
C

Carsten Hansen

Stephen Howe said:
It does if you are returning cumulative probabilites. So

_ x
|
p(x) = 1.0 / (sqrt (2.0 * pi))I exp(- (x * x) / 2.0)
_I
-Inf

That will lie between 0.0 and 1.0.

Stephen Howe

That is not a distribution. That is a probability. You don't generate that.
You calculate that.
You talked about generating random numbers between 0 and 1 with a Normal
distribution.
Now you are changing it to cumulative probabilities. Something very
different.
But nice try. Maybe you will get partial credit.

Carsten Hansen
 
C

Chris Theis

Carsten Hansen said:
That is not a distribution. That is a probability. You don't generate that.
You calculate that.

IMHO you also "calculate" numbers following a distribution, don´t you? I
mean we´re talking about distributions given in analytical form and not some
stochastic processes.
You talked about generating random numbers between 0 and 1 with a Normal
distribution.
Now you are changing it to cumulative probabilities. Something very
different.

To be exact he is talking about cumulative distributions (CDF) and not
cumulative probabilities, though in principle you are right as the
discussion is about PDF and not CDF.
But nice try. Maybe you will get partial credit.

Thanks :) But don´t you think that this discussion will lead to nowhere and
that comp.lang.c++ might not be the place to discuss statistical issues?

Regards
Chris
 
C

Carsten Hansen

Chris Theis said:
IMHO you also "calculate" numbers following a distribution, don´t you? I
mean we´re talking about distributions given in analytical form and not some
stochastic processes.


To be exact he is talking about cumulative distributions (CDF) and not
cumulative probabilities, though in principle you are right as the
discussion is about PDF and not CDF.


Thanks :) But don´t you think that this discussion will lead to nowhere and
that comp.lang.c++ might not be the place to discuss statistical issues?

Regards
Chris


Generating random numbers with a given distribution has a well-established
meaning. Generating random numbers with a Normal distribution between 0 and
1 doesn't makes sense. I'm not supposed to correct that?

Carsten Hansen
 
C

Chris Theis

[SNIP]
Generating random numbers with a given distribution has a well-established
meaning. Generating random numbers with a Normal distribution between 0 and
1 doesn't makes sense. I'm not supposed to correct that?

Carsten Hansen

Hi Carsten,

relax :) Of course you should correct wrong statements, this is the way
that people reading these postings are supposed to obtain wider & better
knowledge. However, I wouldn´t be so quick to say that generating a normal
distribution between 0 & 1 (Stephen proposed a mean value of 0.5) doesn´t
make sense. If you want to study for example a special case of a biased
Wiener-Levy process you might resort to such random numbers (whether this
study makes any sense or not is a different thing!).

Chris
 
C

Carsten Hansen

Chris Theis said:
[SNIP]
Generating random numbers with a given distribution has a well-established
meaning. Generating random numbers with a Normal distribution between 0 and
1 doesn't makes sense. I'm not supposed to correct that?

Carsten Hansen

Hi Carsten,

relax :) Of course you should correct wrong statements, this is the way
that people reading these postings are supposed to obtain wider & better
knowledge. However, I wouldn´t be so quick to say that generating a normal
distribution between 0 & 1 (Stephen proposed a mean value of 0.5) doesn´t
make sense. If you want to study for example a special case of a biased
Wiener-Levy process you might resort to such random numbers (whether this
study makes any sense or not is a different thing!).

Chris

Generating random numbers with a given distribution has a well-established
meaning.
Using that well-established meaning and given that a Normal distribution has
an infinite range, it does not make sense to talk about generating random
numbers with a Normal distribution between 0 and 1.
You can calculate other things. But if you use a well-established phrase,
you better qualify it.

That is all I'm saying.

Carsten Hansen
 
K

kevin collins

Carsten said:
Generating random numbers with a given distribution has a well-established
meaning.
Using that well-established meaning and given that a Normal distribution has
an infinite range, it does not make sense to talk about generating random
numbers with a Normal distribution between 0 and 1.
You can calculate other things. But if you use a well-established phrase,
you better qualify it.

I read Ladd's whole post as "good enough for government work". If I had
seen a similar thing in some high-falutin' mathematics journal, I would have
applied different standards. After all, the computers I have seen have
been unable to express infinity in a reasonable fashion, anyway, one of the
popular OSes limits RAM to only 2^29 bytes. Computers of the kind being
discussed here (that is, a machine, not a human) deal with approximations
for the real numbers encountered in the field of mathematics. C++, as used
here, does not deal with symbolic mathematics.

I saw, and see, no reason for further qualification as to the use of the
phrase, considering the context in which it was provided.

It is pretty clear that you are the kind of person that has to have the last
word. So post it, I don't expect to express any answer.
 
C

Carsten Hansen

kevin collins said:
I read Ladd's whole post as "good enough for government work". If I had
seen a similar thing in some high-falutin' mathematics journal, I would have
applied different standards. After all, the computers I have seen have
been unable to express infinity in a reasonable fashion, anyway, one of the
popular OSes limits RAM to only 2^29 bytes. Computers of the kind being
discussed here (that is, a machine, not a human) deal with approximations
for the real numbers encountered in the field of mathematics. C++, as used
here, does not deal with symbolic mathematics.

I saw, and see, no reason for further qualification as to the use of the
phrase, considering the context in which it was provided.

It is pretty clear that you are the kind of person that has to have the last
word. So post it, I don't expect to express any answer.

This has nothing to do with how big a number you can represent on a
computer. When you have an infinite range and you claim it falls between 0
and 1 you are talking nonsense.

Carsten Hansen
 
C

Chris Theis

Carsten Hansen said:
This has nothing to do with how big a number you can represent on a
computer. When you have an infinite range and you claim it falls between 0
and 1 you are talking nonsense.

Okay if you want to stick to knit-picking then so be it. Stephen never
claimed that the infinite range falls between 0 and 1. He was only talking
about a normal distribution with mean 0.5 between the limits of 0 and 1. It
is of course correct that the Stiltjes-integral applied in mathematical
statistics is defined from -\inf to \inf. However, if you want to calculate
anything reasonable you will have to specify limits as infinity is a
mathematical construct that doesn´t play very well with practical
applications (to see this we only have to resort to Quantum Mechanics, which
is OT here and I don´t wanna get into that now). Specifying limits does
bring us back to numerical accuracy which depends on your machine and
therefore any applied limit is valid (see my previous post about the
Wiener-Levy process).

Regards
Chris
 
C

Carsten Hansen

Chris Theis said:
Okay if you want to stick to knit-picking then so be it. Stephen never
claimed that the infinite range falls between 0 and 1. He was only talking
about a normal distribution with mean 0.5 between the limits of 0 and 1. It
is of course correct that the Stiltjes-integral applied in mathematical
statistics is defined from -\inf to \inf. However, if you want to calculate
anything reasonable you will have to specify limits as infinity is a
mathematical construct that doesn´t play very well with practical
applications (to see this we only have to resort to Quantum Mechanics, which
is OT here and I don´t wanna get into that now). Specifying limits does
bring us back to numerical accuracy which depends on your machine and
therefore any applied limit is valid (see my previous post about the
Wiener-Levy process).

Regards
Chris

You can have a truncated normal distribution. If you do, you specify the
mean, the standard deviation and the limits for the truncation.
That is fine. But that is not what Stephen wrote. He is calculating
something else (a cumulative probability).
Using the same name, generating random numbers with a Normal distribution,
for two different things is confusing and misleading.
There are no numerical accuracy issues here.

Carsten Hansen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top