利用随机模拟的方法近似计算图3312中阴影部分(y=2-2x-x2与x轴围成的

利用随机模拟的方法近似计算图3312中阴影部分(y=2-2x-x2与x轴围成的图形)的面积.

   

答案

思路解析:利用随机模拟,产生阴影部分点的个数与矩形内的点的个数,两者之比近似为阴影面积与矩形面积的比.

    解:(1)利用计算机产生两组[0,1]上的均匀随机数,a1=RAND,b1=RAND;

(2)进行平移和伸缩变换,a=a1*4-3,b=b1*3,得到一组[-3,1]上的均匀随机数和一组[0,3]上的均匀随机数;

(3)统计试验总次数N和落在阴影内的点数N1(满足条件b<2-2a-a2的点(a,b)的个数);

(4)计算频率,即为点落在阴影部分的概率的近似值;

(5)设阴影部分面积为S,由几何概率公式得点落在阴影部分的概率为

=.

∴S≈

即为阴影部分的面积的近似值.

相关题目

电动自行车提供能量的装置为装在电池盒内的电池组,当它
电动自行车提供能量的装置为装在电池盒内的电池组,当它给电动机供电时,电动机将带动车轮转动。假设有一辆电动自行车,人和车的总质量为120kg。
 He had once been           with drug dealings, but evidence found
 He had once been           with drug dealings, but evidence found later proved his innocence. A. accused           B. sentenced         C. charged            
 —Many people have been out of work in China. —And ________ that the gover
 —Many people have been out of work in China. —And ________ that the government is always taking measures to increase the number of employment.A. in spite of       B. because of     
“士别三日,当刮目相看。”这句话要求我们: A.世界上没
“士别三日,当刮目相看。”这句话要求我们: A.世界上没有僵死的、一成不变的事物  B.世界上一切事物都是变化发展的C.要学会用发展的观点看问题
阅读《欣赏使人美丽》一文,完成下面题目。(10分)①面对
阅读《欣赏使人美丽》一文,完成下面题目。(10分)①面对同一棵树,有人看到绿叶,有人看到了毛毛虫。真诚的人能够感知到他人的真诚,而骗子总
右图是甲、乙两种固体的溶解度曲线。下列说法中错误的是 A
右图是甲、乙两种固体的溶解度曲线。下列说法中错误的是 A.t1℃时,50 g水中最多溶解15 g甲 B.t2℃时,甲、乙饱和溶液中溶质的质量分数一定相等 C
At last they climbed up the mountain,on the top of which      an old temp
At last they climbed up the mountain,on the top of which      an old temple dating back to 1,500 BC. A. is lying    B. there lies         C. does lie       D. 1ies
My aunt always loses her way when she is out by herself,because she has no __
My aunt always loses her way when she is out by herself,because she has no ________of direction. A.sense B.feeling C.touch D.scene

最新题目