如何偏置一个随机数发生器 [英] how to bias a random number generator

查看:150
本文介绍了如何偏置一个随机数发生器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用随stl c ++提供的随机数生成器。我们如何偏好它,以便产生更小的随机数,其概率大于更大的随机数。

i am using the random number generator provided with stl c++. how do we bias it so that it produces smaller random numbers with a greater probability than larger random numbers.

推荐答案

case你可能想要一个概率分布。你可以从一个均匀的随机数生成器生成任何分布,问题只是它应该是什么样子。 拒绝抽样是生成难以描述的分布的常见方法,但在您的情况下,更简单的可能就足够了。

Well, in this case you probably would like a certain probability distribution. You can generate any distribution from a uniform random number generator, the question is only how it should look like. Rejection sampling is a common way of generating distributions that are hard to describe otherwise, but in your case something simpler might suffice.

您可以查看这篇文章用于许多常见的分布函数。 Chi Chi-Square 指数看起来很不错。

You can take a look at this article for many common distribution functions. Chi, Chi-Square and Exponential look like good candidates.

这篇关于如何偏置一个随机数发生器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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