Date: Tue, 14 Sep 2010 10:24:00 +0100 Reply-To: John Whittington Sender: "SAS(r) Discussion" From: John Whittington Subject: Re: how to generate 1 to 100k random numbers without zeros? Comments: To: Dale McLerran In-Reply-To: <348274.79769.qm@web32403.mail.mud.yahoo.com> Content-Type: text/plain; charset="us-ascii"; format=flowed At 20:14 13/09/2010 -0700, Dale McLerran wrote: >Dan and John are both correct in their arguments. I was not >applying the INT function, but rather a ROUND function in >presenting probabilities. With ROUND(N*ranuni(seed)), values >can range from 0 through N. Probabilities of 0 and N would >be 1/(2N) and probabilities of integer values between 0 and N >would be 1/N. But with the INT(N*ranuni(seed)), values can >only range from 0 through N-1. Every integer in that range >would have probability 1/N. >Mea culpa, Thanks for confirming that I wasn't going mad - when you wrote INT, I thought you meant INT :-) Kind Regards, John ---------------------------------------------------------------- Dr John Whittington, Voice: +44 (0) 1296 730225 Mediscience Services Fax: +44 (0) 1296 738893 Twyford Manor, Twyford, E-mail: John.W@mediscience.co.uk Buckingham MK18 4EL, UK ----------------------------------------------------------------

Back to: Top of message | Previous page | Main SAS-L page