简体   繁体   中英

Probability of Failure in Excel

Suppose I have probability of failure p = 0.2. Failure is defined as 0 and success is 1. How can I simulate this on an Excel cell (such that I can drag it down)? That is, a formula that yields 0 with a probability of 20% and 1 with 80%.

Thanks!

rand函数返回一个介于0和1之间的小数。如果它小于.2,则可以认为它是失败的。

=IF(RAND()<0.2,0,1)

RAND()将给出一个介于0和1之间的随机数,因此您可以直接在IF中使用它:

=IF(RAND()<0.2,0,1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM