## Probability question

Jan 12, 2013 at 2:17am

# Probability question

Does this provide me with an equal 10% chance of any number being selected?
In other words, does the random object with an argument of 10 give any number between 0-9 an equal probability that it will be chosen?

– Pasted Max Patch, click to expand. –
#66030
Jan 12, 2013 at 7:21am

Hi,

Short : Yes.

Longer : It depends which degree of random you need.
I don’t know which RNG ( http://en.wikipedia.org/wiki/Random_number_generation ) is involved in [random] but if you want more well distributed series you may consider to use another one. Have a look on Peter Castine objects ( http://www.bek.no/~pcastine/Litter/ ).

#237727
Jan 12, 2013 at 7:01pm

The last time David Zicarelli wrote about this, [random] was simply using the linear congruence RNG from Numerical Recipes (the book is available online if you want full details).

The Linear Congruence algorithm gives a pretty flat distribution. It has several problems that make in unsuitable for hardcore statistical Monte Carlo simulations. For what you’re doing it’s probably more than good enough. Try the enclosed modification of your patch to get an idea of how many of each value you’ll get after 1,000,000 bangs. Working out if that is “close enough” to equi-probable is up to you.

– Pasted Max Patch, click to expand. –
#237728

You must be logged in to reply to this topic.