This question shows research effort; it is useful and clear
1
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
给定一个随机数生成器,它在具有均匀密度的区间(即for和其他地方r())中生成(伪)随机数,创建一个随机数生成器,它在密度为的区间中生成 a 。double[0,1]p(x) = 10 <= x <= 1p(x) = 0r(a,b)double[a,b]p(x) = 1/(b-a)a <= x <= b