Random Numbers with Probability Distribution in C

Discussion in 'C' started by FrankDrebon, Mar 15, 2008.

  1. FrankDrebon

    FrankDrebon New Member

    Joined:
    Mar 15, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. asadullah.ansari

    asadullah.ansari TechCake

    Joined:
    Jan 9, 2008
    Messages:
    356
    Likes Received:
    14
    Trophy Points:
    0
    Occupation:
    Developer
    Location:
    NOIDA
    You can search on net this . You can get free siurce code also.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice