随机数发生器,其重力作用编号,以任何给定数量的范围? [英] Random number generator which gravitates numbers to any given number in range?

查看:137
本文介绍了随机数发生器,其重力作用编号,以任何给定数量的范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图想出一个随机数发生器,它返回0和1的重量在任何一个方向或其他返回值之间的浮点值。

I'm trying to come up with a random number generator which returns a float value between 0 and 1 weights the returned value in either one direction or the other.

有什么可靠的办法的基础上传递两个数字要做到这一点,说随机(0.5),其中0.5是指0,返回将倾向于对0.5到1之间的数字。

Is there any reliable way to do this based on passing in two numbers, say Random(0.5) where '0.5' means the number between 0 and 1 returned will gravitate towards 0.5.

推荐答案

这可能会帮助?

http://www.c-sharpcorner.com/UploadFile/trevormisfeldt/NormalDistribution08302005003434AM/NormalDistribution.aspx

这不会准确地解决您的问题,但我想知道,如果建模钟形曲线可能会提供你正在寻找的倾向。

It won't solve your problem precisely, but I'm wondering if modelling a bell curve might provide the tendency that you're looking for.

?虽然有趣的问题,我可以问你正在试图解决什么

Interesting problem though, can I ask what you're trying to solve ?

2日编辑:我只注意到另外一个S / O的问题,这可能有助于:

2nd I just noticed another S/O question that might help:

随机数基于正态分布

这篇关于随机数发生器,其重力作用编号,以任何给定数量的范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆