+ Reply to Thread
Results 1 to 2 of 2

Custom Distribution? (Assign specific probability to generate random numbers)

  1. #1
    Registered User
    Join Date
    03-25-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    3

    Custom Distribution? (Assign specific probability to generate random numbers)

    Hey guys
    I need to generate random numbers but with a custom distribution, for example generate a random number in a cell with numbers from 1 to 9 (except 3) with different probabilities.

    1 and 9 = 5% (each)
    2, 6, 7 and 8 = 10% (each)
    4 = 20%
    5 = 30%
    Total = 100%

    And on another cell
    1 = 19.701%
    0 = 80.299%
    Total = 100%

    ----------------------------------
    If is not too much...
    I also need to generate two more random numbers.
    Normal distribution
    Mean =2000
    Standard Deviation = 400

    Uniform Distribution
    Range 10000 to 35000

    Thank you so much for taking the time!
    Last edited by eduardo081092; 03-26-2013 at 06:30 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Custom Distribution? (Assign specific probability to generate random numbers)

    Try this for your first formula

    =LOOKUP(RANDBETWEEN(1,100), {1,6,16,36,66,76,86,96}, {1,2,4,5,6,7,8,9})

    RANDBETWEEN randomly assigns a number between 1 and 100
    If that number is between 1 and 5, it will assign a 1 to it
    between 6 and 15, a 2
    between 16 and 35 a 4
    and so on.
    A Similar technique can be used for your second formula. Give it a try. I'm rusty on my stats, will need to review for your last two formulas.

    Note: RANDBETWEEN is volatile and will change every time Excel does a calculation on the page. If you want to lock them in place, Copy> Paste Special> Values to remove the formula and make then constants.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1