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!

Answers


The rand function returns a decimal between 0 and 1. If it's less than .2, you can consider it a failure.

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

Need Your Help

XAMPP - PHP Stopped Working After Being Copied

php mysql apache .htaccess xampp

I created a website with multiple tables in phpMyAdmin, multiple pages and files (html, php, jquery, javascript, css) using XAMPP.

Ideal Location to Set default layout for Zend Framework 2 Controller?

php layout controller zend-framework2

I want to set a different layout for a new Controller, please provide your suggestion on an ideal location to set it across the controller? Right now I am using $this-&gt;layout() in each and ever