most random number generators at present are based on linear recurrence relations one of the most important random number generators is the multiple-recursive generator (mrgof order kwhich generates sequence of integers xk xk+ via the linear recurrence xt ( xt- ak xt- mod mt kk ( for some modulus and multipliers {ai khere "modrefers to the modulo operationn mod is the remainder when is divided by the recurrence is initialized by specifying "seeds" xk- to yield fast algorithmsall but few of the multipliers should be when is large integerone can obtain stream of pseudo-random numbers uk uk+ between and from the sequence xk xk+ simply by setting ut xt / it is also possible to set small modulusin particular the output function for such modulo generators is then typically of the form ut multiplerecursive generator modulus multipliers modulo generators xtw+ - - = for some ke or examples of modulo generators are the feedback shift register generatorsthe most popular of which are the mersenne twistersseefor example[ and [ mrgs with excellent statistical properties can be implemented efficiently by combining several simpler mrgs and carefully choosing their respective moduli and multipliers one of the most successful is 'ecuyer' mrg generatorsee [ from now onwe assume that the reader has sound random number generator available feedback shift register mersenne twisters simulating random variables simulating random variable from an arbitrary (that isnot necessarily uniformdistribution invariably involves the following two steps simulate uniform random numbers uk on ( for some return ( uk )where is some real-valued function the construction of suitable functions is as much of an art as science many simulation methods may be foundfor examplein [ and the accompanying website www montecarlohandbook org two of the most useful general procedures for generating random variables are the inverse-transform method and the acceptance-rejection method before we discuss thesewe show one possible way to simulate standard normal random variables in python we can generate standard normal random variables via the randn method of the numpy random module example (simulating standard normal random variablesif and are independent standard normally distributed random variables (that isxy ~iid ( ))then their joint pdf is ( + (xy(xyr which is radially symmetric function in example we see thatin polar coordinatesthe angle th that the random vector [xy]makes with the positive -axis is (