null character without reason in written files
N.M. Maclaren
nmm1@cam.ac.uk
Thu Oct 31 22:48:00 GMT 2013
On Oct 31 2013, Daniel Molina García wrote:
>>
>> > Recipe: do a simple program printing numbers between 0 and 1 and plot
>> > them, with the x-coordinate being the order in which they appears and
>> > y the number you got. You should see a solid (at least, uniform)
>> > rectangle with the color of the dots, but instead, you will find some
>> > "roads of vaccum": values that almost never will appear.
>>
>> I suspect that you are confusing randomness and uniformity.
>
>I used the word uniform in context of filling a rectangle, equivalently
>to homogeneous.
That is what I thought. That is describing a form of quasi-randomness;
it is not equivalent to randomness, and should not be delivered by a
good pseudo-random number generator.
>It is an important characteristic of a rng. Usually one checks if the
>random number is in a given interval, and then you do something.
>Uniformity is important then. In fact, gsl functions for getting random
>numbers are called "get_uniform".
The term 'uniform' refers to the underlying distribution, and not to
the sample you obtain. Indeed, if you get an apparently uniform sample,
you can be sure that the generator is statistically poor. You will get
an apparently uniform sample only from an appropriate quasi-random number
generator.
Somebody a long time ago (1970s, I think) showed a collection of samples
to statisticians, asking which ones corresponded to a U(0,1) distribution,
which is uniformly distributed from a PDF that is constant in the range
0 to 1. ALL of the statisticians pointed at ones that were more uniform
than the ones actually generated from a U(0,1) distribution.
This is a very deceptive area, and testing by eyeballing is very
unreliable unless you are an expert. I am pretty rusty, but I used to
be one, and I would not trust my own visual judgement (except when
faced with things like RANDU, of course).
Regards,
Nick Maclaren.
More information about the Fortran
mailing list