Faster binornd using notmal approximation for large values

Behaves exactly like binornd, but uses a much faster normal approximation for large numbers,
179 Downloads
Updated 27 Jan 2014

View License

This function takes the same input as the matlab built-in function binornd, and returns statistically (almost) identical output, potentially in much shorter time. For n,p values for which np,n(1-p)>5 a much fasternormal approximation is used with mean=np,var=np(1-p). For the rest, the regular binornd function is used.

This function can be faster by a factor of 5-10 than binornd for large numbers, but can be used the same way.

Cite As

Itai Rusinek (2026). Faster binornd using notmal approximation for large values (https://www.mathworks.com/matlabcentral/fileexchange/45218-faster-binornd-using-notmal-approximation-for-large-values), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Random Number Generation in Help Center and MATLAB Answers
Version Published Release Notes
1.0.0.0