## Suppose we want to generate a deviate from a distribution

*p*(*y*)*dy*, where*p*(*y*) =*f*(*y*), with*y*ranging from*y*min to*y*max.## Let

*F*(*y*) be the cumulative distribution of*f*(*y*), from*y*min to*y*.## Set a uniform deviate

*x*=*F*(*y*)/*F*(*y*max) and solve for*y*: this is the new generation function.## Only useful if

*F*-1(*x*) is easy to compute.