Note that there are some explanatory texts on larger screens.

plurals
  1. POExponential-decay-like-random-distribution and Discretization of continuous distributions
    primarykey
    data
    text
    <p>sadly I'm not really experienced in using random numbers in programming, despite the use of uniform integers in range. Therefore i have to questions regarding this topic.</p> <p><strong>Question 1 (more specific):</strong></p> <p>I'm looking for a way to chose array elements (dynamic size, but known) according to a probability distribution similar to the curve of <em>"exponential decay"</em> (<a href="http://en.wikipedia.org/wiki/Exponential_decay" rel="nofollow">http://en.wikipedia.org/wiki/Exponential_decay</a>). <strong>Meaning:</strong> i want to prefer to chose the first elements rather than the others. I want an monotonic decreasing function (no growing before decreasing like in many well-known probability-distributions like the gamma-distribution).</p> <p>Maybe the geometric-distribution is something which i could use? But then i need an answer to my second question regarding the scaling of this distribution to array indexes. </p> <p><em>The dual method to prefer choosing the last elements rather than the first would be ok too, of course.</em></p> <p><strong>Question 2 (more general):</strong> Is there a concept in any implementation which will scale me any continuous random-distribution to a given array-range (including discretization)?</p> <p>Example: Use a gaussian normal distribution and the result is always a valid index in some array (meaning: the middle elements are preferred).</p> <p>Could this (<a href="http://www.gnu.org/software/gsl/manual/html_node/General-Discrete-Distributions.html" rel="nofollow">link text</a>) be something like i want to use?</p> <p><strong>Platform and Libraries:</strong> I'm programming in <strong>C++</strong> and use the <strong>boost::random</strong> library at the moment (<a href="http://www.boost.org/doc/libs/1_44_0/doc/html/boost_random.html" rel="nofollow">link text</a>), but i'm willing to use something like the the <strong>gsl library</strong> or other <em>quality</em> libraries.</p> <p><strong>One more wish:</strong> I would prefer a way using some <em>quality</em> libraries rather than some quick-and-dirty custom_functions.</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload