+ Reply to Thread
Results 1 to 4 of 4

Non-uniform random number generator

  1. #1
    Registered User
    Join Date
    03-20-2014
    Location
    Lecce, Italy
    MS-Off Ver
    Excel 2007
    Posts
    2

    Non-uniform random number generator

    Let p1, p2, ..., p10 some positive real numbers with sum 1. p1 represents the probability of extracting from a ballot box the number 1, p2 represents the probability of extracting from a ballot box number 2 etc.. I have to build a random sequence that approximates the draw of these balls.

    (example, if p1 = p2 = ... = p10 = 0.1) I have to create a sequence of numbers such as the one created from the function =randbetween(

    Do you have any ideas?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Non-uniform random number generator

    Lookup against the CDF:

    A
    B
    C
    1
    Num
    Cumu
    2
    0.022
    0.000
    B2: =N(A1)+N(B1)
    3
    0.258
    0.022
    4
    0.021
    0.280
    5
    0.219
    0.301
    6
    0.051
    0.520
    7
    0.123
    0.571
    8
    0.060
    0.694
    9
    0.023
    0.754
    10
    0.046
    0.777
    11
    0.177
    0.823
    12
    13
    1
    A13: =MATCH(RAND(), B2:B11)
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Non-uniform random number generator

    Does this help?
    http://www.mathwave.com/articles/ran...sheets-p2.html
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    03-20-2014
    Location
    Lecce, Italy
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Non-uniform random number generator

    Quote Originally Posted by Richard Buttrey View Post

    I don't want to pay. However, thank you shg!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 06-21-2013, 10:40 AM
  2. Random Number Generator
    By gandhikr in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-22-2013, 11:43 AM
  3. Random number generator
    By uncee in forum Excel General
    Replies: 6
    Last Post: 08-14-2007, 03:05 PM
  4. [SOLVED] Need Random Number Generator
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2006, 09:55 PM
  5. random number generator
    By manclad in forum Excel General
    Replies: 5
    Last Post: 12-31-2005, 07:10 AM

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