大连理工大学概率上机作业.docx
《大连理工大学概率上机作业.docx》由会员分享,可在线阅读,更多相关《大连理工大学概率上机作业.docx(30页珍藏版)》请在冰豆网上搜索。
![大连理工大学概率上机作业.docx](https://file1.bdocx.com/fileroot1/2023-2/23/6fe567ad-1fa1-43b9-aac6-c7008fd0c993/6fe567ad-1fa1-43b9-aac6-c7008fd0c9931.gif)
大连理工大学概率上机作业
第一次上机作业
1.利用Matlab自带命令产生1000个均匀随机变量服从U(0,1)。
>>unifrnd(0,1,20,50)
ans=
Columns1through10
0.81470.65570.43870.75130.35170.16220.10670.85300.78030.5470
0.90580.03570.38160.25510.83080.79430.96190.62210.38970.2963
0.12700.84910.76550.50600.58530.31120.00460.35100.24170.7447
0.91340.93400.79520.69910.54970.52850.77490.51320.40390.1890
0.63240.67870.18690.89090.91720.16560.81730.40180.09650.6868
0.09750.75770.48980.95930.28580.60200.86870.07600.13200.1835
0.27850.74310.44560.54720.75720.26300.08440.23990.94210.3685
0.54690.39220.64630.13860.75370.65410.39980.12330.95610.6256
0.95750.65550.70940.14930.38040.68920.25990.18390.57520.7802
0.96490.17120.75470.25750.56780.74820.80010.24000.05980.0811
0.15760.70600.27600.84070.07590.45050.43140.41730.23480.9294
0.97060.03180.67970.25430.05400.08380.91060.04970.35320.7757
0.95720.27690.65510.81430.53080.22900.18180.90270.82120.4868
0.48540.04620.16260.24350.77920.91330.26380.94480.01540.4359
0.80030.09710.11900.92930.93400.15240.14550.49090.04300.4468
0.14190.82350.49840.35000.12990.82580.13610.48930.16900.3063
0.42180.69480.95970.19660.56880.53830.86930.33770.64910.5085
0.91570.31710.34040.25110.46940.99610.57970.90010.73170.5108
0.79220.95020.58530.61600.01190.07820.54990.36920.64770.8176
0.95950.03440.22380.47330.33710.44270.14500.11120.45090.7948
Columns11through20
0.64430.31110.08550.03770.03050.05960.17340.95160.03260.2518
0.37860.92340.26250.88520.74410.68200.39090.92030.56120.2904
0.81160.43020.80100.91330.50000.04240.83140.05270.88190.6171
0.53280.18480.02920.79620.47990.07140.80340.73790.66920.2653
0.35070.90490.92890.09870.90470.52160.06050.26910.19040.8244
0.93900.97970.73030.26190.60990.09670.39930.42280.36890.9827
0.87590.43890.48860.33540.61770.81810.52690.54790.46070.7302
0.55020.11110.57850.67970.85940.81750.41680.94270.98160.3439
0.62250.25810.23730.13660.80550.72240.65690.41770.15640.5841
0.58700.40870.45880.72120.57670.14990.62800.98310.85550.1078
0.20770.59490.96310.10680.18290.65960.29200.30150.64480.9063
0.30120.26220.54680.65380.23990.51860.43170.70110.37630.8797
0.47090.60280.52110.49420.88650.97300.01550.66630.19090.8178
0.23050.71120.23160.77910.02870.64900.98410.53910.42830.2607
0.84430.22170.48890.71500.48990.80030.16720.69810.48200.5944
0.19480.11740.62410.90370.16790.45380.10620.66650.12060.0225
0.22590.29670.67910.89090.97870.43240.37240.17810.58950.4253
0.17070.31880.39550.33420.71270.82530.19810.12800.22620.3127
0.22770.42420.36740.69870.50050.08350.48970.99910.38460.1615
0.43570.50790.98800.19780.47110.13320.33950.17110.58300.1788
Columns21through30
0.42290.77880.25480.17590.64760.58220.40460.34770.82170.5144
0.09420.42350.22400.72180.67900.54070.44840.15000.42990.8843
0.59850.09080.66780.47350.63580.86990.36580.58610.88780.5880
0.47090.26650.84440.15270.94520.26480.76350.26210.39120.1548
0.69590.15370.34450.34110.20890.31810.62790.04450.76910.1999
0.69990.28100.78050.60740.70930.11920.77200.75490.39680.4070
0.63850.44010.67530.19170.23620.93980.93290.24280.80850.7487
0.03360.52710.00670.73840.11940.64560.97270.44240.75510.8256
0.06880.45740.60220.24280.60730.47950.19200.68780.37740.7900
0.31960.87540.38680.91740.45010.63930.13890.35920.21600.3185
0.53090.51810.91600.26910.45870.54470.69630.73630.79040.5341
0.65440.94360.00120.76550.66190.64730.09380.39470.94930.0900
0.40760.63770.46240.18870.77030.54390.52540.68340.32760.1117
0.82000.95770.42430.28750.35020.72100.53030.70400.67130.1363
0.71840.24070.46090.09110.66200.52250.86110.44230.43860.6787
0.96860.67610.77020.57620.41620.99370.48490.01960.83350.4952
0.53130.28910.32250.68340.84190.21870.39350.33090.76890.1897
0.32510.67180.78470.54660.83290.10580.67140.42430.16730.4950
0.10560.69510.47140.42570.25640.10970.74130.27030.86200.1476
0.61100.06800.03580.64440.61350.06360.52010.19710.98990.0550
Columns31through40
0.85070.73860.55230.12390.73780.55900.17810.89490.63110.6925
0.56060.58600.62990.49040.06340.85410.35960.07150.08990.5567
0.92960.24670.03200.85300.86040.34790.05670.24250.08090.3965
0.69670.66640.61470.87390.93440.44600.52190.05380.77720.0616
0.58280.08350.36240.27030.98440.05420.33580.44170.90510.7802
0.81540.62600.04950.20850.85890.17710.17570.01330.53380.3376
0.87900.66090.48960.56500.78560.66280.20890.89720.10920.6079
0.98890.72980.19250.64030.51340.33080.90520.19670.82580.7413
0.00050.89080.12310.41700.17760.89850.67540.09340.33810.1048
0.86540.98230.20550.20600.39860.11820.46850.30740.29400.1279
0.61260.76900.14650.94790.13390.98840.91210.45610.74630.5495
0.99000.58140.18910.08210.03090.54000.10400.10170.01030.4852
0.52770.92830.04270.10570.93910.70690.74550.99540.04840.8905
0.47950.58010.63520.14200.30130.99950.73630.33210.66790.7990
0.80130.01700.28190.16650.29550.28780.56190.29730.60350.7343
0.22780.12090.53860.62100.33290.41450.18420.06200.52610.0513
0.49810.86270.69520.57370.46710.46480.59720.29820.72970.0729
0.90090.48430.49910.05210.64820.76400.29990.04640.70730.0885
0.57470.84490.53580.93120.02520.81820.13410.50540.78140.7984
0.84520.20940.44520.72870.84220.10020.21260.76140.28800.9430
Columns41through50
0.68370.78940.11230.67330.09860.98790.59750.75930.80920.7519
0.13210.36770.78440.42960.14200.17040.33530.74060.74860.2287
0.72270.20600.29160.45170.16830.25780.29920.74370.12020.0642
0.11040.08670.60350.60990.19620.39680.45260.10590.52500.7673
0.11750.77190.96440.05940.31750.07400.42260.68160.32580.6712
0.64070.20570.43250.31580.31640.68410.35960.46330.54640.7152
0.32880.38830.69480.77270.21760.40240.55830.21220.39890.6421
0.65380.55180.75810.69640.25100.98280.74250.09850.41510.4190
0.74910.22900.43260.12530.89290.40220.42430.82360.18070.3908
0.58320.64190.65550.13020.70320.62070.42940.17500.25540.8161
0.74000.48450.10980.09240.55570.15440.12490.16360.02050.3174
0.23480.15180.93380.00780.18440.38130.02440.66600.92370.8145
0.73500.78190.18750.42310.21200.16110.29020.89440.65370.7891
0.97060.10060.26620.65560.07730.75810.31750.51660.93260.8523
0.86690.29410.79780.72290.91380.87110.65370.70270.16350.5056
0.08620.23740.48760.53120.70670.35080.95690.15360.92110.6357
0.36640.53090.76900.10880.55780.68550.93570.95350.79470.9509
0.36920.09150.39600.63180.31340.29410.45790.54090.57740.4440
0.68500.40530.27290.12650.16620.53060.24050.67970.44000.0600
0.59790.10480.03720.13430.62250.83240.76390.03660.25760.8667
2.参考课本综合例题2.5.4和2.5.5中的方法,模拟产生1000个随机变量,使其服从参数为2的指数分布,进而计算这1000个随机数的均值和方差。
建议函数:
function[y]=f(x)
%UNTITLEDSummaryofthisfunctiongoeshere
%Detailedexplanationgoeshere
y=-0.5*log(1-x);
end
>>a=unifrnd(0,1,10,100)
a=
Columns1through10
0.81470.15760.65570.70600.43870.27600.75130.84070.35170.0759
0.90580.97060.03570.03180.38160.67970.25510.25430.83080.0540
0.12700.95720.84910.27690.76550.65510.50600.81430.58530.5308
0.91340.48540.93400.04620.79520.16260.69910.24350.54970.7792
0.63240.80030.67870.09710.18690.11900.89090.92930.91720.9340
0.09750.14190.75770.82350.48980.49840.95930.35000.28580.1299
0.27850.42180.74310.69480.44560.95970.54720.19660.75720.5688
0.54690.91570.39220.31710.64630.34040.13860.25110.75370.4694
0.95750.79220.65550.95020.70940.58530.14930.61600.38040.0119
0.96490.95950.17120.03440.75470.22380.25750.47330.56780.3371
Columns11through20
0.16220.45050.10670.43140.85300.41730.78030.23480.54700.9294
0.79430.08380.96190.91060.62210.04970.38970.35320.29630.7757
0.31120.22900.00460.18180.35100.90270.24170.82120.74470.4868
0.52850.91330.77490.26380.51320.94480.40390.01540.18900.4359
0.16560.15240.81730.14550.40180.49090.09650.04300.68680.4468
0.60200.82580.86870.13610.07600.48930.13200.16900.18350.3063
0.26300.53830.08440.86930.23990.33770.94210.64910.36850.5085
0.65410.99610.39980.57970.12330.90010.95610.73170.62560.5108
0.68920.07820.25990.54990.18390.36920.57520.64770.78020.8176
0.74820.44270.80010.14500.24000.11120.05980.45090.08110.7948
Columns21through30
0.64430.20770.31110.59490.08550.96310.03770.10680.03050.1829
0.37860.30120.92340.26220.26250.54680.88520.65380.74410.2399
0.81160.47090.43020.60280.80100.52110.91330.49420.50000.8865
0.53280.23050.18480.71120.02920.23160.79620.77910.47990.0287
0.35070.84430.90490.22170.92890.48890.09870.71500.90470.4899
0.93900.19480.97970.11740.73030.62410.26190.90370.60990.1679
0.87590.22590.43890.29670.48860.67910.33540.89090.61770.9787
0.55020.17070.11110.31880.57850.39550.67970.33420.85940.7127
0.62250.22770.25810.42420.23730.36740.13660.69870.80550.5005
0.58700.43570.40870.50790.45880.98800.72120.19780.57670.4711
Columns31through40
0.05960.65960.17340.29200.95160.30150.03260.64480.25180.9063
0.68200.51860.39