Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Oct 1996 12:15:01 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        phk@critter.tfs.com (Poul-Henning Kamp)
Cc:        terry@lambert.org, ache@nagual.ru, rkw@dataplex.net, freebsd-hackers@freebsd.org
Subject:   Re: I plan to change random() for -current (was Re: rand() and random())
Message-ID:  <199610071915.MAA14666@phaeton.artisoft.com>
In-Reply-To: <1877.844713458@critter.tfs.com> from "Poul-Henning Kamp" at Oct 7, 96 08:37:38 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> I happen to know that branch physics quite well too, so I have a
> couple of comments to your ravings here:
> 
> First, You would be awarded the IG Nobel prize if you seriously 
> tried to publish studies of the kind you propose without having 
> 100% control over and a very good study backing the random-generator 
> you use.

The random number generator being used for the calculations I've
referenced is the rand48 linear congruential generator.  It has a
period well below the number of events being studied.

I believe the linear congruential generator has been well studied,
and the mathematical foundation for it is well known and well
accepted.

My worry is that it will be considered "a matter of degree" when the
next change goes on to impact rand48.  There is also the possibility
(admittedly small) that the current random and rand functions are
being used for similar purposes.  As long as the possiility exists,
it is important to consider it in the decision.


> In particular, running that kind of "experiments" with the kind of
> low-grade random-generators we have in FreeBSD, and the number of
> events you talk about, would reveal noting more than how lousy our
> random generators are, and people who need to know that, have 
> learned their lesson by now.

Clearly, it depends on the generator being used.  However, it is the
principle which is at stake.  Mathematically important aspects of the
system should not be changed on whimsey.

> And quite frankly, I don't think anybody really runs too many of 
> those experiments anymore, since fast and high-quality random-
> generators that can keep up with the wacko ideas that people want
> "tested" in bigger and bigger scenes have just not materialized.
> 
> Finally, if they want to "reproduce" the "experiment" it has for
> several years been recognized as far more interesting to reproduce 
> with a different random-generator, to see if the result may have 
> been mangled by a bad choice of random-generator in the first place.

You pick your generator based on period, and you rerun the experiment
using different seeding to eliminate artifacts.

In physics, you should know the expected results before you run the
experiment.

> So there: be serious please  :-)

Here is a quote from another physicist who has sent me a sidebar
comment.  Since it was private email, I have removed identification:


| I depend upon the current behavior of the rand48 family of functions
| for Monte Carlo studies of systems of hard-shell ions and for
| thermal motion studies. Whether the work is important is in the
| eye of the beholder.
| 
| If the behavior is changed, it just means that I get to make sure
| that I use a locally constructed library and mutter more about
| hackers.

This was not the only physicist who has sidebarred me, and a number
of mathematicians and physical chemists and at least one X-ray
crystallographer have also chimed in.


> You have to be more careful, you have already used your quota of 
> "See all this fancy stuff I know, don't you think I'm a really 
> cool & bright guy?" posting quota for all of october now...

The intent of the postings was to get people to consider the
correctness with regard to other issues than simply "making the GIMP
people happy".  I quoted from my own experience because that is what
I have available.  Sorry if that seemed to be "horn tooting".  Very
obviously, I wouldn't have said anything if there had been no proposed
change to bang on my danger button in the first place.  It is a
reaction, not evidence of hubris.


> If our random seed function sucks, we can and should fix it.

Agreed.  Does it suck?  Why?  And if it does suck and we replace it,
isn't it a sufficiently sensitive area that a change should be chimed
from the rooftops?  This isn't like the bcopy changes, which are really
irrelevant to anyone not interested in squeezing the shorts of benchmarks,
since all they do is move data from area one to area two -- it's really
irrelevant how they do it as long as it gets done reliably.  Mathematical
dependencies on random calculations, however, *do* care about method.

> And I think we should actually add a function that would seed it
> from /dev/random if people want random numbers, for instance
> for games.

Yes.  Games seem to be a terrible reason to potentially break serious
use of a platform.

					Regards,
					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610071915.MAA14666>