Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > random numbers

Thread Tools

random numbers
Posts: n/a
Dear All,

I was wondering if any one might help explain what is the best way to
generate random variables that are distributed according to a zipf
distribution with a slope of -1 and an output range of 1 to 30. I have
tried using cern's cern.jet.random.Distributions nextZipfInt(... ) (see
but the output of this generator is severely clipped if I attempt to
change the output range using a simple rejection loop for variates not
in the range 1 to 30. I have also tried generating a series of data
points that are derived using zipf's law and have been able to
uniformly at random sample these values. This method seems to work
quite well, and the distribution of sampled values better approximates
zipf's law than using the cern random generator. In terms of
methodology is this method acceptable?? it seems to be a bit of a
kludge to me. But I am having difficulty finding a better solution.

Any ideas ?? thanks.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 4.10 Why aren't my random numbers random? PerlFAQ Server Perl Misc 0 04-27-2011 04:00 AM
FAQ 4.10 Why aren't my random numbers random? PerlFAQ Server Perl Misc 0 02-12-2011 11:00 PM
Math.random() and Math.round(Math.random()) and Math.floor(Math.random()*2) VK Javascript 15 05-02-2010 03:43 PM
How do I get a random number between two random numbers? Alex Untitled Ruby 11 11-16-2009 09:45 AM
random.random(), random not defined!? globalrev Python 4 04-20-2008 08:12 AM