Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random numbers - the most efficient way
Message
 
 
To
08/09/2004 02:28:33
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00939849
Message ID:
00940292
Views:
21
Al,

Sorry but you need to go back to school and study random sampling theory. You have imposed a time of acquisition dependency on your sample.

A uniform random sample must give every record the same probability of being selected. With what you propose only the first record meets this condition.

>This may be beating the topic to death - but here's another idea, anyways:
>
>If your data are truly random, then to get 40 random values, all you need to do is pick a random start point, then select the next 40 records! Those 40 records will be as random as any 40 you could pick "randomly". (You'd have to handle the case where your start point was near the end of the file by wrapping back around to the beginning).
>
>Suppose, for example, you're a telco and you're tracking the starting datetime of cell phone calls placed in Manhattan. If you want to hand out prizes to 40 random subscribers, picking a start datetime and selecting the next 40 records will likely be just as random as picking 40 random datetimes. In both cases you'd have to prevent duplicates, of course.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform