Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reliability of RAND() function
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00386726
Message ID:
00386996
Vues:
11
>>Is anyone aware of reliability checks of FoxPro's RAND() function to determine whether it adequately
>>simulates random numbers on the interval (0,1)? Thanks.
>
>Superficially, it looks pretty decent. I ran the code below and got the following results for 1M iterations:
>0.0 < 0.1    99,986
>0.1 < 0.2   100,275
>0.2 < 0.3   100,187
>0.3 < 0.4    99,832
>0.4 < 0.5   100,005
>0.5 < 0.6   100,122
>0.6 < 0.7   100,162
>0.7 < 0.8    99,847
>0.8 < 0.9    99,815
>0.9 <= 1.0   99,769
Danged PRE - here's a more readable post:

Yes, RAND() is good. I did some tests using SAS a couple years ago, and vfp RAND() came up a statistically very random Uniform distribution. I use it in statistical work without concern here.

Meanwhile, ironically SAS failed miserably with its equivalent Uniform random generator (and it's a statistical app). Pascal also had a bogus one, it would give the same second number each time after a restart, something like that :)

We have a professional procedeure developed by a bunch of statisticians here using prime numbers to generate random uniforms from mainframe days, but the vfp RAND() is probably just as good as that.
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform