Results 1 to 3 of 3

Math Help - given a random number, output a number with predefined distribution

  1. #1
    Newbie
    Joined
    Dec 2012
    From
    NJ
    Posts
    3

    given a random number, output a number with predefined distribution

    Hello,

    I am working on a special effect for a video game. I want to mimic electricity moving through air from one point to another. To make the effect look realistic there needs to be some very random movements but along tightly controlled ranges.

    One of the ways I came up of doing this was to imagine a straight line between the two points then place jagged points on the left and right side of the line. These points will be connected by lines to make the jagged look of electricity. Now I want to position those points randomly within a range but with tendencies towards the middle of that range.

    Lets say that I place the points within 1 and 100 pixels away from the line. I could easily get a random point between 1 and 100, but instead i want have more numbers closer to the middle (50) then to the edges..... like a bell curve.

    Is there a formula I can use that when I input some random numbers (within a range) that I will get back a random number between 1 and 100 but with higher tendencies towards the middle?


    thanks
    jmart
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Sep 2012
    From
    Australia
    Posts
    3,612
    Thanks
    591

    Re: given a random number, output a number with predefined distribution

    Hey jmartrican.

    You can use a result to simulate a normal distribution given that you can simulate a uniform [0,1]:

    Inverse transform sampling - Wikipedia, the free encyclopedia
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Dec 2012
    From
    NJ
    Posts
    3

    Re: given a random number, output a number with predefined distribution

    Chiro,

    Thank you for the response. I'm gonna take a look at that. I was able to find an adequate solution using triangular distribution.

    thanks
    jmart
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: March 23rd 2012, 01:03 PM
  2. random number generation with normal distribution
    Posted in the Advanced Statistics Forum
    Replies: 3
    Last Post: January 9th 2012, 06:38 AM
  3. Random Number Generation
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: April 29th 2009, 12:13 AM
  4. Random Number Generation
    Posted in the Advanced Statistics Forum
    Replies: 2
    Last Post: April 25th 2009, 03:59 PM
  5. Random Number Generator
    Posted in the Math Challenge Problems Forum
    Replies: 3
    Last Post: October 22nd 2008, 12:22 AM

Search Tags


/mathhelpforum @mathhelpforum