本文介绍了的JavaScript的Math.random正态分布(高斯钟形曲线)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,如果JavaScript函数的Math.random是正态分布与否,如果不是我怎么能得到哪些是正常的分布数量。我还没有发现在intert一个明确的答案或算法如何创建我的理解随机正态分布的数字。我想重建施密特机(德国物理学家),机器产生的随机数的0或1,他们必须是正态分布的,所以我可以在高斯钟形曲线绘制它们。例如随机函数产生120数字(0或1)和平均。需要成为近60次0和1

I want to know if the JavaScript function Math.random is normal distribution or not, if not how can I get numbers which are normal distribution. I haven't found a clear answer in the intert or a algorithm how to create randomly normal distributed numbers which I understand. I want to rebuilt a Schmidt-machine (Germanphysicist), the machine produces random numbers of 0 or 1 and they have to be normal distributed so I can draw them in Gaussian bell curve.for example the random function produce 120 numbers (0 or 1) and the avg. Have to be near 60 times 0 and 1.

我希望有人能帮助我。

推荐答案

由于尖指出随机分布均匀,而你的情况是不是你正在寻找的东西。但是你可以自己计算高斯,你只需要设置你的变化和中位数。

As Pointy pointed random has uniform distribution, which in your case is not the thing you are looking for. But you can calculate gaussian yourself, you only have to set your variance and median.

它说,高斯= RandomNumber *西格玛+位数

it says that Gausian = RandomNumber * sigma + median

其它几种方法如何转换<一个href="http://stackoverflow.com/questions/75677/converting-a-uniform-distribution-to-a-normal-distribution?rq=1">uniform分布正态分布。

several other methods how to convert uniform distribution to normal distribution.

顺便说一句你高斯将不会是一个钟形曲线,如果你只有两个可能的事件。进而,如果这些事件是等概率的,那么它应该看起来像一个块。

And by the way your gaussian will not be a bell curve if you have only two probable events. And furthermore if those events are of equal probability then it should look like a block.

这篇关于的JavaScript的Math.random正态分布(高斯钟形曲线)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 17:39