Random Numbers with Probability Distribution in C

Newbie Member
15Mar2008,16:59   #1
FrankDrebon's Avatar
Hi all,

Does anyone have any experience with generating random numbers that distribute themselves according to a given probability distribution?

I am having trouble finding information on how to do this. I can find subroutines that output random numbers that conform to Gaussian distributions and other standard distributions but would like to generate random numbers based on the Maxwell Speed Distribution (proportional to x^2 exp(-x^2)).

Any advice would be appreciated.

Many thanks,

FD
TechCake
17Mar2008,14:42   #2
asadullah.ansari's Avatar
You can search on net this . You can get free siurce code also.