Non-Uniform Bernoulli Trials Exceedance Probability

Version 1.2.0.0 (565 Bytes) by William
Calculates the probability of exceeding a given number of hits for a collection of Bernoulli trials
803 Downloads
Updated 17 Apr 2009

No License

Calculates the probability of exceeding a given number of hits for a collection of Bernoulli trials, which is a test with a binary result (e.g. yes/no, 1/0, heads/tails). User inputs a vector of probabilities of success for each trial, p, and a number of successes, h, and this function outputs the probability of equaling or exceeding h.

Example:
There is a 30% chance of rain Saturday, and 20% Sunday. What is the
probability that it rains this weekend?

monte_exceedance([.3; .2],1)

ans =
0.4431

Which is reasonably close to the theoretical value of .44. Increasing the number of runs improves the accuracy:

monte_exceedance([.3; .2],1,100000)

ans =
0.4407

Cite As

William (2024). Non-Uniform Bernoulli Trials Exceedance Probability (https://www.mathworks.com/matlabcentral/fileexchange/23801-non-uniform-bernoulli-trials-exceedance-probability), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.2.0.0

Made a few improvements to the documentation

1.0.0.0