高尔顿钉板试验模拟(程序)
更新时间:2023-05-10 02:34:01 阅读量: 实用文档 文档下载
高尔顿钉板试验模拟(程序)
高尔顿钉板试验模拟(程序)
...这是我2005年12的课程设计中程序的核心部分,写完后自己非常得意,等着老师表扬。等啊等,等待现在也没等到 :em16:
现将它献给大家...(若有版权那遵守BSD吧) 注1:程序以前是用Matlab写的现用Java重写
注2:原程序中 galton返回值为 int[] grid 、没有“输出结果”部分
public void galton(int sumOfGrid, int sumOfBall){ int[] grid = new int[sumOfGrid];
int number = 0; //一个小球从顶端落下过程中向右偏移的总次数
int rand ; //随机数,取值范围为{0,1},为0、为1的概率相等
for( int counter_ball = 1; counter_ball <= sumOfBall; counter_ball++ ){ //<核心>
// (sumOfGrid - 1)为钉板的层数
for( int times = 1; times <= ( sumOfGrid - 1 ); times++ ){ rand = (int)( Math.random()*2 ); number += rand; }
grid[number]++; number = 0; //</核心> }
//输出结果
System.out.println( "小球的总数为"+sumOfBall+"\t格子的个数为"+sumOfGrid );
for( int index = 0; index < grid.length; index++ )
System.out.println( (index+1)+"号格子中的小球数为:\t"+grid[index] ); }
}//end of metod galton
高尔顿钉板试验模拟(程序)
补充:(谢谢2楼提醒 :-D )
高尔顿钉板试验:自板上端放入一小球, 任其自由落下.在下落过程中, 当小球碰到钉子时, 从左边落下与从右边落下的机会相等.碰到下一排钉子也是如此.自板上端放入n(n自行输入)个小球, 观察小球落下后呈现曲线并统计小球落入各个格子的频率.
高尔顿钉板试验可见《概率论》(复旦大学 李贤平)
当小球数量少时分布无明显特征,当小球数量多时(>100)分布近似正态分布。(即两边对称:-D) 当时为了证明服从正态分布投1千万个小球(计算机模拟 :-D)
高尔顿钉板试验模拟(程序)
Galton Board
The Galton board, also known as a quincunx or bean machine, is a device for statistical experiments named after English scientist Sir Francis Galton. It consists of an upright board with evenly spaced nails (or pegs) driven into its upper half, where the nails are arranged in staggered order, and a lower half divided into a number of evenly-spaced rectangular slots. The front of the device is covered with a glass cover to allow viewing of both nails and slots. In the middle of the upper edge, there is a funnel into which balls can be poured, where the diameter of the balls must be much smaller than the distance between the nails. The funnel is located precisely above the central nail of the second row so that each ball, if perfectly centered, would fall vertically and directly onto the uppermost point of this nail's surface (Kozlov and Mitrofanova 2002). The figure above shows a variant of the board in which only the nails that can potentially be hit by a ball dropped from the funnel are included, leading to a triangular array instead of a rectangular one.
Each time a ball hits one of the nails, it can bounce right (or left) with some probability p(and q 1 p). For symmetrically placed nails, balls will bounce left or right with equal probability, so p q 1/2. If the rows are numbered from 0 to N 1, he path of each falling ball is a Bernoulli trial consisting ofNsteps. Each ball crosses the bottom row hitting the nth peg from the left (where0 n N 1) if it has taken exactly right turns, which occurs with probability
This process therefore gives rise to a binomial distribution of in the heights of heaps of balls in the lower slots.
If the number of balls is sufficiently large and, then according to the weak law of large numbers, the distribution of the heights of the ball heaps will approximate a normal distribution.
Some care is needed to obtain these idealized results, however, as the actual distribution of balls depends on physical properties of the setup, including the elasticity of the balls (as characterized by their coefficient of restitution), the radius of the nails, and the offsets of the balls over the funnel's opening when they are dropped (Kozlov and Mitrofanova 2002).
高尔顿钉板试验模拟(程序)
z
数理统计
y
x
--------------------------------------------------------------------------------------------------------------------------------Reproduction Forbidden Page 4 of 8
高尔顿钉板试验模拟(程序)
z
数理统计
y
x
--------------------------------------------------------------------------------------------------------------------------------Reproduction Forbidden Page 5 of 8
高尔顿钉板试验模拟(程序)
z
数理统计
y
x
--------------------------------------------------------------------------------------------------------------------------------Reproduction Forbidden Page 6 of 8
高尔顿钉板试验模拟(程序)
z
数理统计
y
x
--------------------------------------------------------------------------------------------------------------------------------Reproduction Forbidden Page 7 of 8
高尔顿钉板试验模拟(程序)
z
数理统计
y
x
--------------------------------------------------------------------------------------------------------------------------------Reproduction Forbidden Page 8 of 8
正在阅读:
高尔顿钉板试验模拟(程序)05-10
关于健康的英文作文08-19
山东大学西方经济学历年真题09-06
陕西省2004年中考试题07-06
30部必读的投资学经典07-29
顾问式营销精英技能培训08-28
概率论课后习题解答06-28
狂犬病是一种严重威胁人类生命的疾病06-17
- 教学能力大赛决赛获奖-教学实施报告-(完整图文版)
- 互联网+数据中心行业分析报告
- 2017上海杨浦区高三一模数学试题及答案
- 招商部差旅接待管理制度(4-25)
- 学生游玩安全注意事项
- 学生信息管理系统(文档模板供参考)
- 叉车门架有限元分析及系统设计
- 2014帮助残疾人志愿者服务情况记录
- 叶绿体中色素的提取和分离实验
- 中国食物成分表2020年最新权威完整改进版
- 推动国土资源领域生态文明建设
- 给水管道冲洗和消毒记录
- 计算机软件专业自我评价
- 高中数学必修1-5知识点归纳
- 2018-2022年中国第五代移动通信技术(5G)产业深度分析及发展前景研究报告发展趋势(目录)
- 生产车间巡查制度
- 2018版中国光热发电行业深度研究报告目录
- (通用)2019年中考数学总复习 第一章 第四节 数的开方与二次根式课件
- 2017_2018学年高中语文第二单元第4课说数课件粤教版
- 上市新药Lumateperone(卢美哌隆)合成检索总结报告
- 高尔顿
- 试验
- 模拟
- 程序
- 议论文之总分结构
- 2013考研政治毛中特第十五章-中国特色社会主义事业的领导核心
- 2011普及性健美操评分规则
- 秋季小学数学教研工作计划
- 第四纪课2+地层与地质年表第二部分
- 上海市小学英语三年级下册期中测试卷(4)(无听力音频)
- 89HPES16T7中文资料
- 企业销售管理系统设计论文之令狐文艳创作
- 无答案版:低压电工作业安全培训考试题库
- 保护动物建议书600字范文【5篇】
- 学雷锋先进个人活动策划书
- 鹿城中学音乐教研组工作计划
- Broadlink刘宗孺:打造智能家居2.0 呼吁合作共赢
- 九年义务教育全日制小学劳动课教学大纲(试用)
- 江西省九江外国语学校2020-2021学年九年级12月月考物理试题
- 工程塑料聚甲醛的生产及其应用研究
- AVL_CRUISE_2014_整车经济性动力性分析操作指导书
- 化工废水处理设备系统优点
- 第三节植物体的结构层次(含机械组织)
- 北京大学MBA论坛全部资料打包3