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.
The first methods were developed for Monte-Carlo simulations in the Manhattan project,[citation needed] published by John von Neumann in the early 1950s.
One draws a uniformly distributed pseudo-random number X, and searches for the index i of the corresponding interval.
Formalizing this idea becomes easier by using the cumulative distribution function It is convenient to set F(0) = 0.