You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
749 B
749 B
蒙特卡洛模拟X平方,x三次方
-> Math.random函数 -> math.max(a,b)函数
随机数的产生
-> f()等概率生产随机数 (int)Math.random -> 将函数改造为 0,1 发生器 -> 采用位运算生成数字的位 -> 利用左移合并生成的数字 -> 遇到不合适的数字就重做
通过不等概率,返回等概率
-> 两次返回的相同则重做,两次相反则保留 -> p*(1-p) 返回0 -> (1-p)*p 返回1 -> 实现对数器,生成随机样本能够检验数据
二分法查找数字
-> 确定循环条件 -> 调整边界状态
二分法查找最左数字,即有重复数字出现
-> 调整二分边界状态,存最小索引
归并排序
-> 先左右排序(递归) -> 后合并merge