Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 R,我被指示在 0 和 1 之间生成 1000 个随机数,我使用 runif (1000) 来完成。然后我被告知要估计随机数在 0.4 和 0.6 之间的概率。我是 R 新手,希望得到任何帮助。谢谢。
你可以这样做:
a= runif(1000) d= a > 0.4 & a < 0.6 sum(d)/1000
最后一行是近似概率。