Non-Uniform Bernoulli Trials Exceedance Probability
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
Platform Compatibility
Windows macOS LinuxCategories
- AI, Data Science, and Statistics > Statistics and Machine Learning Toolbox > Probability Distributions > Discrete Distributions > Binomial Distribution >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.