On 29/12/07 15:38, "Andrew Kappy" <[EMAIL PROTECTED]> wrote:
> I'm looking for help with two random number problems. > > 1. I need to generate 750,000 alpha-numerics, 6 characters long, > excluding certain letters. I have no problem generating as many random > numbers as I want, using the RANDOM function, but getting down to 6 > alpha-numerics without duplicates is the problem. I've generated 1.5 > million random numbers and translated them to integers. I've also > built a numbered table of included alpha characters. I've tried > various calculations to grab 4 numbers from the larger random number > and combine them with two of the letters via calculations. The result > is way too many duplicates. > > 2. I need to generate over 10,000 records of 24 fields, with the > numbers 1-24 (or letters A-X) randomly distributed through each > record, with no repeats within a record and no distribution repeated > within the 10,000 records. > > Any suggestions will be greatly appreciated. Andy I think you've had plenty of suggestions as to how this might be achieved. However, I just wanted to draw attention to one issue -- probably an insignificant one. You suggest that you want a set of random numbers without duplicates. If you REALLY want random numbers, then you cannot apply such conditions. A set of random numbers may include duplicates; you cannot specify that there are "too many" duplicates in a particular set of random numbers. Now, for your purposes, you are quite likely happy with a looser meaning of the word random; that's fine. I just wanted to point out that you are not going to end up with a true set of random numbers -- the distribution will have a very, very slight bias. On the other hand, I believe it's also true to say that you won't end up with true random numbers if you use the RANDOM function. I'd suppose the only way to be sure of a really random number is to base it on something like radioactive decay. Steve
