You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Purpose
This code is a simple utility that computes binomial coefficients C_{ n , k } for 0 <= n <= n_max and for 0 <= k <= k_max, where n_max and k_max are function inputs, with options to balance speed and accuracy.
Use Case
Its use case is to replace looping through individual calls to Matlab's nchoosek.
Notes
- The file binoms.m is the main function, while the file binoms__demo.mlx demonstrates an example of using the function.
- The user can decide how to balance speed and accuracy of the computation (see the demo for examples).
- Compared to the version '05 Jun 2026', this code should be faster and more accurate when used with any calc_type except 'safe' (in which case this code may be much slower).
- Use of the 'safe' option for the input calc_type may invoke Matlab's Symbolic Math Toolbox, depending on the values of the inputs n_max and k_max.
- Changes to this version were inspired by the comment from the author of [1] on the 'Discussions' section of this project.
References
[1] J. Simon, https://www.mathworks.com/matlabcentral/fileexchange/100174-noverk
Cite As
Nick Lorenzo (2026). Binomial Coefficients (https://in.mathworks.com/matlabcentral/fileexchange/184038-binomial-coefficients), MATLAB Central File Exchange. Retrieved .
Acknowledgements
Inspired: Incomplete (Partial) Bell Polynomials
General Information
- Version 2.0.0 (8.45 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
