Biased Random Number Generator

前端 未结 10 461
春和景丽
春和景丽 2020-12-09 12:41

I am looking for a random number generator that can be biased. For instance, say I want a random number between 1-5, with the probability being:

1: Comes up 20% of t

10条回答
  •  感情败类
    2020-12-09 13:41

    The Boost random number library provides the ability to specify different shaped distributions for your generator. It's a great library - see http://www.boost.org/doc/libs/1_42_0/libs/random/index.html.

提交回复
热议问题