An Introduction to Random Number Generators and Monte .ppt
《An Introduction to Random Number Generators and Monte .ppt》由会员分享,可在线阅读,更多相关《An Introduction to Random Number Generators and Monte .ppt(46页珍藏版)》请在麦多课文档分享上搜索。
1、,An Introduction to Random Number Generators and Monte Carlo Methods,Josh Gilkerson Wei Li David Owen,Random Number Generators,Uses for Random Numbers,Monte Carlo Simulations Generation of Cryptographic Keys Evolutionary Algorithms Many Combinatorial Optimization Algorithms,Two Types of Random Numbe
2、rs,Pseudorandom numbers are numbers that appear random, but are obtained in a deterministic, repeatable, and predictable manner. True random numbers are generated in non-deterministic ways. They are not predictable. They are not repeatable.,True Random Generators,Use one of several sources of random
3、ness decay times of radioactive material electrical noise from a resistor or semiconductor radio channel or audible noise keyboard timings some are better than others usually slower than PRNGs,RNG And Random Machines,It is not viable to generate a true random number using computers since they are de
4、terministic. However, we can generate a good enough random numbers that have properties close to true random numbers. The first machine used to produce a table of 100,000 random digits was done by M. G. Kendall and B. Babington-Smith in 1939. RAND Corporation in 1955 released a table of a million ra
5、ndom digits. ERNIE is a random number generator machine used to pick the winning numbers in the British Premium Bonds lottery.,Desirable Properties of PRNGs,Uniform Lengthy period Serially uncorrelated Fast,Problems With PRNG,It is very difficult to pin point the problem with random number generator
6、s when they arise. Usually, the programmers would need to replace the whole random number generator with a better ones. With small test cases, problems rarely arises. However, when it gets to large scale random number generations (possibly in millions or even billions of numbers) the problem could b
7、e apparent. This makes debugging difficult. In large-scale computing problems, one might need to use a parallel algorithm. The effect is that, sometimes it is not possible to duplicate the simulation exactly.,Linear Congruential Generator(LCG),Most common Maximum period of 2n for n-bit numbers Xn+1=
8、( aXn + c ) mod m a,c,m are constants X0 is the seed,Advantages of LCG,Most common Very easily implemented Fast and small (remember only last number) Easily parallelized N processes 1 . N. numbers for process n are Xn+iN no more expensive than serial version.,Disadvantages of LCGs,Other generators h
9、ave longer maximum periods. Bad choices of M result in very bad sequences (primes work best, powers of 2 are fast, but not nearly as good). Initial seed affects period. Low order bits are not random.,Lagged Fibonacci Generators,Similar to Fibonacci Sequence Increasingly popular Xn = (Xn-l + Xn-k) mo
10、d m (lk0) l seeds are needed m usually a power of 2 Maximum period of (2l-1)x2M-1 when m=2M,Add-with-carry & Subtract-with-borrow,Similar to LFG AWC: Xn=(Xn-l+Xn-k+carry) mod m SWB: Xn=(Xn-l-Xn-k-carry) mod m,Multiply-with-carry Generators,Similar to LCG Xn=(aXn-1+carry) mod m,Inverse Congruential G
11、enerators,Xn=(a * Xn-1 + b) mod m m should be prime y is the multiplicative inverse of y in the field over 0,1,.,m-1.,PRNG Review,This is just a short review. There are many other PRNGs. Linear Congruential Generator Lagged Fibonacci Generator Add-with-carry Generator Subtract-with-carry Generator M
12、ultiply-with-carry Generator Inverse Congruential Generator,Testing Randomness,Test for uniform distribution (of singletons, pairs, triples, etc) of the sequence and all subsequences. DIEHARD - http:/stat.fsu.edu/pub/diehard/ NIST - http:/csrs.nist.gov/rng,Monte Carlo Methods,Introduction of Monte C
13、arlo,Monte Carlo methods have been used for centuries. However during World War II, this method was used to simulate the probabilistic issues with neutron diffusion (first real use). Named after the capital of Monaco (one of the worlds center for gambling), due to the similarity to games of chance.,
14、What is Monte Carlo,Non Monte Carlo methods typically involve ODE/PDE equations that describe the system. Monte Carlo methods are stochastic techniques. It is based on the use of random numbers and probability statistics to simulate problems. Something can be called a Monte Carlo method if it uses r
15、andom numbers to examine the problem it is solving. First, we would need to determine the probability density function (PDF). Then perform random sampling from the PDF. We keep record of each simulation performed and tally them.,Probability Density Function,A probability density function (or probabi
16、lity distribution function) is a function f defined on an interval (a, b) and having the following properties:,Why use Monte Carlo,It allows us to examine complex system. And is usually easy to formulate (independent of the problem). For example, solving equations which describe two atoms interactio
17、ns. This would be doable without using Monte Carlo method. But solving the interactions for thousands of atoms using the same equations is impossible. However, the solutions are imprecise and it can be very slow if higher precision is desired.,Components of Monte Carlo simulation,Probability distrib
18、ution functions (pdfs) - the physical (or mathematical) system must be described by a set of pdfs. Random number generator - a source of random numbers uniformly distributed on the unit interval must be available. Sampling rule - a prescription for sampling from the specified pdfs, assuming the avai
19、lability of random numbers on the unit interval, must be given. Scoring (or tallying) - the outcomes must be accumulated into overall tallies or scores for the quantities of interest.,Components of Monte Carlo simulation (cont.),Error estimation - an estimate of the statistical error (variance) as a
20、 function of the number of trials and other quantities must be determined. Variance reduction techniques - methods for reducing the variance in the estimated solution to reduce the computational time for Monte Carlo simulation Parallelization and vectorization - algorithms to allow Monte Carlo metho
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ANINTRODUCTIONTORANDOMNUMBERGENERATORSANDMONTEPPT

链接地址:http://www.mydoc123.com/p-378304.html