




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、高尔顿钉板试验模拟(程序)这是我2005年12的课程设计中程序的核心部分,写完后自己非常得意,等着老师表扬。等啊等, 等待现在也没等到:em16:现将它献给大家(若有版权那遵守BSD吧)注1:程序以前是用Matlab写的现用Java重写注2:原程序中galton返回值为int口 grid、没有“输出结果”部分 public void galton(int sumOfGrid, int sumOfBall)int口 grid = new intsumOfGrid;int number = 0;/一个小球从顶端落下过程中向右偏移的总次数int rand ;/随机数,取值范围为0,1,为0、为1的概
2、率相等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;gridnumber+;number = 0;/</核心>/输出结果System.out.println("小球的总数为"+sumOfBall+
3、"t 格子的个数为"+sumOfGrid );for( int index = 0; index < grid.length; index+ )System.out.println( (index+1)+”号格子中的小球数为:t"+gridindex);/end of metod galton补充:(谢谢2楼提醒:-D )高尔顿钉板试验:自板上端放入一小球,任其自由落下.在下落过程中,当小球碰到钉子时,从左边落 下与从右边落下的机会相等.碰到下一排钉子也是如此.自板上端放入n(n自行输入)个小球,观察小球 落下后呈现曲线并统计小球落入各个格子的频率 .钉子一
4、小球格子高尔顿钉板试验可见概率论(复旦大学李贤平)当小球数量少时分布无明显特征,当小球数量多时(>100)分布近似正态分布。(即两边对称:-D)当时为了证明服从正态分布投1千万个小球(计算机模拟:-D)Galton BoardThe 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 wi
5、th 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
6、 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 direct
7、ly 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
8、 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 therows are numbered from 0 to N -1, he path of each falling ball is a Bernoulli trial con
9、sisting of N steps. 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
10、 number of balls is sufficiently large and一 "一 1 : , 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 depe
11、nds 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).AXL RRLLLR LLRL LftLL RLLLLLRR RLRL LRLR RRLLLRQL RLLRRRRRPfnbdbilici«sC.
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 鱼我所欲也课件
- 高顿网校注会课件价格
- 济南市2024-2025学年九年级上学期语文期末测试试卷
- 高铁供电安全知识培训课件
- 电芯基础知识培训
- 电脑知识培训教材课件
- 电力设施迁改合同(货币补偿)
- rtk考试题及答案
- pisa考试试题及答案
- 电网基础知识培训课程内容课件
- 2024-2030年中国系统级芯片(SoC)测试机行业市场发展现状及竞争格局与投资战略研究报告
- 的夫妻分居证明格式范例合集
- 女性绝经期自测表(Kupperman改良评分)
- 手术室俯卧位
- 幼儿园大班美术活动《三原色-加色法原理》
- 种植牙二期修复
- EXCEL表格数据的统计分析课件
- 《建筑法律知识》课件
- 《快消品行业分析》课件
- 印刷服务投标方案(技术方案)
- 医疗器械经营质量管理制度、工作程序文件目录
评论
0/150
提交评论