ArticleslgStudy

biology

Non-uniform random variate generation

Non-uniform random variate generation is a biology topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Non-uniform random variate generation rather than just read about it. In short: Non-uniform random variate generation or pseudo-random number sampling is the numerical practice of generating pseudo-random numbers (PRN) that follow a given probability distribution. Methods are typically based on the availability of a uniformly distributed PRN generator.

Key takeaways

  • Non-uniform random variate generation belongs to biology; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Non-uniform random variate generation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Non-uniform random variate generation from memory before moving on to harder problems.

Reference excerpt

Non-uniform random variate generation or pseudo-random number sampling is the numerical practice of generating pseudo-random numbers (PRN) that follow a given probability distribution. Methods are typically based on the availability of a uniformly distributed PRN generator. Computational algorithms are then used to manipulate a single random variate, X, or often several such variates, into a new random variate Y such that these values have the required distribution. The first methods were developed for Monte-Carlo simulations in the Manhattan Project, published by John von Neumann in the early 1950s.

Finite discrete distributions For a discrete probability distribution with a finite number n of indices at which the probability mass function f takes non-zero values, the basic sampling algorithm is straightforward. The interval [0, 1) is divided in n intervals [0, f(1)), [f(1), f(1) + f(2)), ... The width of interval i equals the probability f(i). One draws a uniformly distributed pseudo-random number X, and searches for the index i of the corresponding interval. The so determined i will have the distribution f(i). Formalizing this idea becomes easier by using the cumulative distribution function

F ( i ) = ∑ j = 1 i f ( j ) . {\displaystyle F(i)=\sum _{j=1}^{i}f(j).}

It is convenient to set F(0) = 0. The n intervals are then simply [F(0), F(1)), [F(1), F(2)), ..., [F(n − 1), F(n)). The main computational task is then to determine i for which F(i − 1) ≤ X < F(i). This can be done by different algorithms:

Linear search, computational time linear in n. Binary search, computational time goes with log n. Indexed search, also called the cutpoint method. Alias method, computational time is constant, using some pre-computed tables. There are other methods that cost constant time.

Continuous distributions Generic methods for generating independent samples:

Rejection sampling for arbitrary density functions Inverse transform sampling for distributions whose CDF is known Ratio of uniforms, combining a change of variables and rejection sampling Slice sampling Ziggurat algorithm, for monotonically decreasing density functions as well as symmetric unimodal distributions Convolution random number generator, not a sampling method in itself: it describes the use of arithmetics on top of one or more existing sampling methods to generate more involved distributions. Generic methods for generating correlated samples (often necessary for unusually-shaped or high-dimensional distributions):

Markov chain Monte Carlo, the general principle Metropolis–Hastings algorithm Gibbs sampling Slice sampling Reversible-jump Markov chain Monte Carlo, when the number of dimensions is not fixed (e.g. when estimating a mixture model and simultaneously estimating the number of mixture components) Particle filters, when the observed data is connected in a Markov chain and should be processed sequentially For generating a normal distribution:

Box–Muller transform Marsaglia polar method For generating a Poisson distribution:

See Poisson distribution#Generating Poisson-distributed random variables

Software libraries

See also Beta distribution#Random variate generation Dirichlet distribution#Random variate generation Exponential distribution#Random variate generation Gamma distribution#Random variate generation Geometric distribution#Random variate generation Gumbel distribution#Random variate generation Laplace distribution#Random variate generation Multinomial distribution#Random variate distribution Pareto distribution#Random variate generation Poisson distribution#Random variate generation

Footnotes

Literature Devroye, L. (1986) Non-Uniform Random Variate Generation. New York: Springer Fishman, G.S. (1996) Monte Carlo. Concepts, Algorithms, and Applications. New York: Springer Hörmann, W.; J Leydold, G Derflinger (2004,2011) Automatic Nonuniform Random Variate Generation. Berlin: Springer. Knuth, D.E. (1997) The Art of Computer Programming, Vol. 2 Seminumerical Algorithms, Chapter 3.4.1 (3rd edition). Ripley, B.D. (1987) Stochastic Simulation. Wiley.

Worked examples

Example 1 — a first encounter with Non-uniform random variate generation

Start with the simplest possible case. Write down what Non-uniform random variate generation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In biology, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Non-uniform random variate generation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Non-uniform random variate generation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Non-uniform random variate generation

In research
Non-uniform random variate generation appears in biology research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Non-uniform random variate generation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Non-uniform random variate generation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Non-uniform random numbers, Pseudorandom number generators, so understanding it makes those chapters shorter.
In everyday life
Look for Non-uniform random variate generation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Non-uniform random variate generation” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Non-uniform random variate generation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Non-uniform random variate generation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Non-uniform random variate generation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Non-uniform random variate generation in simple terms?

Non-uniform random variate generation or pseudo-random number sampling is the numerical practice of generating pseudo-random numbers (PRN) that follow a given probability distribution. Methods are typically based on the availability of a uniformly distributed PRN generator.

Why does Non-uniform random variate generation matter?

Because it connects several biology ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Non-uniform random variate generation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Non-uniform random variate generation.

Tags

  • Non-uniform random numbers
  • Pseudorandom number generators

Keep exploring