Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Pseudorandom number generator
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Non-uniform generators== {{Main article|Pseudo-random number sampling}} Numbers selected from a non-uniform probability distribution can be generated using a [[Uniform distribution (continuous)|uniform distribution]] PRNG and a function that relates the two distributions. First, one needs the [[cumulative distribution function]] <math>F(b)</math> of the target distribution <math>f(b)</math>: :<math>F(b)=\int_{-\infty}^b f(b') \, db'</math> Note that <math>0=F(-\infty)\leq F(b) \leq F(\infty)=1</math>. Using a random number ''c'' from a uniform distribution as the probability density to "pass by", we get :<math>F(b)=c</math> so that :<math>b=F^{-1}(c)</math> is a number randomly selected from distribution <math>f(b)</math>. This is based on the [[inverse transform sampling]]. For example, the inverse of cumulative [[Gaussian distribution]] <math>\operatorname{erf}^{-1}(x)</math> with an ideal uniform PRNG with range (0, 1) as input <math>x</math> would produce a sequence of (positive only) values with a Gaussian distribution; however * When using practical number representations, the infinite "tails" of the distribution have to be truncated to finite values. * Repetitive recalculation of <math>\operatorname{erf}^{-1}(x)</math> should be reduced by means such as [[ziggurat algorithm]] for faster generation. Similar considerations apply to generating other non-uniform distributions such as [[Rayleigh distribution|Rayleigh]] and [[Poisson distribution|Poisson]].
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Pseudorandom number generator
(section)
Add topic