{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

RandomNumbers

# RandomNumbers - AM 207 Random Numbers Spring 2013 Pavlos...

This preview shows pages 1–3. Sign up to view the full content.

AM 207 Random Numbers Spring 2013 Pavlos Protopapas 1 Intorduction We have introduced the concept of randomly throwing stones or randomly selecting pairs. In this lecture we will explore how computers generate random numbers. Randomness means lack of correlation. For a sequence of numbers r = r 1 , r 2 , . . . , r n we can define randomness as an asymptotic property of the series as N → ∞ . Since this is a hopeless task we can test randomness with a various tests described below. Long sequences of random numbers are needed in numerous applications, in particular methods which utilize random numbers such as Monte Carlo simulation techniques, stochas- tic optimization, cryptography calculations that simulate naturally random processes (e.g. thermal motion or radioactive decay). All these methods require fast and reliable random number sources. Many physical processes are random by nature and such processes can be used to produce random numbers. Examples are noise in semiconductor devices or throwing a dice. On the other hand computers are deterministic machines and because of that, they can not generate truly random numbers. In practice, random numbers are generated by pseudorandom number generators. These are deterministic algorithms, and consequently the generated numbers are only ”pseudo- random” and have their limitations. But for many applications, pseudorandom numbers can be successfully used to approximate real random numbers. Lets say that the probability of a random number to occur is P ( r ) and that means the probability of finding r i in the interval [ r j , r j + dr ] is P ( r ) dr . A uniform distribution means that P(r) is constant and that means all numbers are equally likely to occur. Not all random sequences are uniform. In other distributions (Normal, Poisson etc) not all numbers are equally likely to occur. 2 Random Number generators There plenty of random number generators. Most use integer arithmetic and the real numbers in (0 , 1] are produced by scaling. 2.1 Linear congruential generator The Linear congruential geneator is based on a integer recursive relation r i +1 = ( a r i + c ) mod M where a, c and M are constants. This generates a sequence r 1 , r 2 , . . . of random integers which are distributed between [0 , M - 1] (if c > 0) or between [1 , M ] (if c = 0). Each r i is i

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
scaled to the interval (0 , 1) by dividing by M . The parameter M is usually equal or nearly equal to the largest integer of the computer. This determines the period P of the generator and P < M . The first number in the sequence r 1 is an input and it is called the seed .
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern