commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Renaud, Martin" <>
Subject [Math] Generate pseudo random number that obey a given distribution
Date Thu, 20 May 2010 22:04:30 GMT


I didn't for that in the doc, so maybe I'm asking the wrong question.
Tell me if it's the case.


I would like to generate random numbers that fits a given distribution.


The code I'd like to write:


Distribution distribution = new NormalDistributionImpl(); // this exists
so far...

RandomGenerator generator = new DistributionGenerator(distribution); //
this subclass does not exist.



Doing a graph with many values obtained with generator.nextDouble()
would give me a nice bell-curve. Other distribution could also be used.


Is this is possible or I'm asking something that is mathematically or
computationally impossible... ? 


Thanks for your input,



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message