Matlab课件chapter10

Matlab课件chapter10

ID:43192300

大小:1.31 MB

页数:11页

时间:2019-10-02

Matlab课件chapter10_第1页
Matlab课件chapter10_第2页
Matlab课件chapter10_第3页
Matlab课件chapter10_第4页
Matlab课件chapter10_第5页
资源描述:

《Matlab课件chapter10》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、MatlabMath随机数PseudorandomNumberformatlong;rand0.95012928514718pseudorandomnumber:Arandomsequenceisavaguenotion….inwhicheachtermisunpredictabletotheuninitiatedandwhosedigitspassacertainnumberofteststraditionalwithstatisticians…1951,D.H.Lehmer,BerkeleyHereisapagefromLehmer'sfamousdi

2、ssertationonthefunctionsnamedaftertheFrenchmathematicianEdouardLucas(1842-1891).ItsubsequentlyappearedinAnnalsofMathematicsandasamonographpublishedinHamburgbyLutcke&Wulff,bothin1930.Lehmer'sAlgorithmMultiplicativecongruentialalgorithm:整数a,c,m种子:11314271061622729538例如:a=13,c=0,m=31

3、,x0=1,输出:周期:m-1。可以通过除以m来得到[0,1]的一致分布的数0.03230.41940.45160.87100.32260.19350.5161…最小值:1/31,最大值:30/31IBM'sAlgorithm在1960年IBM主机系统的数学库包括随机数生成器:RND(RNDU):用32位的整数字长,modm运算可以快速进行,同时由于a=2^16+3,乘a也可以通过移位和加法进行。从这里可以看出,由RNDU生成的三个随机数之间有很强的相关性IBM'sAlgorithm-1-0.500.51-1-0.500.51-1-0.500.51rand

4、guirandutxMatlab'sAlgorithmS.K.ParkandK.W.Miller"Randomnumbergenerators:Goodonesarehardtofind",CommACM31(1988),issue10randguirandtx早期Matlab中的rand生成形似k/m的所有的实数,最小是:1/(2^31-1),最大是(m-1)/m=1-1/(2^31-1),大概2亿多个数。Matlab'sAlgorithm1995年,Matlab引入了一种完全不同的随机数生成器。GeorgeMarsaglia,FloridaStateU

5、niversity,anauthoroftheclassicanalysisofrandomnumbergenerators,"Randomnumbersfallmainlyintheplanes",(Proc.Nat.Acad.Sci.61(1968)这个算法是特别为浮点随机数设计的。新的生成器有35个字。其中32个字存浮点数z,剩下3个包括一个整数指标i,(1~32),一个随机整数j,和一个"borrow"标志b.Matlab'sAlgorithm“subtractwithborrow”i,i+5,i+20都是mod32如果z_i是正的,b在下一步设为

6、0;如果是负的,那么z_i+1变为正的,b在下一步设为2^(-53)(ulp)formathex;1/21/2+eps1/2+eps/2ulp:unitinthelastplaceforfloatingpointnumbersslightlylessthen1Marsaglia:将生成[1/2,1]中全部的数,[1/4,1/2]:一半[1/8,1/4]:四分之一Matlab'sAlgorithm在状态向量中的j的作用:Itistheresultofaseparate,independent,randomnumbergeneratorbasedonbitwi

7、selogicaloperations.Thefloatingpointfractionofeachz_iisxor-edwithjtoproducetheresultreturnedbythegenerator.We'renotsurewhetherornottheyallactuallygenerated,butwedon'tknowofanythatcan'tbe.ChristopherColumbusgenerator

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。