My Math Forum I'm Looking For A Random Number Generator With Variable Probabilities

 Probability and Statistics Basic Probability and Statistics Math Forum

 October 13th, 2016, 05:38 PM #1 Senior Member   Joined: Oct 2013 From: New York, USA Posts: 606 Thanks: 82 I'm Looking For A Random Number Generator With Variable Probabilities Free Online Random Number Generator and Checker is a random number generator where every number in the range is equally likely to be selected on any trial unless you place restrictions on frequencies, but you can't tell it to make one number more likely than another number. Can somebody find a random number generator where you can input the probabilities for each number? It doesn't need to be able to handle 100 probabilities, but I would like if it could handle 20 probabilities.
 October 13th, 2016, 08:35 PM #2 Senior Member     Joined: Sep 2015 From: USA Posts: 2,011 Thanks: 1044 probably the easiest way to do this is with a table. Suppose you have $N$ events each having $p_k$ probability of occuring. Further assume you have a random number generator that gives you uniform random real numbers [0,1]. Finally assume that you have some granularity of probability you are happy with so that you can write $p_k = \dfrac {m_k}{M}$ Now you create a table. The first $m_1$ entries point to the label for event 1 entries $m_1+1, m_1+m_2$ point to the label for event 2. entries $m_{n-1}+1, m_{n-1}+m_n$ point to the label for event $n$ As a quick example to make this clear. Suppose we have 5 events with a probability granularity of $\dfrac 1{10}$ Let's say the $m_k$'s are $\{1,3,2,1,3\}$ We make a $10$ element array as follows $\begin{bmatrix} 1\\ 2 \\ 2 \\ 2\\ 3 \\ 3 \\ 4 \\ 5 \\ 5 \\ 5 \end{bmatrix}$ You would get an RNG from your generator. Multiply it by 10 and round it to the nearest integer. Then use this an an index into the array and look up the corresponding event. Thanks from topsquark and EvanJ Last edited by romsek; October 13th, 2016 at 09:25 PM.
 October 13th, 2016, 09:53 PM #3 Senior Member     Joined: Sep 2015 From: USA Posts: 2,011 Thanks: 1044 Note that if you have a closed form formula for the probability of event $k$ in terms of $k$ there are easier ways of generating the random numbers with that distribution. The table method is for when you just have a list of desired probabilities for your events w/o any particular formula. Thanks from topsquark
 October 14th, 2016, 11:15 AM #4 Senior Member   Joined: Oct 2013 From: New York, USA Posts: 606 Thanks: 82 Thank you. I'm working with www.random.org but I would still prefer if there was a random number generator that you could input your own probabilities for.
October 14th, 2016, 11:18 AM   #5
Senior Member

Joined: Sep 2015
From: USA

Posts: 2,011
Thanks: 1044

Quote:
 Originally Posted by EvanJ Thank you. I'm working with www.random.org but I would still prefer if there was a random number generator that you could input your own probabilities for.
so writing your own is out of the question?

October 14th, 2016, 06:07 PM   #6
Senior Member

Joined: Oct 2013
From: New York, USA

Posts: 606
Thanks: 82

Quote:
 Originally Posted by romsek so writing your own is out of the question?
I can use the random number between 0 and 1 generator with decimal places. I don't know how to program a computer.

 October 14th, 2016, 06:51 PM #7 Senior Member     Joined: Sep 2015 From: USA Posts: 2,011 Thanks: 1044 were you going to use any software to do this? just do it by hand?
October 16th, 2016, 07:16 AM   #8
Senior Member

Joined: Oct 2013
From: New York, USA

Posts: 606
Thanks: 82

Quote:
 Originally Posted by romsek were you going to use any software to do this? just do it by hand?
I was hoping to use a website but not any software.

 Tags generator, number, probabilities, random, variable

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post cydler Probability and Statistics 4 July 27th, 2015 01:33 PM lawochekel Algebra 1 April 19th, 2012 12:39 PM rosalie Algebra 2 May 30th, 2010 01:10 AM oldjack Advanced Statistics 0 July 11th, 2009 06:30 PM grbradt Advanced Statistics 6 August 7th, 2007 02:21 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top