










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











● NRiC Chapter 7. ● Frequently needed to generate initial conditions. ● Often used to solve problems statistically. ● How can a computer generate a random number?
● User specifies an initial value, or seed. ● Initializing generator with same seed gives same sequence of "random" numbers. ● For a different sequence, use a different seed. ● One strategy is to use the current time, or the processor ID, to seed the generator.
● Follow these steps to minimize problems:
● Random numbers that lie within a specified range (typically 0 to 1), with any one number in the range as likely as any other, are uniform deviates. i.e. p ( x ) dx = dx if 0 < x < 1, 0 otherwise. ● Useful in themselves, often used to generate differently distributed deviates. ● Distinguish between linear generators (discussed next) and nonlinear generators (do a web search).
● The LCG method is very fast but it suffers from sequential correlations. ● If k random numbers at a time are used to plot points in k -dimensional space, points tend to lie on ( k -1)-dimensional hyperplanes. There will be at most m 1/ k planes, e.g. ~1600 if k =3 & m = 32 ! ● The quality of a LCG is measured by the maxi- mum distance between successive hyperplanes: the smaller the distance, the better.
● NRiC gives several uniform deviate generators: ● There is much discussion on the web of relative merits of RNGs. Recommended generators include TT800 and the Mersenne Twister. ran0 ^ ran1 ran2 ran3 ^ ranqd1 ^ ranqd2 ^ ran4 ^ ran1
● (^) Suppose we want p ( y ) dy = e
● Suppose we want to generate particle masses according to M dM = M dM , M [ M min
max
● From the transformation method we get: or ● (^) What happens if = -1? EFTS... = { [^ − ]} =[− ]
● A simple encryption/decryption algorithm can be constructed using random number generators. ● If both parties know the initial seed, they can both reproduce the same sequence of values. ● However, communicating the seed between parties carries risk. ● One popular technique is to combine public and private keys for secure communication.
● How do public & private keys work?
● The error term is 1, not a rigorous bound. ● Previous formula works fine if V is simple. ● What if we want to integrate a function g over a region W that is not easy to sample randomly? ● Solution: find a simple volume V that encloses W and define a new function f ( x ), x V such that: f ( x ) = g ( x ) for all x W f ( x ) = 0 otherwise
● Strategy: make V as close as possible to W , since zero values of f will increase the error estimate.