10182

# The Method of Inverse Transforms

This Demonstration illustrates the method of inverse transforms, which can be used to generate random numbers from a particular continuous or discrete probability distribution. By passing random numbers on the unit interval through the inverse of the cumulative distribution function (CDF), a sample of a random variable governed by that CDF is obtained. Each output is collected in a bin of an evolving histogram. During each iteration, the dotted red line running from the axis to the graph of the CDF to the axis illustrates the method explicitly. With multiple samples, you can obtain an approximation of the probability density function (PDF) associated with the given random variable. In this Demonstration, an assortment of continuous and discrete random variables are considered.

### DETAILS

You may choose from these distributions: exponential, uniform, triangular, Pareto, Gaussian, Rayleigh, binomial, negative binomial, geometric, and Poisson.
The method of inverse transforms is most often used to simulate a realization of a random variable associated with a particular distribution. Inverse transform sampling works as follows.
Consider, for example, a continuous random variable with cumulative distribution function . Let be a uniform random variable over the unit interval and pass through the inverse of the cumulative distribution function, that is, compute . We call the sample.
It can be seen that for a sufficiently large set of samples, the associated normalized histogram generates a close approximation to the probability density function of the random variable associated with the cumulative distribution function . A result of Kolmogorov asserts that if is continuous, then the rate of convergence in the sup-norm topology is .
For more information about generating samples from random variables, see, for example, S. M. Ross, Simulation, 3rd ed., London: Elsevier Academic Press, 2002.

### PERMANENT CITATION

 Share: Embed Interactive Demonstration New! Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details » Download Demonstration as CDF » Download Author Code »(preview ») Files require Wolfram CDF Player or Mathematica.

#### Related Topics

 RELATED RESOURCES
 The #1 tool for creating Demonstrations and anything technical. Explore anything with the first computational knowledge engine. The web's most extensive mathematics resource. An app for every course—right in the palm of your hand. Read our views on math,science, and technology. The format that makes Demonstrations (and any information) easy to share and interact with. Programs & resources for educators, schools & students. Join the initiative for modernizing math education. Walk through homework problems one step at a time, with hints to help along the way. Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet. Knowledge-based programming for everyone.