Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating non-uniform random numbers [closed]

Can you tell me any ways to generate non-uniform random numbers?
I am using Java but the code examples can be in whatever you want.

One way is to create a skewed distribution by adding two uniform random numbers together (i.e. rolling 2 dice).

like image 273
Robert Greiner Avatar asked Jun 10 '09 18:06

Robert Greiner


1 Answers

Try generating uniformly distributed random numbers, then applying your inverted non-uniform cumulative distribution function to each of them.

like image 102
Paul Sonier Avatar answered Oct 26 '22 00:10

Paul Sonier