Geometric Distribution MIT
来源:互联网 发布:windows phone8支付宝 编辑:程序博客网 时间:2024/06/11 12:49
#quote from MIT 'introduction to computation and programming using python, Revised'import randomimport pylab def successfulStarts(eventProb, numTrials): """Assumes eventProb is a float representing a probability of a single attempt being successful. numTrials a positive int Returns a list of the number of attempts needed before a success for each trial""" triesBeforeSuccess = [] for t in range(numTrials): consecFailures = 0 while random.random() > eventProb: consecFailures += 1 triesBeforeSuccess.append(consecFailures) return triesBeforeSuccess random.seed(0)probOfSuccess = 0.5numTrials = 5000distribution = successfulStarts(probOfSuccess, numTrials)pylab.hist(distribution, bins=14)pylab.xlabel('Tries Before success')pylab.ylabel('Number of Occurence Out of ' + str(numTrials))pylab.title('Probability of Starting Each Try ' + str(probOfSuccess))pylab.show()
0 0
- Geometric Distribution MIT
- Geometric Distribution DEMO
- 机器学习小组知识点11:几何分布(Geometric Distribution )
- 机器学习小组知识点12:超几何分布(Hyper-Geometric Distribution)
- Distribution
- MIT
- MIT
- Geometric Scaling
- Normal distribution & Gaussian distribution
- Normal Distribution(Gauss Distribution)
- Geometric tools: useful links
- poj 3449 Geometric Shapes
- poj 3449 Geometric Shapes
- POJ 3449 Geometric Shapes
- NYOJ-640 Geometric sum
- poj 3521 Geometric Map
- POJ 3449 Geometric Shapes
- NYOJ 640 Geometric Sum
- Windows环境配置gcc编译器
- UVALive 6953 Digi Comp II
- 使用sqlitedatabase存取图片要注意的事项
- Java对象的序列化和反序列化
- Android--网络连接之HttpURLConnection和HttpClient
- Geometric Distribution MIT
- sqlserver link-server的用法
- Windows版本下的Python Web 开发环境搭建
- POJ 3255 Roadblocks(Dijkstra)
- FTP工作原理
- 在ADF应用中,能够通过 oracle.adf.view.rich.security.FRAME_BUSTING 参数来使用framebusting功能。
- 一些android错误
- PAT 数据结构 03-树3. Tree Traversals Again (25)
- 如何在WebView中点击链接,使用自己的activity打开,不调用系统自带的浏览器