idea is illustrated in the following graph: Note that the distribution does not change if we start with 1-y instead of y. For computational purposes, it therefore suffices to generate random numbers y in [0, 1] and then simply calculate Proof of correctness Let be a cumulative distribution function, and let be its generalized inverse function (using the infimum because CDFs are weakly monotonic and right-continuous): Claim: If is a uniform random variable on then has as its CDF. Proof: Truncated distribution Inverse transform sampling can be simply extended to cases of truncated distributions on the interval without the cost of rejection sampling: the same algorithm can be followed, but instead of generating a random number uniformly distributed between 0 and 1, generate uniformly distributed between and , and then again take . Reduction of the number of inversions In order to obtain a large number of samples, one needs to perform the same number of inversions of the distribution. One possible way to reduce the number of inversions while obtaining a large number of samples is the application of the so-called Stochastic Collocation Monte Carlo sampler (SCMC sampler) within a polynomial chaos expansion framework. This allows us to generate any number of Monte Carlo samples with only a few inversions of the original distribution with independent samples of a variable for which the inversions are analytically available, for example the standard normal variable. See also Probability integral transform Copula, defined by means of probability integral transform. Quantile function, for the explicit construction of inverse CDFs. Inverse distribution function for a precise mathematical definition for distributions with discrete components. References Monte Carlo methods Non-uniform random numbers