random numbers

Discussion in 'Java' started by john.casey@gmail.com, Jun 16, 2005.

  1. Guest

    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
    http://hoschek.home.cern.ch/hoschek/colt/V1.0.3/doc/cern/jet/random/Distributions.html)
    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.
     
    , Jun 16, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. globalrev
    Replies:
    4
    Views:
    810
    Gabriel Genellina
    Apr 20, 2008
  2. Alex Untitled
    Replies:
    11
    Views:
    684
    Giampiero Zanchi
    Nov 16, 2009
  3. PerlFAQ Server

    FAQ 4.10 Why aren't my random numbers random?

    PerlFAQ Server, Feb 12, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    233
    PerlFAQ Server
    Feb 12, 2011
  4. PerlFAQ Server

    FAQ 4.10 Why aren't my random numbers random?

    PerlFAQ Server, Apr 27, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    269
    PerlFAQ Server
    Apr 27, 2011
  5. VK
    Replies:
    15
    Views:
    1,320
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page