george landon chao shen chengdong li an introduction
play

George Landon Chao Shen Chengdong Li An Introduction George - PowerPoint PPT Presentation

George Landon Chao Shen Chengdong Li An Introduction George Landon Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin. John Von Neumann (1951) Introduction Introduction Definition


  1. George Landon Chao Shen Chengdong Li

  2. An Introduction George Landon

  3. Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin. – John Von Neumann (1951)

  4. Introduction Introduction � Definition � History � Types � Tests for Randomness � Uses

  5. Webster Defines Random Webster Defines Random � Lacking a definite plan, purpose, or pattern � A set where each of the elements has equal probability of occurrence

  6. Random Numbers Random Numbers � A sequence in which each term is unpredictable – D. H. Lehmer (1951) � Examples between 1 and 100 – 29, 95, 11, 60, 22

  7. History according to Knuth History according to Knuth In times of yore: Balls were drawn out of well stirred urns - Dice were rolled - Cards were dealt -

  8. Organizing Random Numbers Organizing Random Numbers � In 1927, L.H.C Tippet published a table of 40,000 random digits � Mechanically Driven – Special Machines were used to generate random numbers � Kendall and Babington-Smith (1939) – Generated a table of 100,000 random digits � RAND Corporation (1955) – Generated a table of 1,000,000 random digits

  9. Types Types � Truly Random � Pseudorandom � Quasi-Random

  10. Truly Random Truly Random � Follows directly from definition of random. � Each element has equal probability of being chosen from the set.

  11. Truly Random Examples Truly Random Examples � Randomly emmited particles of radiation – Geiger Counter � Thermal noise from a resistor – Intel’s Random Number Generator

  12. Pseudorandom Pseudorandom � A finite set of numbers that display qualities of random numbers � Tests can show that there are patterns � Subsequent numbers can be “guessed”

  13. Quasi- -Random Random Quasi � A series of numbers satisfying some mathematical random properties even though no random appearance is provided � Good for Monte-Carlo methods – Lower discrepancies offer better convergence

  14. Some Tests for Randomness Some Tests for Randomness � Entropy – Information density of the content of a sequence High density usually means random � � Arithmetic Mean � Chi-square Test – Provides a probability for the randomness for a sequence � An example Pseudorandom number test – http://www.fourmilab.ch/random/

  15. Practical Uses Practical Uses � Simulation � Computer Programming � Decision Making � Recreation

  16. Simulation Simulation � Simulate natural phenomena on a computer � Used for experiments in sterile conditions to make them more realistic � Useful in all of the Applied Disciplines

  17. Computer Programming Computer Programming � Test program effectiveness � Test algorithm correctness – Instead of all possible inputs use a few random numbers � Microsoft has used this logic in testing their software

  18. Decision Making Decision Making � When an “unbiased” decision is needed – Fixed decision can cause some algorithms to run more slowly � Good way of choosing who goes first – Sporting events

  19. Recreation Recreation � Lottery – Equal odds – The KY Lottery uses Microsoft Excel’s RNG for “various second chance drawings“ � Casinos – Provides a chance for “luck”

  20. Recreation (cont) Recreation (cont) � Video Games – Random events keep games entertaining – Q-bert

  21. References References � 3D Project Team. http://icfa3d.web.cern.ch/ICFA3D/3D/html2/nod e1.html � ENT - A Pseudorandom Number Sequence Test Program. http://www.fourmilab.ch/random/ � Knuth, D. The Art of Computer Programming – Volume 2. 1971 � Random.org. h ttp://www.random.org/essay.html

  22. Classification Chao Shen

  23. Classification of random numbers Classification of random numbers � Truely random numbers � Pseudo-random numbers � Quasi-random numbers

  24. The advantages of true random The advantages of true random numbers numbers � No periodicities. � Not based on an algorithm. � No predictability of random numbers based on knowledge of preceding sequences. � Certainty that no hidden correlations are present.

  25. Example : ZRANDOM Example : ZRANDOM

  26. Pseudo- -random number random number Pseudo generator generator � The pseudo-random number generator requires a number to start with that gets plugged in to the set of equations. After that it uses part of the result from the last time it was used as input to the next iteration. This starting number is called the seed.

  27. Methods for Random Number Methods for Random Number Generation Generation � Linear Congruential Generators � Lagged Fibonnaci Generators � Shift Register Generators � Combined Generators

  28. Linear Congruential Congruential Generators Generators Linear (LCG) (LCG) � X i =(aX i-1 +c) Mod m � where m is the modulus, a the multiplier, and c the additive constant or addend. The size of the modulus constrains the period, and it is usually chosen to be either prime or a power of 2. � LCGs are not recommended to be used in computer simulations, nor any other purposes which require higher degrees of randomness.

  29. Example ( LCG) Example ( LCG) � Let a=1,c=5,m=16 and x 0 =1. � The sequence of pseudo-random integers generated by this algorithm is: 1,6,15,12,13,2,11,8,9,14,7,4,5,10,3,0,1,6,15, 12,13,2,11,8,9,14,….

  30. Improvement of LCG Improvement of LCG � Multiple recursive generators (MRG) X i =( a 1 X i-1 +a 2 X i-2 +….. +a k X i-k +b) mod M � By choosing k > 1 will increase the time taken to generate each number, but will greatly improve the period and randomness properties of the generator

  31. Lagged Fibonnaci Fibonnaci Generators Generators Lagged � LFGs have become popular recently. The name comes from the Fibonacci sequence : 1, 1, 2, 3, 5, 8, ...…(X n = X n-1 + X n-2 ). � LFGs generate random numbers from the following iterative scheme: X n = X n-i X n-k (mod m), i and k are lags, i >k, and is a binary operation.

  32. Shift Register Generators Shift Register Generators � Shift register (SRG) generators are generally used in a form where they can be considered as a special case of a lagged Fibonacci generator using XOR. � XOR gives by far the worst randomness properties of any operation for an LFG, so these generators are not recommended.

  33. Combined Generators Combined Generators � Better quality sequences can often be obtained by combining the output of the basic generators to create a new random sequence as : Z n = X n Y n � where is typically either the exclusive-or operator or addition modulo some integer m, and x and y are sequences from two independent generators.

  34. Requirements for Sequential Random Requirements for Sequential Random Number Generators Number Generators � uniformly distributed � uncorrelated � never repeats itself � satisfy any statistical test for randomness � reproduceable � portable

  35. Requirements for Sequential Random Requirements for Sequential Random Number Generators Number Generators (continue) (continue) � can be changed by adjusting an initial “seed” value � can easily be split into many independent subsequences � can be generated rapidly using limited computer memory

  36. Parallel Random Number Parallel Random Number Generators Generators � Many different parallel random number generators have been proposed, but most of them use the same basic concept, which is to parallelize a sequential generator by taking the elements of the sequence of pseudo-random numbers it generates and distributing them among the processors in some way.

  37. The Leapfrog Method The Leapfrog Method � Ideally we would like a parallel random number generator to produce the same sequence of random numbers for different numbers of processors. A simple way to achieve this goal is for processor P of an N processor machine to generate the sub- sequence � X P , X P+N , X P+2N , …. ,

  38. Sequence Splitting Sequence Splitting � This can be done by splitting the sequence into non-overlapping contiguous sections, each generated by a different processor. X PL , X PL+1 , X PL+2 , …, � Generators that apply leapfrog and sequence splitting method

  39. Independent Sequences Independent Sequences � This method is similar to sequence splitting, in that each processor generates a different, contiguous section of the sequence. However in this case the starting point in the sequence is chosen at random for each processor, rather than computed in advance using a regular increment.

  40. Requirements for Parallel Random Requirements for Parallel Random Number Generators Number Generators � there should be no inter-processor correlation � sequences generated on each processor should satisfy the qualities of serial random number generators � it should generate same sequence for different number of processors � it should work for any number of processors � there should be no data movement between processors

Recommend


More recommend