如何在Excel中以给定的概率在两者之间选择一个值?
How to choose a value between the two, with given probability in Excel?
我在第 1 列中有概率列表。如何根据相应的概率用 0 和 1 填充第 2 列?
0.5 1
0.2 0
0.9 1
0.35 1
0.1 0
正如我在评论中所说;
generate random number with RAND from 0 to 1, compare with the probability. If it is bigger then it is 0, else 1.
=IF(RAND()>=A1,0,1)
我在第 1 列中有概率列表。如何根据相应的概率用 0 和 1 填充第 2 列?
0.5 1
0.2 0
0.9 1
0.35 1
0.1 0
正如我在评论中所说;
generate random number with RAND from 0 to 1, compare with the probability. If it is bigger then it is 0, else 1.
=IF(RAND()>=A1,0,1)